├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ └── main.yml ├── .gitignore ├── .gitmodules ├── .rubocop.yml ├── Gemfile ├── Gemfile.lock ├── README.md ├── Rakefile ├── assets ├── ceedling ├── ceedling.cmd ├── default_gitignore ├── example_file.c ├── example_file.h ├── example_file_call.c ├── example_file_call.h ├── project.yml ├── test_example_file.c ├── test_example_file_boom.c ├── test_example_file_crash.c ├── test_example_file_success.c ├── test_example_file_unity_printf.c ├── test_example_file_verbose.c ├── test_example_file_with_mock.c ├── test_example_with_parameterized_tests.c ├── tests_with_defines │ ├── src │ │ ├── adc_hardware.c │ │ ├── adc_hardware.h │ │ ├── adc_hardware_configurator.c │ │ └── adc_hardware_configurator.h │ └── test │ │ ├── test_adc_hardware.c │ │ └── test_adc_hardware_special.c ├── tests_with_preprocessing │ ├── src │ │ ├── adc_hardwareA.c │ │ ├── adc_hardwareA.h │ │ ├── adc_hardwareB.c │ │ ├── adc_hardwareB.h │ │ ├── adc_hardwareC.c │ │ ├── adc_hardwareC.h │ │ ├── adc_hardware_configuratorA.h │ │ ├── adc_hardware_configuratorB.h │ │ └── adc_hardware_configuratorC.h │ └── test │ │ ├── test_adc_hardwareA.c │ │ ├── test_adc_hardwareB.c │ │ └── test_adc_hardwareC.c └── uncovered_example_file.c ├── bin ├── actions_wrapper.rb ├── app_cfg.rb ├── ceedling ├── cli.rb ├── cli_handler.rb ├── cli_helper.rb ├── configinator.rb ├── mixinator.rb ├── mixins.rb ├── objects.yml ├── path_validator.rb ├── projectinator.rb └── versionator.rb ├── ceedling.gemspec ├── config └── test_environment.rb ├── docs ├── BreakingChanges.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Ceedling Basic Porting.pdf ├── Ceedling Managing Release Code.pdf ├── Ceedling Working with IDEs.pdf ├── CeedlingPacket.md ├── CeedlingPullRequestChecklist.md ├── CeedlingUpgrade.md ├── Changelog.md ├── PluginDevelopmentGuide.md ├── ReleaseNotes.md ├── SECURITY.md └── ThrowTheSwitchCodingStandard.md ├── examples └── temp_sensor │ ├── README.md │ ├── mixin │ ├── add_gcov.yml │ └── add_unity_helper.yml │ ├── project.yml │ ├── src │ ├── AdcConductor.c │ ├── AdcConductor.h │ ├── AdcHardware.c │ ├── AdcHardware.h │ ├── AdcHardwareConfigurator.c │ ├── AdcHardwareConfigurator.h │ ├── AdcModel.c │ ├── AdcModel.h │ ├── AdcTemperatureSensor.c │ ├── AdcTemperatureSensor.h │ ├── Executor.c │ ├── Executor.h │ ├── IntrinsicsWrapper.c │ ├── IntrinsicsWrapper.h │ ├── Main.c │ ├── Main.h │ ├── Model.c │ ├── Model.h │ ├── ModelConfig.h │ ├── TaskScheduler.c │ ├── TaskScheduler.h │ ├── TemperatureFilter.c │ ├── TemperatureFilter.h │ ├── TimerConductor.c │ ├── TimerConductor.h │ ├── TimerConfigurator.c │ ├── TimerConfigurator.h │ ├── TimerHardware.c │ ├── TimerHardware.h │ ├── TimerInterruptConfigurator.c │ ├── TimerInterruptConfigurator.h │ ├── TimerInterruptHandler.c │ ├── TimerInterruptHandler.h │ ├── TimerModel.c │ ├── TimerModel.h │ ├── Types.h │ ├── UsartConductor.c │ ├── UsartConductor.h │ ├── UsartConfigurator.c │ ├── UsartConfigurator.h │ ├── UsartHardware.c │ ├── UsartHardware.h │ ├── UsartModel.c │ ├── UsartModel.h │ ├── UsartPutChar.c │ ├── UsartPutChar.h │ ├── UsartTransmitBufferStatus.c │ ├── UsartTransmitBufferStatus.h │ └── calculators │ │ ├── TemperatureCalculator.c │ │ ├── TemperatureCalculator.h │ │ ├── UsartBaudRateRegisterCalculator.c │ │ └── UsartBaudRateRegisterCalculator.h │ └── test │ ├── TestExecutor.c │ ├── TestMain.c │ ├── TestModel.c │ ├── TestTaskScheduler.c │ ├── TestTemperatureCalculator.c │ ├── TestTemperatureFilter.c │ ├── TestTimerConductor.c │ ├── TestTimerHardware.c │ ├── TestTimerIntegrated.c │ ├── TestTimerModel.c │ ├── TestUsartBaudRateRegisterCalculator.c │ ├── TestUsartConductor.c │ ├── TestUsartHardware.c │ ├── TestUsartIntegrated.c │ ├── TestUsartModel.c │ ├── adc │ ├── TestAdcConductor.c │ ├── TestAdcHardware.c │ └── TestAdcModel.c │ └── support │ ├── UnityHelper.c │ └── UnityHelper.h ├── lib ├── ceedling.rb ├── ceedling │ ├── application.rb │ ├── backtrace.gdb │ ├── build_batchinator.rb │ ├── cacheinator.rb │ ├── cacheinator_helper.rb │ ├── config_matchinator.rb │ ├── config_walkinator.rb │ ├── configurator.rb │ ├── configurator_builder.rb │ ├── configurator_plugins.rb │ ├── configurator_setup.rb │ ├── configurator_validator.rb │ ├── constants.rb │ ├── defaults.rb │ ├── defineinator.rb │ ├── dependinator.rb │ ├── encodinator.rb │ ├── erb_wrapper.rb │ ├── exceptions.rb │ ├── file_finder.rb │ ├── file_finder_helper.rb │ ├── file_path_collection_utils.rb │ ├── file_path_utils.rb │ ├── file_system_wrapper.rb │ ├── file_wrapper.rb │ ├── flaginator.rb │ ├── generator.rb │ ├── generator_helper.rb │ ├── generator_mocks.rb │ ├── generator_test_results.rb │ ├── generator_test_results_backtrace.rb │ ├── generator_test_results_sanity_checker.rb │ ├── generator_test_runner.rb │ ├── include_pathinator.rb │ ├── loginator.rb │ ├── makefile.rb │ ├── objects.yml │ ├── parsing_parcels.rb │ ├── plugin.rb │ ├── plugin_manager.rb │ ├── plugin_manager_helper.rb │ ├── plugin_reportinator.rb │ ├── plugin_reportinator_helper.rb │ ├── preprocessinator.rb │ ├── preprocessinator_extractor.rb │ ├── preprocessinator_file_handler.rb │ ├── preprocessinator_includes_handler.rb │ ├── rake_utils.rb │ ├── rake_wrapper.rb │ ├── rakefile.rb │ ├── release_invoker.rb │ ├── release_invoker_helper.rb │ ├── reportinator.rb │ ├── rules_release.rake │ ├── rules_tests.rake │ ├── setupinator.rb │ ├── stream_wrapper.rb │ ├── system_utils.rb │ ├── system_wrapper.rb │ ├── task_invoker.rb │ ├── tasks_base.rake │ ├── tasks_filesystem.rake │ ├── tasks_release.rake │ ├── tasks_tests.rake │ ├── test_context_extractor.rb │ ├── test_invoker.rb │ ├── test_invoker_helper.rb │ ├── test_runner_manager.rb │ ├── tool_executor.rb │ ├── tool_executor_helper.rb │ ├── tool_validator.rb │ ├── verbosinator.rb │ └── yaml_wrapper.rb └── version.rb ├── license.txt ├── plugins ├── beep │ ├── README.md │ ├── config │ │ ├── defaults.yml │ │ └── defaults_beep.rb │ └── lib │ │ └── beep.rb ├── bullseye │ ├── README.md │ ├── assets │ │ └── template.erb │ ├── bullseye.rake │ ├── config │ │ └── defaults.yml │ └── lib │ │ └── bullseye.rb ├── command_hooks │ ├── README.md │ └── lib │ │ └── command_hooks.rb ├── compile_commands_json_db │ ├── README.md │ └── lib │ │ └── compile_commands_json_db.rb ├── dependencies │ ├── README.md │ ├── Rakefile │ ├── config │ │ └── defaults.yml │ ├── dependencies.rake │ ├── example │ │ ├── boss │ │ │ ├── project.yml │ │ │ ├── src │ │ │ │ ├── boss.c │ │ │ │ ├── boss.h │ │ │ │ └── main.c │ │ │ └── test │ │ │ │ └── test_boss.c │ │ ├── supervisor │ │ │ ├── project.yml │ │ │ ├── src │ │ │ │ ├── supervisor.c │ │ │ │ └── supervisor.h │ │ │ └── test │ │ │ │ └── test_supervisor.c │ │ ├── version.tar.gzip │ │ └── workerbees.zip │ └── lib │ │ └── dependencies.rb ├── fff │ ├── README.md │ ├── Rakefile │ ├── config │ │ └── fff.yml │ ├── examples │ │ └── fff_example │ │ │ ├── build │ │ │ └── .gitignore │ │ │ ├── project.yml │ │ │ ├── src │ │ │ ├── bar.c │ │ │ ├── bar.h │ │ │ ├── custom_types.h │ │ │ ├── display.c │ │ │ ├── display.h │ │ │ ├── event_processor.c │ │ │ ├── event_processor.h │ │ │ ├── foo.c │ │ │ ├── foo.h │ │ │ └── subfolder │ │ │ │ ├── zzz.c │ │ │ │ └── zzz.h │ │ │ └── test │ │ │ ├── test_event_processor.c │ │ │ └── test_foo.c │ ├── lib │ │ ├── fff.rb │ │ └── fff_mock_generator.rb │ ├── spec │ │ ├── fff_mock_header_generator_spec.rb │ │ ├── fff_mock_source_generator_spec.rb │ │ ├── header_generator.rb │ │ └── spec_helper.rb │ ├── src │ │ └── fff_unity_helper.h │ └── vendor │ │ └── fff │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── buildandtest │ │ ├── examples │ │ ├── Makefile │ │ ├── driver_testing │ │ │ ├── Makefile │ │ │ ├── driver.c │ │ │ ├── driver.h │ │ │ ├── driver.test.cpp │ │ │ ├── driver.test.fff.cpp │ │ │ ├── hardware_abstraction.h │ │ │ └── registers.h │ │ └── embedded_ui │ │ │ ├── DISPLAY.h │ │ │ ├── Kata.txt │ │ │ ├── Makefile │ │ │ ├── SYSTEM.h │ │ │ ├── UI.c │ │ │ ├── UI.h │ │ │ ├── UI_test_ansic.c │ │ │ ├── UI_test_cpp.cpp │ │ │ └── test_suite_template.c │ │ ├── fakegen.rb │ │ ├── fff.h │ │ ├── gtest │ │ ├── Makefile │ │ ├── gtest-all.cc │ │ ├── gtest-main.cc │ │ └── gtest.h │ │ └── test │ │ ├── Makefile │ │ ├── c_test_framework.h │ │ ├── fff_test_c.c │ │ ├── fff_test_cpp.cpp │ │ ├── fff_test_global_c.c │ │ ├── fff_test_global_cpp.cpp │ │ ├── global_fakes.c │ │ ├── global_fakes.h │ │ └── test_cases.include ├── gcov │ ├── README.md │ ├── config │ │ ├── defaults.yml │ │ └── defaults_gcov.rb │ ├── gcov.rake │ └── lib │ │ ├── gcov.rb │ │ ├── gcov_constants.rb │ │ ├── gcovr_reportinator.rb │ │ ├── reportgenerator_reportinator.rb │ │ └── reportinator_helper.rb ├── module_generator │ ├── README.md │ ├── Rakefile │ ├── assets │ │ ├── stubby1.h │ │ └── stubby2.h │ ├── config │ │ └── module_generator.yml │ ├── example │ │ └── project.yml │ ├── lib │ │ └── module_generator.rb │ └── module_generator.rake ├── report_build_warnings_log │ ├── README.md │ ├── config │ │ └── defaults.yml │ └── lib │ │ └── report_build_warnings_log.rb ├── report_tests_gtestlike_stdout │ ├── README.md │ ├── assets │ │ └── template.erb │ ├── config │ │ └── report_tests_gtestlike_stdout.yml │ └── lib │ │ └── report_tests_gtestlike_stdout.rb ├── report_tests_ide_stdout │ ├── README.md │ ├── config │ │ └── report_tests_ide_stdout.yml │ └── lib │ │ └── report_tests_ide_stdout.rb ├── report_tests_log_factory │ ├── README.md │ ├── config │ │ └── defaults.yml │ ├── lib │ │ ├── cppunit_tests_reporter.rb │ │ ├── html_tests_reporter.rb │ │ ├── json_tests_reporter.rb │ │ ├── junit_tests_reporter.rb │ │ ├── report_tests_log_factory.rb │ │ └── tests_reporter.rb │ └── sample_html_report.png ├── report_tests_pretty_stdout │ ├── README.md │ ├── assets │ │ └── template.erb │ ├── config │ │ └── report_tests_pretty_stdout.yml │ └── lib │ │ └── report_tests_pretty_stdout.rb ├── report_tests_raw_output_log │ ├── README.md │ └── lib │ │ └── report_tests_raw_output_log.rb └── report_tests_teamcity_stdout │ ├── README.md │ ├── config │ ├── defaults.yml │ └── report_tests_teamcity_stdout.yml │ └── lib │ └── report_tests_teamcity_stdout.rb ├── spec ├── config_walkinator_spec.rb ├── configurator_builder_spec.rb ├── configurator_helper_spec.rb ├── configurator_spec.rb ├── file_finder_helper_spec.rb ├── gcov │ ├── gcov_deployment_spec.rb │ └── gcov_test_cases_spec.rb ├── generator_test_results_sanity_checker_spec.rb ├── generator_test_results_spec.rb ├── manual │ └── stress_test.rb ├── parsing_parcels_spec.rb ├── preprocessinator_extractor_spec.rb ├── preprocessinator_includes_handler_spec.rb ├── reportinator_spec.rb ├── spec_helper.rb ├── spec_system_helper.rb ├── support │ ├── other_target.yml │ ├── target.yml │ ├── test_example.fail │ ├── test_example.pass │ ├── test_example_empty.pass │ ├── test_example_ignore.pass │ ├── test_example_mangled.pass │ └── test_example_with_time.pass ├── system │ ├── deployment_as_gem_spec.rb │ ├── deployment_as_vendor_spec.rb │ ├── example_temp_sensor_spec.rb │ └── upgrade_as_vendor_spec.rb ├── system_utils_spec.rb ├── test_context_extractor_spec.rb ├── tool_executor_helper_spec.rb └── uncategorized_specs_spec.rb └── vendor └── diy ├── History.txt ├── LICENSE.txt ├── README.rdoc ├── Rakefile ├── TODO.txt ├── diy.gemspec ├── lib ├── diy.rb └── diy │ └── factory.rb ├── sample_code ├── car.rb ├── chassis.rb ├── diy_example.rb ├── engine.rb └── objects.yml └── test ├── constructor.rb ├── diy_test.rb ├── factory_test.rb ├── files ├── broken_construction.yml ├── cat │ ├── cat.rb │ ├── extra_conflict.yml │ ├── heritage.rb │ ├── needs_input.yml │ └── the_cat_lineage.rb ├── dog │ ├── dog_model.rb │ ├── dog_presenter.rb │ ├── dog_view.rb │ ├── file_resolver.rb │ ├── other_thing.rb │ └── simple.yml ├── donkey │ ├── foo.rb │ └── foo │ │ └── bar │ │ └── qux.rb ├── factory │ ├── beef.rb │ ├── dog.rb │ ├── factory.yml │ ├── farm │ │ ├── llama.rb │ │ └── pork.rb │ └── kitten.rb ├── fud │ ├── objects.yml │ └── toy.rb ├── functions │ ├── attached_things_builder.rb │ ├── invalid_method.yml │ ├── method_extractor.rb │ ├── nonsingleton_objects.yml │ ├── objects.yml │ ├── thing.rb │ ├── thing_builder.rb │ └── things_builder.rb ├── gnu │ ├── objects.yml │ └── thinger.rb ├── goat │ ├── base.rb │ ├── can.rb │ ├── goat.rb │ ├── objects.yml │ ├── paper.rb │ ├── plane.rb │ ├── shirt.rb │ └── wings.rb ├── horse │ ├── holder_thing.rb │ └── objects.yml ├── namespace │ ├── animal │ │ ├── bird.rb │ │ ├── cat.rb │ │ └── reptile │ │ │ ├── hardshell │ │ │ └── turtle.rb │ │ │ └── lizard.rb │ ├── bad_module_specified.yml │ ├── class_name_combine.yml │ ├── hello.txt │ ├── no_module_specified.yml │ ├── objects.yml │ ├── road.rb │ ├── sky.rb │ └── subcontext.yml ├── non_singleton │ ├── air.rb │ ├── fat_cat.rb │ ├── objects.yml │ ├── pig.rb │ ├── thread_spinner.rb │ ├── tick.rb │ └── yard.rb └── yak │ ├── core_model.rb │ ├── core_presenter.rb │ ├── core_view.rb │ ├── data_source.rb │ ├── fringe_model.rb │ ├── fringe_presenter.rb │ ├── fringe_view.rb │ ├── giant_squid.rb │ ├── krill.rb │ ├── my_objects.yml │ └── sub_sub_context_test.yml └── test_helper.rb /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | # These files are text and should be normalized (convert crlf to lf) 4 | *.rb text 5 | *.test text 6 | *.c text 7 | *.cpp text 8 | *.h text 9 | *.txt text 10 | *.yml text 11 | *.s79 text 12 | *.bat text 13 | *.xcl text 14 | *.inc text 15 | *.info text 16 | *.md text 17 | makefile text 18 | rakefile text 19 | bin/ceedling text 20 | 21 | #These files are binary and should not be normalized 22 | *.doc binary 23 | *.odt binary 24 | *.pdf binary 25 | *.ewd binary 26 | *.eww binary 27 | *.dni binary 28 | *.wsdt binary 29 | *.dbgdt binary 30 | *.mac binary 31 | *.cmd binary 32 | assets/ceedling binary 33 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: ThrowTheSwitch 2 | #patreon: # Replace with a single Patreon username 3 | #open_collective: # Replace with a single Open Collective username 4 | #ko_fi: # Replace with a single Ko-fi username 5 | #tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 6 | #community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 7 | #liberapay: # Replace with a single Liberapay username 8 | #issuehunt: # Replace with a single IssueHunt username 9 | #lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 10 | #polar: # Replace with a single Polar username 11 | #buy_me_a_coffee: # Replace with a single Buy Me a Coffee username 12 | #thanks_dev: # Replace with a single thanks.dev username 13 | #custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | .swp 3 | Gemfile.lock 4 | 5 | out.fail 6 | 7 | tags 8 | *.taghl 9 | 10 | build/ 11 | examples/temp_sensor/vendor/ 12 | examples/temp_sensor/build/ 13 | plugins/fff/examples/fff_example/build/ 14 | plugins/module_generator/example/build/ 15 | plugins/dependencies/example/boss/build/ 16 | plugins/dependencies/example/boss/third_party/ 17 | plugins/dependencies/example/supervisor/build/ 18 | 19 | ceedling.sublime-project 20 | ceedling.sublime-workspace 21 | ceedling-*.gem 22 | .DS_Store 23 | .ruby-version 24 | /.idea 25 | /.vscode 26 | /GIT_COMMIT_SHA 27 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vendor/c_exception"] 2 | path = vendor/c_exception 3 | url = https://github.com/ThrowTheSwitch/CException.git 4 | branch = master 5 | [submodule "vendor/unity"] 6 | path = vendor/unity 7 | url = https://github.com/ThrowTheSwitch/Unity.git 8 | branch = master 9 | [submodule "vendor/cmock"] 10 | path = vendor/cmock 11 | url = https://github.com/ThrowTheSwitch/CMock.git 12 | branch = master 13 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | source "http://rubygems.org/" 9 | 10 | gem "bundler", "~> 2.5" 11 | 12 | # Testing tools 13 | gem "rspec", "~> 3.8" 14 | gem "rake", ">= 12", "< 14" 15 | gem "rr" 16 | gem "require_all" 17 | 18 | # Ceedling dependencies 19 | gem "diy", "~> 1.1" 20 | gem "constructor", "~> 2" 21 | gem "thor", "~> 1.3" 22 | gem "deep_merge", "~> 1.2" 23 | gem "unicode-display_width", "~> 3.1" 24 | gem "erb", "~> 4.0" 25 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: http://rubygems.org/ 3 | specs: 4 | constructor (2.0.0) 5 | deep_merge (1.2.2) 6 | diff-lcs (1.5.1) 7 | diy (1.1.2) 8 | constructor (>= 1.0.0) 9 | rake (13.2.1) 10 | require_all (3.0.0) 11 | rr (3.1.1) 12 | rspec (3.13.0) 13 | rspec-core (~> 3.13.0) 14 | rspec-expectations (~> 3.13.0) 15 | rspec-mocks (~> 3.13.0) 16 | rspec-core (3.13.2) 17 | rspec-support (~> 3.13.0) 18 | rspec-expectations (3.13.3) 19 | diff-lcs (>= 1.2.0, < 2.0) 20 | rspec-support (~> 3.13.0) 21 | rspec-mocks (3.13.2) 22 | diff-lcs (>= 1.2.0, < 2.0) 23 | rspec-support (~> 3.13.0) 24 | rspec-support (3.13.1) 25 | thor (1.3.2) 26 | unicode-display_width (3.1.2) 27 | unicode-emoji (~> 4.0, >= 4.0.4) 28 | unicode-emoji (4.0.4) 29 | 30 | PLATFORMS 31 | ruby 32 | x64-mingw-ucrt 33 | x64-mingw32 34 | x86_64-darwin-22 35 | x86_64-linux 36 | 37 | DEPENDENCIES 38 | bundler (~> 2.5) 39 | constructor (~> 2) 40 | deep_merge (~> 1.2) 41 | diy (~> 1.1) 42 | rake (>= 12, < 14) 43 | require_all 44 | rr 45 | rspec (~> 3.8) 46 | thor (~> 1.3) 47 | unicode-display_width (~> 3.1) 48 | 49 | BUNDLED WITH 50 | 2.5.23 51 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | # ========================================================================= 3 | # Ceedling - Test-Centered Build System for C 4 | # ThrowTheSwitch.org 5 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 6 | # SPDX-License-Identifier: MIT 7 | # ========================================================================= 8 | 9 | require 'bundler' 10 | require 'rspec/core/rake_task' 11 | 12 | desc "Run all rspecs" 13 | RSpec::Core::RakeTask.new(:spec) do |t| 14 | t.pattern = 'spec/**/*_spec.rb' 15 | end 16 | 17 | Dir['spec/**/*_spec.rb'].each do |p| 18 | base = File.basename(p,'.*').gsub('_spec','') 19 | desc "rspec #{base}" 20 | RSpec::Core::RakeTask.new("spec:#{base}") do |t| 21 | t.pattern = p 22 | end 23 | end 24 | 25 | task :default => [:spec] 26 | task :ci => [:spec] 27 | -------------------------------------------------------------------------------- /assets/ceedling: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ========================================================================= 3 | # Ceedling - Test-Centered Build System for C 4 | # ThrowTheSwitch.org 5 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 6 | # SPDX-License-Identifier: MIT 7 | # ========================================================================= 8 | 9 | ruby vendor/ceedling/bin/ceedling $* 10 | -------------------------------------------------------------------------------- /assets/ceedling.cmd: -------------------------------------------------------------------------------- 1 | ruby vendor\ceedling\bin\ceedling %* 2 | -------------------------------------------------------------------------------- /assets/default_gitignore: -------------------------------------------------------------------------------- 1 | # Ignore the build/ directory in the root of the project. 2 | # Generally speaking, best practice is to omit generated files from revision control. 3 | /build/ 4 | 5 | # But reserve the artifacts/ subdirectory for revision control. 6 | # Ceedling's notion of artifacts includes reports or release binaries you *may* want to revision. 7 | !/build/artifacts/ 8 | -------------------------------------------------------------------------------- /assets/example_file.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "example_file.h" 9 | 10 | int add_numbers(int a, int b) { 11 | return a + b; 12 | } 13 | 14 | int difference_between_numbers(int a, int b) { 15 | return a - b; 16 | } 17 | -------------------------------------------------------------------------------- /assets/example_file.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef EXAMPLE_FILE_H 9 | #define EXAMPLE_FILE_H 10 | 11 | int add_numbers(int a, int b); 12 | 13 | int difference_between_numbers(int a, int b); 14 | 15 | #endif /* EXAMPLE_FILE_H */ 16 | -------------------------------------------------------------------------------- /assets/example_file_call.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "example_file_call.h" 9 | #include "example_file.h" 10 | 11 | int call_add_numbers(int a, int b) { 12 | return add_numbers(a, b); 13 | } 14 | -------------------------------------------------------------------------------- /assets/example_file_call.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef EXAMPLE_FILE_CALL_H 9 | #define EXAMPLE_FILE_CALL_H 10 | 11 | int call_add_numbers(int a, int b); 12 | 13 | #endif /* EXAMPLE_FILE_CALL_H */ 14 | -------------------------------------------------------------------------------- /assets/test_example_file.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "example_file.h" 10 | 11 | void setUp(void) {} 12 | void tearDown(void) {} 13 | 14 | void test_add_numbers_adds_numbers(void) { 15 | TEST_ASSERT_EQUAL_INT(2, add_numbers(1,1)); 16 | } 17 | 18 | void test_add_numbers_will_fail(void) { 19 | TEST_ASSERT_EQUAL_INT(2, add_numbers(2,2)); 20 | } 21 | -------------------------------------------------------------------------------- /assets/test_example_file_boom.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "example_file.h" 10 | 11 | void setUp(void) {} 12 | void tearDown(void) {} 13 | 14 | void test_add_numbers_adds_numbers(void) { 15 | TEST_ASSERT_EQUAL_INT(2, add_numbers(1,1) //Removed semicolon & parenthesis to make a compile error. 16 | } 17 | 18 | void test_add_numbers_will_fail(void) { 19 | TEST_ASSERT_EQUAL_INT(2, add_numbers(2,2)); 20 | } 21 | -------------------------------------------------------------------------------- /assets/test_example_file_crash.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include 9 | #include "unity.h" 10 | #include "example_file.h" 11 | 12 | 13 | void setUp(void) {} 14 | void tearDown(void) {} 15 | 16 | void test_add_numbers_adds_numbers(void) { 17 | TEST_ASSERT_EQUAL_INT(2, add_numbers(1,1)); 18 | } 19 | 20 | void test_add_numbers_will_fail(void) { 21 | // Platform-independent way of forcing a crash 22 | uint32_t* nullptr = (void*) 0; 23 | uint32_t i = *nullptr; 24 | TEST_ASSERT_EQUAL_INT(2, add_numbers(i,2)); 25 | } 26 | -------------------------------------------------------------------------------- /assets/test_example_file_success.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "example_file.h" 10 | 11 | void setUp(void) {} 12 | void tearDown(void) {} 13 | 14 | void test_add_numbers_adds_numbers(void) { 15 | TEST_ASSERT_EQUAL_INT(2, add_numbers(1,1)); 16 | } 17 | 18 | void test_add_numbers_will_fail_but_is_ignored_for_now(void) { 19 | TEST_IGNORE(); 20 | TEST_ASSERT_EQUAL_INT(2, add_numbers(2,2)); 21 | } 22 | -------------------------------------------------------------------------------- /assets/test_example_file_unity_printf.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "example_file.h" 10 | #include 11 | 12 | void setUp(void) {} 13 | void tearDown(void) {} 14 | 15 | void test_add_numbers_adds_numbers(void) { 16 | TEST_PRINTF("1 + 1 =%d", 1 + 1); 17 | TEST_ASSERT_EQUAL_INT(2, add_numbers(1,1)); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /assets/test_example_file_verbose.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "example_file.h" 10 | #include 11 | 12 | void setUp(void) {} 13 | void tearDown(void) {} 14 | 15 | void test_add_numbers_adds_numbers(void) { 16 | printf("1 + 1 = 2\n"); 17 | TEST_ASSERT_EQUAL_INT(2, add_numbers(1,1)); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /assets/test_example_file_with_mock.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "example_file_call.h" 10 | // mock header should have higher priority than real file 11 | #include "example_file.h" 12 | #include "mock_example_file.h" 13 | 14 | void setUp(void) {} 15 | void tearDown(void) {} 16 | 17 | void test_add_numbers_adds_numbers(void) { 18 | add_numbers_ExpectAndReturn(1, 1, 2); 19 | TEST_ASSERT_EQUAL_INT(2, call_add_numbers(1, 1)); 20 | } 21 | -------------------------------------------------------------------------------- /assets/test_example_with_parameterized_tests.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | 10 | void setUp(void) {} 11 | void tearDown(void) {} 12 | 13 | TEST_CASE(25) 14 | TEST_CASE(125) 15 | TEST_CASE(5) 16 | void test_should_handle_divisible_by_5_for_parameterized_test_case(int num) { 17 | TEST_ASSERT_EQUAL_MESSAGE(0, (num % 5), "All The Values Are Divisible By 5"); 18 | } 19 | 20 | TEST_RANGE([5, 100, 5]) 21 | void test_should_handle_divisible_by_5_for_parameterized_test_range(int num) { 22 | TEST_ASSERT_EQUAL_MESSAGE(0, (num % 5), "All The Values Are Divisible By 5"); 23 | } 24 | 25 | TEST_RANGE([10, 100, 10], [5, 10, 5]) 26 | void test_should_handle_a_divisible_by_b_for_parameterized_test_range(int a, int b) { 27 | TEST_ASSERT_EQUAL_MESSAGE(0, (a % b), "All The a Values Are Divisible By b"); 28 | } 29 | -------------------------------------------------------------------------------- /assets/tests_with_defines/src/adc_hardware.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "adc_hardware.h" 9 | #include "adc_hardware_configurator.h" 10 | 11 | void AdcHardware_Init(void) 12 | { 13 | #ifdef SPECIFIC_CONFIG 14 | Adc_ResetSpec(); 15 | #elif defined(STANDARD_CONFIG) 16 | Adc_Reset(); 17 | #endif 18 | } 19 | -------------------------------------------------------------------------------- /assets/tests_with_defines/src/adc_hardware.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _ADCHARDWARE_H 9 | #define _ADCHARDWARE_H 10 | 11 | void AdcHardware_Init(void); 12 | 13 | #endif // _ADCHARDWARE_H 14 | -------------------------------------------------------------------------------- /assets/tests_with_defines/src/adc_hardware_configurator.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "adc_hardware_configurator.h" 9 | 10 | #ifdef SPECIFIC_CONFIG 11 | void Adc_ResetSpec(void) 12 | { 13 | } 14 | #elif defined(STANDARD_CONFIG) 15 | void Adc_Reset(void) 16 | { 17 | } 18 | #endif 19 | -------------------------------------------------------------------------------- /assets/tests_with_defines/src/adc_hardware_configurator.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _ADCHARDWARECONFIGURATOR_H 9 | #define _ADCHARDWARECONFIGURATOR_H 10 | 11 | #ifdef SPECIFIC_CONFIG 12 | void Adc_ResetSpec(void); 13 | #elif defined(STANDARD_CONFIG) 14 | void Adc_Reset(void); 15 | #endif 16 | 17 | #endif // _ADCHARDWARECONFIGURATOR_H 18 | -------------------------------------------------------------------------------- /assets/tests_with_defines/test/test_adc_hardware.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "adc_hardware.h" 10 | #include "mock_adc_hardware_configurator.h" 11 | 12 | void setUp(void) 13 | { 14 | } 15 | 16 | void tearDown(void) 17 | { 18 | } 19 | 20 | void test_init_should_call_adc_reset(void) 21 | { 22 | Adc_Reset_Expect(); 23 | 24 | // to check if also test file is compiled with this define 25 | #ifdef STANDARD_CONFIG 26 | AdcHardware_Init(); 27 | #endif 28 | } 29 | -------------------------------------------------------------------------------- /assets/tests_with_defines/test/test_adc_hardware_special.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "adc_hardware.h" 10 | #include "mock_adc_hardware_configurator.h" 11 | 12 | void setUp(void) 13 | { 14 | } 15 | 16 | void tearDown(void) 17 | { 18 | } 19 | 20 | void test_init_should_call_special_adc_reset(void) 21 | { 22 | Adc_ResetSpec_Expect(); 23 | 24 | // to check if also test file is compiled with this define 25 | #ifdef SPECIFIC_CONFIG 26 | AdcHardware_Init(); 27 | #endif 28 | } 29 | -------------------------------------------------------------------------------- /assets/tests_with_preprocessing/src/adc_hardwareA.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "adc_hardwareA.h" 9 | #include "adc_hardware_configuratorA.h" 10 | 11 | void AdcHardware_Init(void) 12 | { 13 | // Reusing outer test file preprocessing symbol to prevent linking failure 14 | #ifdef PREPROCESSING_TESTS 15 | Adc_Reset(); 16 | #endif 17 | } 18 | -------------------------------------------------------------------------------- /assets/tests_with_preprocessing/src/adc_hardwareA.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _ADCHARDWARE_H 9 | #define _ADCHARDWARE_H 10 | 11 | void AdcHardware_Init(void); 12 | 13 | #endif // _ADCHARDWARE_H 14 | -------------------------------------------------------------------------------- /assets/tests_with_preprocessing/src/adc_hardwareB.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "adc_hardwareB.h" 9 | #include "adc_hardware_configuratorB.h" 10 | 11 | void AdcHardware_Init(void) 12 | { 13 | Adc_Reset(); 14 | } 15 | -------------------------------------------------------------------------------- /assets/tests_with_preprocessing/src/adc_hardwareB.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _ADCHARDWARE_H 9 | #define _ADCHARDWARE_H 10 | 11 | void AdcHardware_Init(void); 12 | 13 | #endif // _ADCHARDWARE_H 14 | -------------------------------------------------------------------------------- /assets/tests_with_preprocessing/src/adc_hardwareC.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "adc_hardwareC.h" 9 | #include "adc_hardware_configuratorC.h" 10 | 11 | void AdcHardware_Init(void) 12 | { 13 | Adc_Reset(); 14 | } 15 | -------------------------------------------------------------------------------- /assets/tests_with_preprocessing/src/adc_hardwareC.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _ADCHARDWARE_H 9 | #define _ADCHARDWARE_H 10 | 11 | void AdcHardware_Init(void); 12 | 13 | #endif // _ADCHARDWARE_H 14 | -------------------------------------------------------------------------------- /assets/tests_with_preprocessing/src/adc_hardware_configuratorA.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _ADCHARDWARECONFIGURATOR_H 9 | #define _ADCHARDWARECONFIGURATOR_H 10 | 11 | void Adc_Reset(void); 12 | 13 | #endif // _ADCHARDWARECONFIGURATOR_H 14 | -------------------------------------------------------------------------------- /assets/tests_with_preprocessing/src/adc_hardware_configuratorB.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _ADCHARDWARECONFIGURATOR_H 9 | #define _ADCHARDWARECONFIGURATOR_H 10 | 11 | #ifdef PREPROCESSING_MOCKS 12 | void Adc_Reset(void); 13 | #endif 14 | 15 | #endif // _ADCHARDWARECONFIGURATOR_H 16 | -------------------------------------------------------------------------------- /assets/tests_with_preprocessing/src/adc_hardware_configuratorC.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _ADCHARDWARECONFIGURATOR_H 9 | #define _ADCHARDWARECONFIGURATOR_H 10 | 11 | #ifdef PREPROCESSING_MOCKS 12 | void Adc_Reset(void); 13 | #endif 14 | 15 | #endif // _ADCHARDWARECONFIGURATOR_H 16 | -------------------------------------------------------------------------------- /assets/tests_with_preprocessing/test/test_adc_hardwareA.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "adc_hardwareA.h" 10 | #ifdef PREPROCESSING_TESTS 11 | #include "mock_adc_hardware_configuratorA.h" 12 | #endif 13 | 14 | void setUp(void) 15 | { 16 | } 17 | 18 | void tearDown(void) 19 | { 20 | } 21 | 22 | #ifdef PREPROCESSING_TESTS 23 | void test_init_should_call_adc_reset(void) 24 | { 25 | Adc_Reset_Expect(); 26 | 27 | AdcHardware_Init(); 28 | } 29 | #endif 30 | 31 | #ifndef PREPROCESSING_TESTS 32 | void test_caseA_should_fail(void) 33 | { 34 | TEST_FAIL_MESSAGE("Intentional failure"); 35 | } 36 | 37 | void test_caseB_should_fail(void) 38 | { 39 | TEST_FAIL_MESSAGE("Intentional failure"); 40 | } 41 | #endif -------------------------------------------------------------------------------- /assets/tests_with_preprocessing/test/test_adc_hardwareB.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "adc_hardwareB.h" 10 | #include "mock_adc_hardware_configuratorB.h" 11 | 12 | void setUp(void) 13 | { 14 | } 15 | 16 | void tearDown(void) 17 | { 18 | } 19 | 20 | void test_init_should_call_adc_reset(void) 21 | { 22 | Adc_Reset_Expect(); 23 | 24 | AdcHardware_Init(); 25 | } 26 | -------------------------------------------------------------------------------- /assets/tests_with_preprocessing/test/test_adc_hardwareC.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "adc_hardwareC.h" 10 | #ifdef PREPROCESSING_TESTS 11 | #include "mock_adc_hardware_configuratorC.h" 12 | #endif 13 | 14 | void setUp(void) 15 | { 16 | } 17 | 18 | void tearDown(void) 19 | { 20 | } 21 | 22 | #ifdef PREPROCESSING_TESTS 23 | void test_init_should_call_adc_reset(void) 24 | { 25 | Adc_Reset_Expect(); 26 | 27 | AdcHardware_Init(); 28 | } 29 | #endif -------------------------------------------------------------------------------- /assets/uncovered_example_file.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | // This file is to test abort on uncovered files feature 9 | 10 | int multiply_numbers(int a, int b) { 11 | return a * b; 12 | } 13 | -------------------------------------------------------------------------------- /bin/mixins.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | BUILTIN_MIXINS = { 10 | # Mixin name as symbol => mixin config hash 11 | # :mixin => {} 12 | } 13 | -------------------------------------------------------------------------------- /config/test_environment.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | # Setup our load path: 9 | [ 10 | 'lib', 11 | 'test', 12 | ].each do |dir| 13 | $LOAD_PATH.unshift( File.join( File.expand_path(File.dirname(__FILE__) + "/../"), dir) ) 14 | end 15 | -------------------------------------------------------------------------------- /docs/Ceedling Basic Porting.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThrowTheSwitch/Ceedling/9a3b32a8cfe414763408a0e82043cd7a028f7553/docs/Ceedling Basic Porting.pdf -------------------------------------------------------------------------------- /docs/Ceedling Managing Release Code.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThrowTheSwitch/Ceedling/9a3b32a8cfe414763408a0e82043cd7a028f7553/docs/Ceedling Managing Release Code.pdf -------------------------------------------------------------------------------- /docs/Ceedling Working with IDEs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThrowTheSwitch/Ceedling/9a3b32a8cfe414763408a0e82043cd7a028f7553/docs/Ceedling Working with IDEs.pdf -------------------------------------------------------------------------------- /examples/temp_sensor/README.md: -------------------------------------------------------------------------------- 1 | # Ceedling Temp-Sensor Example 2 | 3 | *Welcome to the Temp-Sensor Example!* This is a medium-sized example of how Ceedling 4 | might work in your system. You can use it to verify you have all the tools installed. 5 | You can use it as a starting point for your own code. You can build upon it for your 6 | own creations, though honestly it's a bit of a mess. While it has some good ideas in 7 | it, really it serves as a testing ground for some of Ceedling's features, and a place 8 | for you to explore how Ceedling works. 9 | 10 | You'll find all the source files in the `src` folder. You'll find all the tests in 11 | (you guessed it) the `test` folder (and its sub-folders). There are also some files 12 | in the `test/support` folder, which demonstrate how you can create your own assertions. 13 | 14 | This project assumes you have `gcov` and `gcovr` installed for collecting coverage 15 | information. If that's not true, you can just remove the `gcov` plugin from the 16 | `plugins` list. Everything else will work fine. 17 | 18 | Have fun poking around! 19 | -------------------------------------------------------------------------------- /examples/temp_sensor/mixin/add_unity_helper.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | --- 9 | 10 | # Enable the unity helper's define to enable our custom assertion 11 | :defines: 12 | :test: 13 | '*': 14 | - TEST # Simple list option to add symbol 'TEST' to compilation of all files in all test executables 15 | - TEST_CUSTOM_EXAMPLE_STRUCT_T 16 | 'TestUsartIntegrated.c': 17 | - TEST 18 | - TEST_CUSTOM_EXAMPLE_STRUCT_T 19 | - TEST_USART_INTEGRATED_STRING=\"It's Awesome Time!\n\" 20 | :release: [] 21 | 22 | # Add the unity helper configuration to cmock 23 | :cmock: 24 | :unity_helper_path: 25 | - test/support/UnityHelper.h 26 | ... 27 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/AdcConductor.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "AdcConductor.h" 10 | #include "AdcModel.h" 11 | #include "AdcHardware.h" 12 | 13 | void AdcConductor_Init(void) 14 | { 15 | AdcHardware_Init(); 16 | } 17 | 18 | void AdcConductor_Run(void) 19 | { 20 | if (AdcModel_DoGetSample() && AdcHardware_GetSampleComplete()) 21 | { 22 | AdcModel_ProcessInput(AdcHardware_GetSample()); 23 | AdcHardware_StartConversion(); 24 | } 25 | } 26 | 27 | bool AdcConductor_JustHereToTest(void) 28 | { 29 | EXAMPLE_STRUCT_T ExampleStruct; 30 | ExampleStruct.x = 5; 31 | ExampleStruct.y = 7; 32 | 33 | return AdcModel_DoNothingExceptTestASpecialType(ExampleStruct); 34 | } 35 | 36 | bool AdcConductor_AlsoHereToTest(void) 37 | { 38 | EXAMPLE_STRUCT_T example = AdcModel_DoNothingExceptReturnASpecialType(); 39 | 40 | return ((example.x == 99) && (example.y == 1)); 41 | } 42 | 43 | bool AdcConductor_YetAnotherTest(void) 44 | { 45 | uint32 example = 3; 46 | 47 | return AdModel_DoNothingExceptTestPointers(&example); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/AdcConductor.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _ADCCONDUCTOR_H 9 | #define _ADCCONDUCTOR_H 10 | 11 | #include "Types.h" 12 | 13 | void AdcConductor_Init(void); 14 | void AdcConductor_Run(void); 15 | 16 | bool AdcConductor_JustHereToTest(void); 17 | bool AdcConductor_AlsoHereToTest(void); 18 | bool AdcConductor_YetAnotherTest(void); 19 | 20 | #endif // _ADCCONDUCTOR_H 21 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/AdcHardware.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "AdcHardware.h" 10 | #include "AdcHardwareConfigurator.h" 11 | #include "AdcTemperatureSensor.h" 12 | 13 | void AdcHardware_Init(void) 14 | { 15 | Adc_Reset(); 16 | Adc_ConfigureMode(); 17 | Adc_EnableTemperatureChannel(); 18 | Adc_StartTemperatureSensorConversion(); 19 | } 20 | 21 | void AdcHardware_StartConversion(void) 22 | { 23 | Adc_StartTemperatureSensorConversion(); 24 | } 25 | 26 | bool AdcHardware_GetSampleComplete(void) 27 | { 28 | return Adc_TemperatureSensorSampleReady(); 29 | } 30 | 31 | uint16 AdcHardware_GetSample(void) 32 | { 33 | return Adc_ReadTemperatureSensor(); 34 | } 35 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/AdcHardware.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _ADCHARDWARE_H 9 | #define _ADCHARDWARE_H 10 | 11 | #include "Types.h" 12 | 13 | void AdcHardware_Init(void); 14 | void AdcHardware_StartConversion(void); 15 | bool AdcHardware_GetSampleComplete(void); 16 | uint16 AdcHardware_GetSample(void); 17 | 18 | #endif // _ADCHARDWARE_H 19 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/AdcHardwareConfigurator.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "AdcHardwareConfigurator.h" 10 | #include "ModelConfig.h" 11 | 12 | void Adc_Reset(void) 13 | { 14 | AT91C_BASE_ADC->ADC_CR = AT91C_ADC_SWRST; 15 | } 16 | 17 | void Adc_ConfigureMode(void) 18 | { 19 | AT91C_BASE_ADC->ADC_MR = (((uint32)11) << 8) | (((uint32)4) << 16); 20 | } 21 | 22 | void Adc_EnableTemperatureChannel(void) 23 | { 24 | AT91C_BASE_ADC->ADC_CHER = 0x10; 25 | } 26 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/AdcHardwareConfigurator.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _ADCHARDWARECONFIGURATOR_H 9 | #define _ADCHARDWARECONFIGURATOR_H 10 | 11 | #include "Types.h" 12 | 13 | void Adc_Reset(void); 14 | void Adc_ConfigureMode(void); 15 | void Adc_EnableTemperatureChannel(void); 16 | 17 | #endif // _ADCHARDWARECONFIGURATOR_H 18 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/AdcModel.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "AdcModel.h" 9 | #include "TaskScheduler.h" 10 | #include "calculators/TemperatureCalculator.h" 11 | #include "TemperatureFilter.h" 12 | 13 | bool AdcModel_DoGetSample(void) 14 | { 15 | return TaskScheduler_DoAdc(); 16 | } 17 | 18 | void AdcModel_ProcessInput(uint16 millivolts) 19 | { 20 | TemperatureFilter_ProcessInput(TemperatureCalculator_Calculate(millivolts)); 21 | } 22 | 23 | bool AdcModel_DoNothingExceptTestASpecialType(EXAMPLE_STRUCT_T ExampleStruct) 24 | { 25 | //This doesn't really do anything. it's only here to make sure I can compare a struct. 26 | return FALSE; 27 | } 28 | bool AdModel_DoNothingExceptTestPointers(uint32* pExample) 29 | { 30 | //This doesn't really do anything. it's only here to make sure I can compare a pointer value. 31 | return FALSE; 32 | } 33 | 34 | EXAMPLE_STRUCT_T AdcModel_DoNothingExceptReturnASpecialType(void) 35 | { 36 | EXAMPLE_STRUCT_T example; //again, this just is here to test that I can return a struct 37 | example.x = 99; 38 | example.y = 1; 39 | return example; 40 | } 41 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/AdcModel.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _ADCMODEL_H 9 | #define _ADCMODEL_H 10 | 11 | #include "Types.h" 12 | 13 | bool AdcModel_DoGetSample(void); 14 | void AdcModel_ProcessInput(uint16 millivolts); 15 | 16 | bool AdcModel_DoNothingExceptTestASpecialType(EXAMPLE_STRUCT_T ExampleStruct); 17 | bool AdModel_DoNothingExceptTestPointers(uint32* pExample); 18 | EXAMPLE_STRUCT_T AdcModel_DoNothingExceptReturnASpecialType(void); 19 | 20 | #endif // _ADCMODEL_H 21 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/AdcTemperatureSensor.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _ADCTEMPERATURESENSOR_H 9 | #define _ADCTEMPERATURESENSOR_H 10 | 11 | #include "Types.h" 12 | 13 | void Adc_StartTemperatureSensorConversion(void); 14 | bool Adc_TemperatureSensorSampleReady(void); 15 | uint16 Adc_ReadTemperatureSensor(void); 16 | 17 | #endif // _ADCTEMPERATURESENSOR_H 18 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/Executor.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "Executor.h" 10 | #include "Model.h" 11 | #include "UsartConductor.h" 12 | #include "TimerConductor.h" 13 | #include "AdcConductor.h" 14 | #include "IntrinsicsWrapper.h" 15 | 16 | 17 | void Executor_Init(void) 18 | { 19 | Model_Init(); 20 | UsartConductor_Init(); 21 | AdcConductor_Init(); 22 | TimerConductor_Init(); 23 | Interrupt_Enable(); 24 | } 25 | 26 | bool Executor_Run(void) 27 | { 28 | UsartConductor_Run(); 29 | TimerConductor_Run(); 30 | AdcConductor_Run(); 31 | return TRUE; 32 | } 33 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/Executor.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _EXECUTOR_H 9 | #define _EXECUTOR_H 10 | 11 | #include "Types.h" 12 | 13 | void Executor_Init(void); 14 | bool Executor_Run(void); 15 | 16 | #endif // _EXECUTOR_H 17 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/IntrinsicsWrapper.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "IntrinsicsWrapper.h" 9 | #ifdef __ICCARM__ 10 | #include 11 | #endif 12 | 13 | void Interrupt_Enable(void) 14 | { 15 | #ifdef __ICCARM__ 16 | __enable_interrupt(); 17 | #endif 18 | } 19 | 20 | void Interrupt_Disable(void) 21 | { 22 | #ifdef __ICCARM__ 23 | __disable_interrupt(); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/IntrinsicsWrapper.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _INTRINSICS_WRAPPER_H 9 | #define _INTRINSICS_WRAPPER_H 10 | 11 | void Interrupt_Enable(void); 12 | void Interrupt_Disable(void); 13 | 14 | #endif // _INTRINSICS_WRAPPER_H 15 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/Main.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | 10 | #include "IntrinsicsWrapper.h" 11 | #include "Executor.h" 12 | 13 | #include "Model.h" 14 | #include "TaskScheduler.h" 15 | #include "calculators/TemperatureCalculator.h" 16 | #include "TemperatureFilter.h" 17 | 18 | #include "UsartConductor.h" 19 | #include "UsartHardware.h" 20 | #include "UsartConfigurator.h" 21 | #include "UsartPutChar.h" 22 | #include "UsartModel.h" 23 | #include "calculators/UsartBaudRateRegisterCalculator.h" 24 | #include "UsartTransmitBufferStatus.h" 25 | 26 | #include "TimerConductor.h" 27 | #include "TimerHardware.h" 28 | #include "TimerConfigurator.h" 29 | #include "TimerInterruptConfigurator.h" 30 | #include "TimerInterruptHandler.h" 31 | #include "TimerModel.h" 32 | 33 | #include "AdcConductor.h" 34 | #include "AdcHardware.h" 35 | #include "AdcHardwareConfigurator.h" 36 | #include "AdcTemperatureSensor.h" 37 | #include "AdcModel.h" 38 | 39 | int AppMain(void) 40 | { 41 | Executor_Init(); 42 | 43 | while(Executor_Run()); 44 | 45 | return 0; 46 | } 47 | 48 | #ifndef TEST 49 | int main(void) 50 | { 51 | return AppMain(); 52 | } 53 | #endif // TEST 54 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/Main.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _MAIN_H_ 9 | #define _MAIN_H_ 10 | 11 | int AppMain(void); 12 | int main(void); 13 | 14 | #endif // _MAIN_H_ 15 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/Model.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Model.h" 9 | #include "TaskScheduler.h" 10 | #include "TemperatureFilter.h" 11 | 12 | void Model_Init(void) 13 | { 14 | TaskScheduler_Init(); 15 | TemperatureFilter_Init(); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/Model.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _MODEL_H 9 | #define _MODEL_H 10 | 11 | #include "Types.h" 12 | 13 | void Model_Init(void); 14 | 15 | #endif // _MODEL_H 16 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/ModelConfig.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _MODELCONFIG_H 9 | #define _MODELCONFIG_H 10 | 11 | #define MASTER_CLOCK 48054857 // Master Clock 12 | #define USART0_BAUDRATE 115200 // USART Baudrate 13 | 14 | #endif // _MODELCONFIG_H 15 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/TaskScheduler.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _TASKSCHEDULER_H 9 | #define _TASKSCHEDULER_H 10 | 11 | #include "Types.h" 12 | 13 | void TaskScheduler_Init(void); 14 | void TaskScheduler_Update(uint32 time); 15 | bool TaskScheduler_DoUsart(void); 16 | bool TaskScheduler_DoAdc(void); 17 | 18 | #endif // _TASKSCHEDULER_H 19 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/TemperatureFilter.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "TemperatureFilter.h" 10 | #include 11 | 12 | static bool initialized; 13 | static float temperatureInCelcius; 14 | 15 | void TemperatureFilter_Init(void) 16 | { 17 | initialized = FALSE; 18 | temperatureInCelcius = -INFINITY; 19 | } 20 | 21 | float TemperatureFilter_GetTemperatureInCelcius(void) 22 | { 23 | return temperatureInCelcius; 24 | } 25 | 26 | void TemperatureFilter_ProcessInput(float temperature) 27 | { 28 | if (!initialized) 29 | { 30 | temperatureInCelcius = temperature; 31 | initialized = TRUE; 32 | } 33 | else 34 | { 35 | if (temperature == +INFINITY || 36 | temperature == -INFINITY || 37 | isnan(temperature)) 38 | { 39 | initialized = FALSE; 40 | temperature = -INFINITY; 41 | } 42 | 43 | temperatureInCelcius = (temperatureInCelcius * 0.75f) + (temperature * 0.25); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/TemperatureFilter.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _TEMPERATUREFILTER_H 9 | #define _TEMPERATUREFILTER_H 10 | 11 | #include "Types.h" 12 | 13 | void TemperatureFilter_Init(void); 14 | float TemperatureFilter_GetTemperatureInCelcius(void); 15 | void TemperatureFilter_ProcessInput(float temperature); 16 | 17 | #endif // _TEMPERATUREFILTER_H 18 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/TimerConductor.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "TimerConductor.h" 10 | #include "TimerModel.h" 11 | #include "TimerHardware.h" 12 | #include "TimerInterruptHandler.h" 13 | 14 | void TimerConductor_Init(void) 15 | { 16 | TimerHardware_Init(); 17 | } 18 | 19 | void TimerConductor_Run(void) 20 | { 21 | TimerModel_UpdateTime(Timer_GetSystemTime()); 22 | } 23 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/TimerConductor.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _TIMERCONDUCTOR_H 9 | #define _TIMERCONDUCTOR_H 10 | 11 | #include "Types.h" 12 | 13 | void TimerConductor_Init(void); 14 | void TimerConductor_Run(void); 15 | 16 | #endif // _TIMERCONDUCTOR_H 17 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/TimerConfigurator.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _TIMERCONFIGURATOR_H 9 | #define _TIMERCONFIGURATOR_H 10 | 11 | #include "Types.h" 12 | 13 | void Timer_EnablePeripheralClocks(void); 14 | void Timer_Reset(void); 15 | void Timer_ConfigureMode(void); 16 | void Timer_ConfigurePeriod(void); 17 | void Timer_EnableOutputPin(void); 18 | void Timer_Enable(void); 19 | void Timer_ConfigureInterruptHandler(void); 20 | void Timer_Start(void); 21 | 22 | #endif // _TIMERCONFIGURATOR_H 23 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/TimerHardware.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "TimerHardware.h" 10 | #include "TimerConfigurator.h" 11 | 12 | void TimerHardware_Init(void) 13 | { 14 | Timer_EnablePeripheralClocks(); 15 | Timer_Reset(); 16 | Timer_ConfigureMode(); 17 | Timer_ConfigurePeriod(); 18 | Timer_EnableOutputPin(); 19 | Timer_Enable(); 20 | Timer_ConfigureInterruptHandler(); 21 | Timer_Start(); 22 | } 23 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/TimerHardware.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _TIMERHARDWARE_H 9 | #define _TIMERHARDWARE_H 10 | 11 | #include "Types.h" 12 | 13 | void TimerHardware_Init(void); 14 | 15 | #endif // _TIMERHARDWARE_H 16 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/TimerInterruptConfigurator.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _TIMERINTERRUPTCONFIGURATOR_H 9 | #define _TIMERINTERRUPTCONFIGURATOR_H 10 | 11 | #include "Types.h" 12 | 13 | #define TIMER0_ID_MASK (((uint32)0x1) << AT91C_ID_TC0) 14 | 15 | void Timer_DisableInterrupt(void); 16 | void Timer_ResetSystemTime(void); 17 | void Timer_ConfigureInterrupt(void); 18 | void Timer_EnableInterrupt(void); 19 | 20 | #endif // _TIMERINTERRUPTCONFIGURATOR_H 21 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/TimerInterruptHandler.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "TimerInterruptHandler.h" 10 | #include "TimerInterruptConfigurator.h" 11 | 12 | static uint32 systemTime; 13 | 14 | void Timer_SetSystemTime(uint32 time) 15 | { 16 | systemTime = time; 17 | } 18 | 19 | uint32 Timer_GetSystemTime(void) 20 | { 21 | return systemTime; 22 | } 23 | 24 | void Timer_InterruptHandler(void) 25 | { 26 | uint32 status = AT91C_BASE_TC0->TC_SR; 27 | if (status & AT91C_TC_CPCS) 28 | { 29 | systemTime += 10; 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/TimerInterruptHandler.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _TIMERINTERRUPTHANDLER_H 9 | #define _TIMERINTERRUPTHANDLER_H 10 | 11 | #include "Types.h" 12 | 13 | void Timer_SetSystemTime(uint32 time); 14 | uint32 Timer_GetSystemTime(void); 15 | void Timer_InterruptHandler(void); 16 | 17 | #endif // _TIMERINTERRUPTHANDLER_H 18 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/TimerModel.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "TimerModel.h" 10 | #include "TaskScheduler.h" 11 | 12 | void TimerModel_UpdateTime(uint32 systemTime) 13 | { 14 | TaskScheduler_Update(systemTime); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/TimerModel.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _TIMERMODEL_H 9 | #define _TIMERMODEL_H 10 | 11 | #include "Types.h" 12 | 13 | void TimerModel_UpdateTime(uint32 systemTime); 14 | 15 | #endif // _TIMERMODEL_H 16 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/UsartConductor.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "UsartConductor.h" 10 | #include "UsartHardware.h" 11 | #include "UsartModel.h" 12 | #include "TaskScheduler.h" 13 | 14 | void UsartConductor_Init(void) 15 | { 16 | UsartHardware_Init(UsartModel_GetBaudRateRegisterSetting()); 17 | UsartHardware_TransmitString(UsartModel_GetWakeupMessage()); 18 | } 19 | 20 | void UsartConductor_Run(void) 21 | { 22 | char* temp; 23 | if (TaskScheduler_DoUsart()) 24 | { 25 | temp = UsartModel_GetFormattedTemperature(); 26 | UsartHardware_TransmitString(temp); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/UsartConductor.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _USARTCONDUCTOR_H 9 | #define _USARTCONDUCTOR_H 10 | 11 | void UsartConductor_Init(void); 12 | void UsartConductor_Run(void); 13 | 14 | #endif // _USARTCONDUCTOR_H 15 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/UsartConfigurator.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "UsartConfigurator.h" 10 | 11 | void Usart_ConfigureUsartIO(void) 12 | { 13 | AT91C_BASE_PIOA->PIO_ASR = USART0_TX_PIN; 14 | AT91C_BASE_PIOA->PIO_BSR = 0; 15 | AT91C_BASE_PIOA->PIO_PDR = USART0_TX_PIN; 16 | } 17 | 18 | void Usart_EnablePeripheralClock(void) 19 | { 20 | AT91C_BASE_PMC->PMC_PCER = ((uint32)1) << USART0_CLOCK_ENABLE; 21 | } 22 | 23 | void Usart_Reset(void) 24 | { 25 | AT91C_BASE_US0->US_IDR = 0xffffffff; 26 | AT91C_BASE_US0->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS; 27 | } 28 | 29 | void Usart_ConfigureMode(void) 30 | { 31 | AT91C_BASE_US0->US_MR = AT91C_US_USMODE_NORMAL | 32 | AT91C_US_NBSTOP_1_BIT | 33 | AT91C_US_PAR_NONE | 34 | AT91C_US_CHRL_8_BITS | 35 | AT91C_US_CLKS_CLOCK; 36 | } 37 | 38 | void Usart_SetBaudRateRegister(uint8 baudRateRegisterSetting) 39 | { 40 | AT91C_BASE_US0->US_BRGR = baudRateRegisterSetting; 41 | } 42 | 43 | void Usart_Enable(void) 44 | { 45 | AT91C_BASE_US0->US_CR = AT91C_US_TXEN; 46 | } 47 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/UsartConfigurator.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _USARTCONFIGURATOR_H 9 | #define _USARTCONFIGURATOR_H 10 | 11 | #include "Types.h" 12 | 13 | void Usart_ConfigureUsartIO(void); 14 | void Usart_EnablePeripheralClock(void); 15 | void Usart_Reset(void); 16 | void Usart_ConfigureMode(void); 17 | void Usart_SetBaudRateRegister(uint8 baudRateRegisterSetting); 18 | void Usart_Enable(void); 19 | 20 | #endif // _USARTCONFIGURATOR_H 21 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/UsartHardware.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "UsartHardware.h" 10 | #include "UsartConfigurator.h" 11 | #include "UsartPutChar.h" 12 | 13 | void UsartHardware_Init(uint8 baudRateRegisterSetting) 14 | { 15 | Usart_ConfigureUsartIO(); 16 | Usart_EnablePeripheralClock(); 17 | Usart_Reset(); 18 | Usart_ConfigureMode(); 19 | Usart_SetBaudRateRegister(baudRateRegisterSetting); 20 | Usart_Enable(); 21 | } 22 | 23 | void UsartHardware_TransmitString(char* data) 24 | { 25 | while(*data != NULL) 26 | { 27 | Usart_PutChar(*data++); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/UsartHardware.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _USARTHARDWARE_H 9 | #define _USARTHARDWARE_H 10 | 11 | #include "Types.h" 12 | 13 | void UsartHardware_Init(uint8 baudRateRegisterSetting); 14 | void UsartHardware_TransmitString(char* data); 15 | 16 | #endif // _USARTHARDWARE_H 17 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/UsartModel.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "UsartModel.h" 10 | #include "ModelConfig.h" 11 | #include "calculators/UsartBaudRateRegisterCalculator.h" 12 | #include "TemperatureFilter.h" 13 | #include 14 | #include 15 | 16 | char formattedTemperature[32]; 17 | char* wakeup = "It's Awesome Time!\n"; 18 | 19 | uint8 UsartModel_GetBaudRateRegisterSetting(void) 20 | { 21 | return UsartModel_CalculateBaudRateRegisterSetting(MASTER_CLOCK, USART0_BAUDRATE); 22 | } 23 | 24 | char* UsartModel_GetFormattedTemperature(void) 25 | { 26 | float temperature = TemperatureFilter_GetTemperatureInCelcius(); 27 | if (temperature == -INFINITY) 28 | { 29 | sprintf(formattedTemperature, "%s", "Temperature sensor failure!\n"); 30 | } 31 | else 32 | { 33 | sprintf(formattedTemperature, "%.1f C\n", temperature); 34 | } 35 | return formattedTemperature; 36 | } 37 | 38 | char* UsartModel_GetWakeupMessage(void) 39 | { 40 | return wakeup; 41 | } 42 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/UsartModel.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _USARTMODEL_H 9 | #define _USARTMODEL_H 10 | 11 | #include "Types.h" 12 | 13 | uint8 UsartModel_GetBaudRateRegisterSetting(void); 14 | char* UsartModel_GetFormattedTemperature(void); 15 | char* UsartModel_GetWakeupMessage(void); 16 | 17 | #endif // _USARTMODEL_H 18 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/UsartPutChar.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "UsartPutChar.h" 10 | #include "UsartTransmitBufferStatus.h" 11 | #ifdef SIMULATE 12 | #include 13 | #endif 14 | 15 | void Usart_PutChar(char data) 16 | { 17 | while(!Usart_ReadyToTransmit()); 18 | #ifdef SIMULATE 19 | printf("%c", data); 20 | #else 21 | AT91C_BASE_US0->US_THR = data; 22 | #endif 23 | } 24 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/UsartPutChar.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _USARTPUT_HAR_H 9 | #define _USARTPUT_HAR_H 10 | 11 | #include "Types.h" 12 | 13 | void Usart_PutChar(char data); 14 | 15 | #endif // _USARTPUT_HAR_H 16 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/UsartTransmitBufferStatus.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "UsartTransmitBufferStatus.h" 10 | 11 | bool Usart_ReadyToTransmit(void) 12 | { 13 | return (AT91C_BASE_US0->US_CSR & AT91C_US_TXRDY) > 0; 14 | } 15 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/UsartTransmitBufferStatus.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _USARTTRANSMITBUFFERSTATUS_H 9 | #define _USARTTRANSMITBUFFERSTATUS_H 10 | 11 | #include "Types.h" 12 | 13 | bool Usart_ReadyToTransmit(void); 14 | 15 | #endif // _USARTTRANSMITBUFFERSTATUS_H 16 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/calculators/TemperatureCalculator.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "TemperatureCalculator.h" 10 | #include 11 | 12 | #ifndef logl 13 | #define logl log 14 | #endif 15 | 16 | #ifndef SUPPLY_VOLTAGE 17 | #define SUPPLY_VOLTAGE 5.0 18 | #endif 19 | 20 | float TemperatureCalculator_Calculate(uint16 millivolts) 21 | { 22 | const double supply_voltage = SUPPLY_VOLTAGE; 23 | const double series_resistance = 5000; 24 | const double coefficient_A = 316589.698; 25 | const double coefficient_B = -0.1382009; 26 | double sensor_voltage = ((double)millivolts / 1000); 27 | double resistance; 28 | 29 | if (millivolts == 0) 30 | { 31 | return -INFINITY; 32 | } 33 | 34 | // Series resistor is 5k Ohms; Reference voltage is 3.0V 35 | // R(t) = A * e^(B*t); R is resistance of thermisor; t is temperature in C 36 | resistance = ((supply_voltage * series_resistance) / sensor_voltage) - series_resistance; 37 | return (float)(logl(resistance / coefficient_A) / coefficient_B); 38 | } 39 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/calculators/TemperatureCalculator.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _TEMPERATURECALCULATOR_H 9 | #define _TEMPERATURECALCULATOR_H 10 | 11 | #include "Types.h" 12 | 13 | float TemperatureCalculator_Calculate(uint16 millivolts); 14 | 15 | #endif // _TEMPERATURECALCULATOR_H 16 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/calculators/UsartBaudRateRegisterCalculator.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "Types.h" 9 | #include "UsartBaudRateRegisterCalculator.h" 10 | 11 | uint8 UsartModel_CalculateBaudRateRegisterSetting(uint32 masterClock, uint32 baudRate) 12 | { 13 | uint32 registerSetting = ((masterClock * 10) / (baudRate * 16)); 14 | 15 | if ((registerSetting % 10) >= 5) 16 | { 17 | registerSetting = (registerSetting / 10) + 1; 18 | } 19 | else 20 | { 21 | registerSetting /= 10; 22 | } 23 | 24 | return (uint8)registerSetting; 25 | } 26 | -------------------------------------------------------------------------------- /examples/temp_sensor/src/calculators/UsartBaudRateRegisterCalculator.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _USARTBAUDRATEREGISTERCALCULATOR_H 9 | #define _USARTBAUDRATEREGISTERCALCULATOR_H 10 | 11 | #include "Types.h" 12 | 13 | uint8 UsartModel_CalculateBaudRateRegisterSetting(uint32 masterClock, uint32 baudRate); 14 | 15 | #endif // _USARTBAUDRATEREGISTERCALCULATOR_H 16 | -------------------------------------------------------------------------------- /examples/temp_sensor/test/TestExecutor.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "Types.h" 10 | #include "Executor.h" 11 | #include "MockModel.h" 12 | #include "MockUsartConductor.h" 13 | #include "MockAdcConductor.h" 14 | #include "MockTimerConductor.h" 15 | #include "MockIntrinsicsWrapper.h" 16 | 17 | void setUp(void) 18 | { 19 | } 20 | 21 | void tearDown(void) 22 | { 23 | } 24 | 25 | void testInitShouldCallInitOfAllConductorsAndTheModel(void) 26 | { 27 | Model_Init_Expect(); 28 | UsartConductor_Init_Expect(); 29 | AdcConductor_Init_Expect(); 30 | TimerConductor_Init_Expect(); 31 | Interrupt_Enable_Expect(); 32 | 33 | Executor_Init(); 34 | } 35 | 36 | void testRunShouldCallRunForEachConductorAndReturnTrueAlways(void) 37 | { 38 | UsartConductor_Run_Expect(); 39 | TimerConductor_Run_Expect(); 40 | AdcConductor_Run_Expect(); 41 | 42 | TEST_ASSERT_TRUE(Executor_Run()); 43 | } 44 | -------------------------------------------------------------------------------- /examples/temp_sensor/test/TestMain.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "Types.h" 10 | #include "MockExecutor.h" 11 | #include "Main.h" 12 | 13 | void setUp(void) 14 | { 15 | } 16 | 17 | void tearDown(void) 18 | { 19 | } 20 | 21 | void testMainShouldCallExecutorInitAndContinueToCallExecutorRunUntilHalted(void) 22 | { 23 | Executor_Init_Expect(); 24 | Executor_Run_ExpectAndReturn(TRUE); 25 | Executor_Run_ExpectAndReturn(TRUE); 26 | Executor_Run_ExpectAndReturn(TRUE); 27 | Executor_Run_ExpectAndReturn(TRUE); 28 | Executor_Run_ExpectAndReturn(FALSE); 29 | 30 | AppMain(); 31 | } 32 | -------------------------------------------------------------------------------- /examples/temp_sensor/test/TestModel.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "Types.h" 10 | #include "Model.h" 11 | #include "MockTaskScheduler.h" 12 | #include "MockTemperatureFilter.h" 13 | 14 | void setUp(void) 15 | { 16 | } 17 | 18 | void tearDown(void) 19 | { 20 | } 21 | 22 | void testInitShouldCallSchedulerAndTemperatureFilterInit(void) 23 | { 24 | TaskScheduler_Init_Expect(); 25 | TemperatureFilter_Init_Expect(); 26 | Model_Init(); 27 | } 28 | -------------------------------------------------------------------------------- /examples/temp_sensor/test/TestTemperatureCalculator.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "Types.h" 10 | #include 11 | 12 | TEST_SOURCE_FILE("TemperatureCalculator.c") 13 | 14 | extern float TemperatureCalculator_Calculate(uint16 val); 15 | 16 | void setUp(void) 17 | { 18 | } 19 | 20 | void tearDown(void) 21 | { 22 | } 23 | 24 | void testTemperatureCalculatorShouldCalculateTemperatureFromMillivolts(void) 25 | { 26 | float result; 27 | 28 | // Series resistor is 5k Ohms; Reference voltage is 3.0V 29 | // R(t) = A * e^(B*t); R is resistance of thermisor; t is temperature in C 30 | result = TemperatureCalculator_Calculate(1000); 31 | TEST_ASSERT_FLOAT_WITHIN(0.01f, 25.0f, result); 32 | 33 | result = TemperatureCalculator_Calculate(2985); 34 | TEST_ASSERT_FLOAT_WITHIN(0.01f, 68.317f, result); 35 | 36 | result = TemperatureCalculator_Calculate(3); 37 | TEST_ASSERT_FLOAT_WITHIN(0.01f, -19.96f, result); 38 | } 39 | 40 | void testShouldReturnNegativeInfinityWhen_0_millivoltsInput(void) 41 | { 42 | TEST_ASSERT_FLOAT_IS_NEG_INF(TemperatureCalculator_Calculate(0)); 43 | } 44 | -------------------------------------------------------------------------------- /examples/temp_sensor/test/TestTimerConductor.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "Types.h" 10 | #include "TimerConductor.h" 11 | #include "MockTimerHardware.h" 12 | #include "MockTimerModel.h" 13 | #include "MockTimerInterruptHandler.h" 14 | 15 | void setUp(void) 16 | { 17 | } 18 | 19 | void tearDown(void) 20 | { 21 | } 22 | 23 | void testInitShouldCallHardwareInit(void) 24 | { 25 | TimerHardware_Init_Expect(); 26 | 27 | TimerConductor_Init(); 28 | } 29 | 30 | void testRunShouldGetSystemTimeAndPassOnToModelForEventScheduling(void) 31 | { 32 | Timer_GetSystemTime_ExpectAndReturn(1230); 33 | TimerModel_UpdateTime_Expect(1230); 34 | TimerConductor_Run(); 35 | 36 | Timer_GetSystemTime_ExpectAndReturn(837460); 37 | TimerModel_UpdateTime_Expect(837460); 38 | TimerConductor_Run(); 39 | } 40 | -------------------------------------------------------------------------------- /examples/temp_sensor/test/TestTimerHardware.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "Types.h" 10 | #include "TimerHardware.h" 11 | #include "MockTimerConfigurator.h" 12 | 13 | void setUp(void) 14 | { 15 | } 16 | 17 | void tearDown(void) 18 | { 19 | } 20 | 21 | void testInitShouldDelegateAppropriatelyToConfigurator(void) 22 | { 23 | Timer_EnablePeripheralClocks_Expect(); 24 | Timer_Reset_Expect(); 25 | Timer_ConfigureMode_Expect(); 26 | Timer_ConfigurePeriod_Expect(); 27 | Timer_EnableOutputPin_Expect(); 28 | Timer_Enable_Expect(); 29 | Timer_ConfigureInterruptHandler_Expect(); 30 | Timer_Start_Expect(); 31 | 32 | TimerHardware_Init(); 33 | } 34 | -------------------------------------------------------------------------------- /examples/temp_sensor/test/TestTimerModel.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "Types.h" 10 | #include "TimerModel.h" 11 | #include "MockTaskScheduler.h" 12 | 13 | void setUp(void) 14 | { 15 | } 16 | 17 | void tearDown(void) 18 | { 19 | } 20 | 21 | void testUpdateTimeShouldDelegateToTaskScheduler(void) 22 | { 23 | TaskScheduler_Update_Expect(19387L); 24 | TimerModel_UpdateTime(19387L); 25 | } 26 | -------------------------------------------------------------------------------- /examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "Types.h" 10 | #include "UsartBaudRateRegisterCalculator.h" 11 | 12 | void setUp(void) 13 | { 14 | } 15 | 16 | void tearDown(void) 17 | { 18 | } 19 | 20 | void testCalculateBaudRateRegisterSettingShouldCalculateRegisterSettingAppropriately(void) 21 | { 22 | // BaudRate = MCK / (CD x 16) - per datasheet section 30.6.1.2 "Baud Rate Calculation Example" 23 | TEST_ASSERT_EQUAL_INT(26, UsartModel_CalculateBaudRateRegisterSetting(48000000, 115200)); 24 | TEST_ASSERT_EQUAL_INT(6, UsartModel_CalculateBaudRateRegisterSetting(3686400, 38400)); 25 | TEST_ASSERT_EQUAL_INT(23, UsartModel_CalculateBaudRateRegisterSetting(14318180, 38400)); 26 | TEST_ASSERT_EQUAL_INT(20, UsartModel_CalculateBaudRateRegisterSetting(12000000, 38400)); 27 | TEST_ASSERT_EQUAL_INT(13, UsartModel_CalculateBaudRateRegisterSetting(12000000, 56800)); 28 | } 29 | -------------------------------------------------------------------------------- /examples/temp_sensor/test/TestUsartConductor.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "Types.h" 10 | #include "UsartConductor.h" 11 | #include "MockUsartModel.h" 12 | #include "MockUsartHardware.h" 13 | #include "MockTaskScheduler.h" 14 | 15 | void setUp(void) 16 | { 17 | } 18 | 19 | void tearDown(void) 20 | { 21 | } 22 | 23 | void testShouldInitializeHardwareWhenInitCalled(void) 24 | { 25 | UsartModel_GetBaudRateRegisterSetting_ExpectAndReturn(4); 26 | UsartHardware_Init_Expect(4); 27 | UsartModel_GetWakeupMessage_ExpectAndReturn("Hey there!"); 28 | UsartHardware_TransmitString_Expect("Hey there!"); 29 | 30 | UsartConductor_Init(); 31 | } 32 | 33 | void testRunShouldNotDoAnythingIfSchedulerSaysItIsNotTimeYet(void) 34 | { 35 | TaskScheduler_DoUsart_ExpectAndReturn(FALSE); 36 | 37 | UsartConductor_Run(); 38 | } 39 | 40 | void testRunShouldGetCurrentTemperatureAndTransmitIfSchedulerSaysItIsTime(void) 41 | { 42 | TaskScheduler_DoUsart_ExpectAndReturn(TRUE); 43 | UsartModel_GetFormattedTemperature_ExpectAndReturn("hey there"); 44 | UsartHardware_TransmitString_Expect("hey there"); 45 | 46 | UsartConductor_Run(); 47 | } 48 | -------------------------------------------------------------------------------- /examples/temp_sensor/test/TestUsartHardware.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "Types.h" 10 | #include "UsartHardware.h" 11 | #include "MockUsartConfigurator.h" 12 | #include "MockUsartPutChar.h" 13 | 14 | void setUp(void) 15 | { 16 | } 17 | 18 | void tearDown(void) 19 | { 20 | } 21 | 22 | void testInitShouldConfigureUsartPeripheralByCallingConfiguratorAppropriately(void) 23 | { 24 | Usart_ConfigureUsartIO_Expect(); 25 | Usart_EnablePeripheralClock_Expect(); 26 | Usart_Reset_Expect(); 27 | Usart_ConfigureMode_Expect(); 28 | Usart_SetBaudRateRegister_Expect(73); 29 | Usart_Enable_Expect(); 30 | 31 | UsartHardware_Init(73); 32 | } 33 | 34 | void testTransmitStringShouldSendDesiredStringOutUsingUsart(void) 35 | { 36 | Usart_PutChar_Expect('h'); 37 | Usart_PutChar_Expect('e'); 38 | Usart_PutChar_Expect('l'); 39 | Usart_PutChar_Expect('l'); 40 | Usart_PutChar_Expect('o'); 41 | 42 | UsartHardware_TransmitString("hello"); 43 | } 44 | -------------------------------------------------------------------------------- /examples/temp_sensor/test/adc/TestAdcModel.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "Types.h" 10 | #include "AdcModel.h" 11 | #include "MockTaskScheduler.h" 12 | #include "MockTemperatureCalculator.h" 13 | #include "MockTemperatureFilter.h" 14 | 15 | void setUp(void) 16 | { 17 | } 18 | 19 | void tearDown(void) 20 | { 21 | } 22 | 23 | void testDoGetSampleShouldReturn_FALSE_WhenTaskSchedulerReturns_FALSE(void) 24 | { 25 | TaskScheduler_DoAdc_ExpectAndReturn(FALSE); 26 | TEST_ASSERT_FALSE(AdcModel_DoGetSample()); 27 | } 28 | 29 | void testDoGetSampleShouldReturn_TRUE_WhenTaskSchedulerReturns_TRUE(void) 30 | { 31 | TaskScheduler_DoAdc_ExpectAndReturn(TRUE); 32 | TEST_ASSERT_TRUE(AdcModel_DoGetSample()); 33 | } 34 | 35 | void testProcessInputShouldDelegateToTemperatureCalculatorAndPassResultToFilter(void) 36 | { 37 | TemperatureCalculator_Calculate_ExpectAndReturn(21473, 23.5f); 38 | TemperatureFilter_ProcessInput_Expect(23.5f); 39 | AdcModel_ProcessInput(21473); 40 | } 41 | -------------------------------------------------------------------------------- /examples/temp_sensor/test/support/UnityHelper.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "unity_internals.h" 10 | #include "UnityHelper.h" 11 | 12 | #if TEST_CUSTOM_EXAMPLE_STRUCT_T 13 | void AssertEqualEXAMPLE_STRUCT_T(const EXAMPLE_STRUCT_T expected, const EXAMPLE_STRUCT_T actual, const unsigned short line) 14 | { 15 | UNITY_TEST_ASSERT_EQUAL_INT(expected.x, actual.x, line, "EXAMPLE_STRUCT_T.x check failed"); 16 | UNITY_TEST_ASSERT_EQUAL_INT(expected.y, actual.y, line, "EXAMPLE_STRUCT_T.y check failed"); 17 | } 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /examples/temp_sensor/test/support/UnityHelper.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef _TESTHELPER_H 9 | #define _TESTHELPER_H 10 | 11 | #if TEST_CUSTOM_EXAMPLE_STRUCT_T 12 | #include "Types.h" 13 | void AssertEqualEXAMPLE_STRUCT_T(const EXAMPLE_STRUCT_T expected, const EXAMPLE_STRUCT_T actual, const unsigned short line); 14 | #define UNITY_TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual, line, message) {AssertEqualEXAMPLE_STRUCT_T(expected, actual, line);} 15 | #endif 16 | 17 | #endif // _TESTHELPER_H 18 | -------------------------------------------------------------------------------- /lib/ceedling.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | # This file exists solely for `require 'ceedling'` and any backwards compatibility. 9 | # All path loading and related is handled from bin/ceedling. 10 | # There is no shareable, library-worth code in lib/. 11 | 12 | module Ceedling 13 | # Emtpy 14 | end -------------------------------------------------------------------------------- /lib/ceedling/application.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | # As Rake is removed, more and more functionality and code entrypoints will migrate here 9 | 10 | class Application 11 | 12 | constructor :system_wrapper 13 | 14 | def setup 15 | @failures = false 16 | end 17 | 18 | def register_build_failure 19 | @failures = true 20 | end 21 | 22 | def build_succeeded? 23 | return (!@failures) && @system_wrapper.ruby_success? 24 | end 25 | 26 | end 27 | -------------------------------------------------------------------------------- /lib/ceedling/backtrace.gdb: -------------------------------------------------------------------------------- 1 | if $_isvoid ($_exitcode) 2 | call ((void(*)(int))fflush)(0) 3 | backtrace 4 | kill 5 | end 6 | -------------------------------------------------------------------------------- /lib/ceedling/config_walkinator.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | class ConfigWalkinator 9 | 10 | def fetch_value(*keys, hash:, default:nil) 11 | # Safe initial values 12 | value = default 13 | depth = 0 14 | 15 | # Set walk variable 16 | walk = hash 17 | 18 | # Walk into hash & extract value at requested key sequence 19 | keys.each { |symbol| 20 | # Validate that we can fetch something meaningful 21 | if !walk.is_a?( Hash) or !symbol.is_a?( Symbol ) or walk[symbol].nil? 22 | value = default 23 | break 24 | end 25 | 26 | # Walk into the hash one more level and update value 27 | depth += 1 28 | walk = walk[symbol] 29 | value = walk 30 | } if !walk.nil? 31 | 32 | return value, depth 33 | end 34 | 35 | end 36 | -------------------------------------------------------------------------------- /lib/ceedling/dependinator.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | class Dependinator 9 | 10 | constructor :configurator, :test_context_extractor, :file_path_utils, :rake_wrapper, :file_wrapper 11 | 12 | 13 | def load_release_object_deep_dependencies(dependencies_list) 14 | dependencies_list.each do |dependencies_file| 15 | if File.exist?(dependencies_file) 16 | @rake_wrapper.load_dependencies( dependencies_file ) 17 | end 18 | end 19 | end 20 | 21 | 22 | def load_test_object_deep_dependencies(files_list) 23 | dependencies_list = @file_path_utils.form_test_dependencies_filelist(files_list) 24 | dependencies_list.each do |dependencies_file| 25 | if File.exist?(dependencies_file) 26 | @rake_wrapper.load_dependencies(dependencies_file) 27 | end 28 | end 29 | end 30 | 31 | end 32 | -------------------------------------------------------------------------------- /lib/ceedling/encodinator.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | # Patch the string class so that we have a nice shortcut for cleaning string encodings 9 | class String 10 | def clean_encoding(safe_char = '') 11 | begin 12 | # Clean up any oddball characters in an otherwise ASCII document 13 | encoding_options = { 14 | :invalid => :replace, # Replace invalid byte sequences 15 | :undef => :replace, # Replace anything not defined in ASCII 16 | :replace => safe_char, # Use a safe character for those replacements 17 | :universal_newline => true # Always break lines with \n 18 | } 19 | 20 | return self.encode("ASCII", **encoding_options).encode('UTF-8', **encoding_options) 21 | rescue 22 | raise "String contains characters that can't be represented in standard ASCII / UTF-8." 23 | end 24 | self 25 | end 26 | end -------------------------------------------------------------------------------- /lib/ceedling/erb_wrapper.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | require 'erb' 9 | 10 | class ErbWrapper 11 | def generate_file(template, data, output_file) 12 | File.open(output_file, "w") do |f| 13 | f << ERB.new(template, trim_mode: "<>").result(binding) 14 | end 15 | end 16 | end -------------------------------------------------------------------------------- /lib/ceedling/file_system_wrapper.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | class FileSystemWrapper 9 | 10 | def cd(path) 11 | FileUtils.cd path do 12 | yield 13 | end 14 | end 15 | 16 | end -------------------------------------------------------------------------------- /lib/ceedling/generator_mocks.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | require 'cmock' 9 | 10 | class GeneratorMocks 11 | 12 | constructor :configurator 13 | 14 | def manufacture(config) 15 | return CMock.new(config) 16 | end 17 | 18 | def build_configuration( output_path ) 19 | config = @configurator.get_cmock_config 20 | config[:mock_path] = output_path 21 | 22 | # Verbosity management for logging messages 23 | verbosity = @configurator.project_verbosity 24 | 25 | # Default to errors and warnings only so we can customize messages inside Ceedling 26 | config[:verbosity] = 1 27 | 28 | # Extreme ends of verbosity scale case handling 29 | if (verbosity == Verbosity::SILENT) 30 | # CMock is silent 31 | config[:verbosity] = 0 32 | 33 | elsif (verbosity == Verbosity::DEBUG) 34 | # CMock max verbosity 35 | config[:verbosity] = 3 36 | end 37 | 38 | return config 39 | end 40 | 41 | end 42 | -------------------------------------------------------------------------------- /lib/ceedling/plugin.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | class Plugin 9 | attr_reader :name, :environment 10 | attr_accessor :plugin_objects 11 | 12 | def initialize(system_objects, name, root_path) 13 | @environment = [] 14 | @ceedling = system_objects 15 | @plugin_root_path = root_path 16 | @name = name 17 | self.setup 18 | end 19 | 20 | # Override to prevent exception handling from walking & stringifying the object variables. 21 | # Plugin's object variables are gigantic and produce a flood of output. 22 | def inspect 23 | return this.class.name 24 | end 25 | 26 | def setup; end 27 | 28 | def summary; end 29 | 30 | end 31 | -------------------------------------------------------------------------------- /lib/ceedling/plugin_manager_helper.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | class PluginManagerHelper 9 | 10 | def include?(plugins, name) 11 | include = false 12 | plugins.each do |plugin| 13 | if (plugin.name == name) 14 | include = true 15 | break 16 | end 17 | end 18 | return include 19 | end 20 | 21 | def instantiate_plugin(plugin, system_objects, name, root_path) 22 | return eval( "#{plugin}.new(system_objects, name, root_path)" ) 23 | end 24 | 25 | end 26 | -------------------------------------------------------------------------------- /lib/ceedling/rake_utils.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | class RakeUtils 9 | 10 | constructor :rake_wrapper 11 | 12 | def task_invoked?(task_regex) 13 | task_invoked = false 14 | @rake_wrapper.task_list.each do |task| 15 | if ((task.already_invoked) and (task.to_s =~ task_regex)) 16 | task_invoked = true 17 | break 18 | end 19 | end 20 | return task_invoked 21 | end 22 | 23 | end 24 | -------------------------------------------------------------------------------- /lib/ceedling/rake_wrapper.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | require 'rubygems' 9 | require 'rake' 10 | require 'ceedling/makefile' # our replacement for rake's make-style dependency loader 11 | 12 | include Rake::DSL if defined?(Rake::DSL) 13 | 14 | class Rake::Task 15 | attr_reader :already_invoked 16 | end 17 | 18 | class RakeWrapper 19 | 20 | def initialize 21 | @makefile_loader = Rake::MakefileLoader.new # use our custom replacement noted above 22 | end 23 | 24 | def [](task) 25 | return Rake::Task[task] 26 | end 27 | 28 | def task_list 29 | return Rake::Task.tasks 30 | end 31 | 32 | def create_file_task(file_task, dependencies) 33 | file(file_task => dependencies) 34 | end 35 | 36 | def load_dependencies(dependencies_path) 37 | @makefile_loader.load(dependencies_path) 38 | end 39 | 40 | end 41 | -------------------------------------------------------------------------------- /lib/ceedling/release_invoker_helper.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | class ReleaseInvokerHelper 9 | 10 | constructor :configurator, :dependinator, :task_invoker 11 | 12 | end 13 | -------------------------------------------------------------------------------- /lib/ceedling/system_utils.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | class Object 9 | def deep_clone 10 | Marshal::load(Marshal.dump(self)) 11 | end 12 | end 13 | 14 | 15 | ## 16 | # Class containing system utility funcions. 17 | class SystemUtils 18 | 19 | constructor :system_wrapper 20 | 21 | ## 22 | # Sets up the class. 23 | def setup 24 | @tcsh_shell = nil 25 | end 26 | 27 | ## 28 | # Checks the system shell to see if it a tcsh shell. 29 | def tcsh_shell? 30 | # once run a single time, return state determined at that execution 31 | return @tcsh_shell unless @tcsh_shell.nil? 32 | 33 | result = @system_wrapper.shell_backticks(command:'echo $version') 34 | 35 | if ((result[:exit_code] == 0) and (result[:output].strip =~ /^tcsh/)) 36 | @tcsh_shell = true 37 | else 38 | @tcsh_shell = false 39 | end 40 | 41 | return @tcsh_shell 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /lib/ceedling/tasks_base.rake: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | require 'ceedling/constants' 9 | require 'ceedling/file_path_utils' 10 | 11 | # Set Rake verbosity using global constant verbosity set before Rake is loaded 12 | if !!defined?(PROJECT_VERBOSITY) 13 | verbose(PROJECT_VERBOSITY >= Verbosity::OBNOXIOUS) 14 | if PROJECT_VERBOSITY >= Verbosity::OBNOXIOUS 15 | Rake.application.options.silent = false 16 | Rake.application.options.suppress_backtrace_pattern = nil 17 | end 18 | end 19 | 20 | # Non-advertised debug task 21 | task :debug do 22 | Rake.application.options.trace = true 23 | end 24 | 25 | # non advertised sanity checking task 26 | task :sanity_checks, :level do |t, args| 27 | check_level = args.level.to_i 28 | @ceedling[:configurator].sanity_checks = check_level 29 | end 30 | 31 | # Do not present task if there's no plugins 32 | if (not PLUGINS_ENABLED.empty?) 33 | desc "Execute plugin result summaries (no build triggering)." 34 | task :summary do 35 | @ceedling[:plugin_manager].summary 36 | puts "\nNOTE: Summaries may be out of date with project sources.\n\n" 37 | end 38 | end 39 | 40 | -------------------------------------------------------------------------------- /lib/ceedling/verbosinator.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | require 'ceedling/constants' 9 | 10 | class Verbosinator 11 | 12 | def should_output?(level) 13 | # Rely on global constant created at early stages of command line processing 14 | 15 | if !defined?(PROJECT_VERBOSITY) 16 | return (level <= Verbosity::NORMAL) 17 | end 18 | 19 | return (level <= PROJECT_VERBOSITY) 20 | end 21 | 22 | end 23 | -------------------------------------------------------------------------------- /lib/ceedling/yaml_wrapper.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | require 'yaml' 9 | require 'erb' 10 | 11 | 12 | class YamlWrapper 13 | 14 | def load(filepath) 15 | source = ERB.new(File.read(filepath)).result 16 | begin 17 | return YAML.load(source, aliases: true) 18 | rescue ArgumentError 19 | return YAML.load(source) 20 | end 21 | end 22 | 23 | def load_string(source) 24 | begin 25 | return YAML.load(source, aliases: true) 26 | rescue ArgumentError 27 | return YAML.load(source) 28 | end 29 | end 30 | 31 | def dump(filepath, structure) 32 | File.open(filepath, 'w') do |output| 33 | YAML.dump(structure, output) 34 | end 35 | end 36 | 37 | end 38 | -------------------------------------------------------------------------------- /lib/version.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | ## 9 | ## version.rb is run as: 10 | ## 1. An executable script for a Ceedling tag used in the release build process 11 | ## `ruby Ceedling/lib/version.rb` 12 | ## 2. As a code module of constants consumed by Ruby's gem building process 13 | ## 14 | 15 | module Ceedling 16 | module Version 17 | # Convenience constants for gem building, etc. 18 | GEM = '1.0.2' 19 | TAG = GEM 20 | 21 | # If run as a script print Ceedling's version to $stdout 22 | puts( TAG ) if (__FILE__ == $0) 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without 8 | restriction, including without limitation the rights to use, 9 | copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following 12 | conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /plugins/beep/config/defaults.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | --- 9 | :beep: 10 | :on_done: :bell 11 | :on_error: :bell 12 | ... 13 | -------------------------------------------------------------------------------- /plugins/bullseye/assets/template.erb: -------------------------------------------------------------------------------- 1 | % function_string = hash[:coverage][:functions].to_s 2 | % branch_string = hash[:coverage][:branches].to_s 3 | % format_string = "%#{[function_string.length, branch_string.length].max}i" 4 | <%=@ceedling[:plugin_reportinator].generate_banner("#{hash[:header]}: CODE COVERAGE SUMMARY")%> 5 | % if (!hash[:coverage][:functions].nil?) 6 | FUNCTIONS: <%=sprintf(format_string, hash[:coverage][:functions])%>% 7 | % else 8 | FUNCTIONS: none 9 | % end 10 | % if (!hash[:coverage][:branches].nil?) 11 | BRANCHES: <%=sprintf(format_string, hash[:coverage][:branches])%>% 12 | % else 13 | BRANCHES: none 14 | % end 15 | 16 | -------------------------------------------------------------------------------- /plugins/dependencies/example/boss/src/boss.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef BOSS_H 9 | #define BOSS_H 10 | 11 | void boss_start(); 12 | void boss_hire_workers(int num_workers); 13 | void boss_fire_workers(int num_workers); 14 | int boss_micro_manage(int* chunks_of_work, int num_chunks); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /plugins/dependencies/example/boss/src/main.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include 9 | #include 10 | 11 | #include "boss.h" 12 | #include "version.h" 13 | 14 | #define WORK 20 15 | 16 | int main(int argc, char *argv[]) 17 | { 18 | int i; 19 | int work[WORK]; 20 | int retval; 21 | 22 | /* output the version */ 23 | puts(get_version()); 24 | 25 | /* This could be more interesting... but honestly, we're just proving this all builds */ 26 | boss_start(); 27 | 28 | /* Hire some workers */ 29 | for (i=0; i < 3; i++) 30 | { 31 | boss_hire_workers( 1 + rand() % 5 ); 32 | } 33 | 34 | /* Fire a few */ 35 | boss_fire_workers( rand() % 3 ); 36 | 37 | /* Do some work */ 38 | for (i= 0; i < WORK; i++) 39 | { 40 | work[i] = rand() % 10; 41 | } 42 | retval = boss_micro_manage(work, WORK); 43 | 44 | return retval; 45 | } -------------------------------------------------------------------------------- /plugins/dependencies/example/supervisor/src/supervisor.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "supervisor.h" 9 | 10 | int supervisor_delegate(int* worker_loads, int num_workers) 11 | { 12 | int i; 13 | int most_bored_id = 0; 14 | int most_bored_hours = 999999; 15 | 16 | if ((num_workers < 0) || (worker_loads == 0)) 17 | return -1; 18 | 19 | for (i=0; i < num_workers; i++) 20 | { 21 | if (worker_loads[i] < most_bored_hours) 22 | { 23 | most_bored_hours = worker_loads[i]; 24 | most_bored_id = i; 25 | } 26 | } 27 | 28 | return most_bored_id; 29 | } 30 | 31 | int supervisor_progress(int* worker_loads, int num_workers) 32 | { 33 | int i; 34 | int total_hours = 0; 35 | 36 | if (worker_loads == 0) 37 | return 0; 38 | 39 | for (i=0; i < num_workers; i++) 40 | { 41 | total_hours += worker_loads[i]; 42 | } 43 | 44 | return total_hours; 45 | } 46 | -------------------------------------------------------------------------------- /plugins/dependencies/example/supervisor/src/supervisor.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef SUPERVISOR_H 9 | #define SUPERVISOR_H 10 | 11 | int supervisor_delegate(int* worker_loads, int num_workers); 12 | int supervisor_progress(int* worker_loads, int num_workers); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /plugins/dependencies/example/version.tar.gzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThrowTheSwitch/Ceedling/9a3b32a8cfe414763408a0e82043cd7a028f7553/plugins/dependencies/example/version.tar.gzip -------------------------------------------------------------------------------- /plugins/dependencies/example/workerbees.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThrowTheSwitch/Ceedling/9a3b32a8cfe414763408a0e82043cd7a028f7553/plugins/dependencies/example/workerbees.zip -------------------------------------------------------------------------------- /plugins/fff/Rakefile: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | require 'rake' 9 | require 'rspec/core/rake_task' 10 | 11 | desc "Run all rspecs" 12 | RSpec::Core::RakeTask.new(:spec) do |t| 13 | t.pattern = Dir.glob('spec/**/*_spec.rb') 14 | t.rspec_opts = '--format documentation' 15 | # t.rspec_opts << ' more options' 16 | end 17 | 18 | desc "Run integration test on example" 19 | task :integration_test do 20 | chdir("./examples/fff_example") do 21 | sh "ceedling clobber" 22 | sh "ceedling test:all" 23 | end 24 | end 25 | 26 | task :default => [:spec, :integration_test] -------------------------------------------------------------------------------- /plugins/fff/config/fff.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | --- 9 | :paths: 10 | :support: 11 | - $PLUGIN_PATH/src 12 | - $PLUGIN_PATH/vendor/fff 13 | ... 14 | -------------------------------------------------------------------------------- /plugins/fff/examples/fff_example/build/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /plugins/fff/examples/fff_example/src/bar.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "bar.h" 9 | -------------------------------------------------------------------------------- /plugins/fff/examples/fff_example/src/bar.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef bar_H 9 | #define bar_H 10 | 11 | #include "custom_types.h" 12 | 13 | void bar_turn_on(void); 14 | void bar_print_message(const char * message); 15 | void bar_print_message_formatted(const char * format, ...); 16 | void bar_numbers(int one, int two, char three); 17 | void bar_const_test(const char * a, char * const b, const int c); 18 | custom_t bar_needs_custom_type(void); 19 | const char * bar_return_const_ptr(int one); 20 | 21 | #endif // bar_H 22 | -------------------------------------------------------------------------------- /plugins/fff/examples/fff_example/src/custom_types.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef custom_types_H 9 | #define custom_types_H 10 | 11 | typedef int custom_t; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /plugins/fff/examples/fff_example/src/display.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include 9 | #include "display.h" 10 | 11 | void display_turnOffStatusLed(void) 12 | { 13 | printf("Display: Status LED off"); 14 | } -------------------------------------------------------------------------------- /plugins/fff/examples/fff_example/src/display.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include 9 | 10 | void display_turnOffStatusLed(void); 11 | void display_turnOnStatusLed(void); 12 | void display_setVolume(int level); 13 | void display_setModeToMinimum(void); 14 | void display_setModeToMaximum(void); 15 | void display_setModeToAverage(void); 16 | bool display_isError(void); 17 | void display_powerDown(void); 18 | void display_updateData(int data, void(*updateCompleteCallback)(void)); 19 | 20 | /* 21 | The entry is returned (up to `length` bytes) in the provided `entry` buffer. 22 | */ 23 | void display_getKeyboardEntry(char * entry, int length); 24 | -------------------------------------------------------------------------------- /plugins/fff/examples/fff_example/src/event_processor.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include 9 | 10 | void event_deviceReset(void); 11 | void event_volumeKnobMaxed(void); 12 | void event_powerReadingUpdate(int powerReading); 13 | void event_modeSelectButtonPressed(void); 14 | void event_devicePoweredOn(void); 15 | void event_keyboardCheckTimerExpired(void); 16 | void event_newDataAvailable(int data); 17 | 18 | bool eventProcessor_isLastEventComplete(void); 19 | -------------------------------------------------------------------------------- /plugins/fff/examples/fff_example/src/foo.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "foo.h" 9 | #include "bar.h" 10 | #include "subfolder/zzz.h" 11 | 12 | void foo_turn_on(void) { 13 | bar_turn_on(); 14 | zzz_sleep(1, "sleepy"); 15 | } 16 | 17 | void foo_print_message(const char * message) { 18 | bar_print_message(message); 19 | } 20 | 21 | void foo_print_special_message(void) { 22 | bar_print_message_formatted("The numbers are %d, %d and %d", 1, 2, 3); 23 | } 24 | -------------------------------------------------------------------------------- /plugins/fff/examples/fff_example/src/foo.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef foo_H 9 | #define foo_H 10 | 11 | void foo_turn_on(void); 12 | void foo_print_message(const char * message); 13 | void foo_print_special_message(void); 14 | 15 | #endif // foo_H 16 | -------------------------------------------------------------------------------- /plugins/fff/examples/fff_example/src/subfolder/zzz.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "zzz.h" 9 | -------------------------------------------------------------------------------- /plugins/fff/examples/fff_example/src/subfolder/zzz.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef zzz_H 9 | #define zzz_H 10 | 11 | int zzz_sleep(int time, char * name); 12 | 13 | #endif // zzz_H 14 | -------------------------------------------------------------------------------- /plugins/fff/examples/fff_example/test/test_foo.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #include "unity.h" 9 | #include "foo.h" 10 | #include "mock_bar.h" 11 | #include "mock_zzz.h" 12 | 13 | void setUp(void) 14 | { 15 | } 16 | 17 | void tearDown(void) 18 | { 19 | } 20 | 21 | void test_foo(void) 22 | { 23 | //When 24 | foo_turn_on(); 25 | 26 | //Then 27 | TEST_ASSERT_EQUAL(1, bar_turn_on_fake.call_count); 28 | TEST_ASSERT_EQUAL(1, zzz_sleep_fake.call_count); 29 | TEST_ASSERT_EQUAL_STRING("sleepy", zzz_sleep_fake.arg1_val); 30 | } 31 | 32 | void test_foo_again(void) 33 | { 34 | //When 35 | foo_turn_on(); 36 | 37 | //Then 38 | TEST_ASSERT_EQUAL(1, bar_turn_on_fake.call_count); 39 | } 40 | 41 | void test_foo_mock_with_const(void) 42 | { 43 | foo_print_message("123"); 44 | 45 | TEST_ASSERT_EQUAL(1, bar_print_message_fake.call_count); 46 | TEST_ASSERT_EQUAL_STRING("123", bar_print_message_fake.arg0_val); 47 | } 48 | 49 | void test_foo_mock_with_variable_args(void) 50 | { 51 | foo_print_special_message(); 52 | TEST_ASSERT_EQUAL(1, bar_print_message_formatted_fake.call_count); 53 | TEST_ASSERT_EQUAL_STRING("The numbers are %d, %d and %d", bar_print_message_formatted_fake.arg0_val); 54 | } 55 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | LICENSE 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (c) 2010 Michael Long 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | mkdir -p build 3 | cd gtest; $(MAKE) all 4 | cd test; $(MAKE) all 5 | cd examples; $(MAKE) all 6 | 7 | clean: 8 | cd gtest; $(MAKE) clean 9 | cd test; $(MAKE) clean 10 | cd examples; $(MAKE) clean 11 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/buildandtest: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cat LICENSE > fff.h 5 | ruby fakegen.rb >> fff.h 6 | make clean 7 | make all 8 | build/fff_test_c 9 | build/fff_test_cpp --gtest_output=xml:build/test_results.xml 10 | build/ui_test_ansic 11 | build/ui_test_cpp --gtest_output=xml:build/example_results.xml 12 | build/fff_test_glob_c 13 | build/fff_test_glob_cpp --gtest_output=xml:build/test_global_results.xml 14 | build/driver_testing --gtest_output=xml:build/driver_testing.xml 15 | build/driver_testing_fff --gtest_output=xml:build/driver_testing_fff.xml 16 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/examples/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | cd embedded_ui; $(MAKE) all 3 | cd driver_testing; $(MAKE) all 4 | 5 | clean: 6 | cd embedded_ui; $(MAKE) clean 7 | cd driver_testing; $(MAKE) clean 8 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/examples/driver_testing/driver.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | 9 | 10 | 11 | #include "hardware_abstraction.h" 12 | #include "registers.h" 13 | 14 | void driver_write(uint8_t val) 15 | { 16 | IO_MEM_WR8(DRIVER_OUTPUT_REGISTER, val); 17 | } 18 | 19 | uint8_t driver_read() 20 | { 21 | return IO_MEM_RD8(DRIVER_INPUT_REGISTER); 22 | } 23 | 24 | void driver_init_device() 25 | { 26 | uint8_t hw_version = IO_MEM_RD8(HARDWARE_VERSION_REGISTER); 27 | if(HARDWARE_REV_B == hw_version) 28 | { 29 | IO_MEM_WR8(DRIVER_PERIPHERAL_ENABLE_REG, 1); 30 | } 31 | IO_MEM_WR8(DRIVER_PERIPHERAL_INITIALIZE_REG, 1); 32 | } 33 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/examples/driver_testing/driver.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | 9 | 10 | 11 | 12 | #ifndef DRIVER 13 | #define DRIVER 14 | 15 | #include 16 | 17 | void driver_write(uint8_t val); 18 | uint8_t driver_read(); 19 | void driver_init_device(); 20 | 21 | #endif /*include guard*/ 22 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/examples/driver_testing/hardware_abstraction.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | 9 | 10 | 11 | #ifndef HARDWARE_ABSTRACTION 12 | #define HARDWARE_ABSTRACTION 13 | 14 | #include 15 | 16 | #ifndef TESTING 17 | #define IO_MEM_RD8(ADDR) (*((volatile uint8_t *)(ADDR))) 18 | #define IO_MEM_WR8(ADDR, VAL_8) (*((volatile uint8_t *)(ADDR)) = (VAL_8)) 19 | #else 20 | /* In testing use fake functions to record calls to IO memory */ 21 | uint8_t IO_MEM_RD8(uint32_t reg); 22 | void IO_MEM_WR8(uint32_t reg, uint8_t val); 23 | #endif 24 | 25 | #endif /* Include guard */ 26 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/examples/driver_testing/registers.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | 9 | 10 | 11 | #ifndef REGISTERS_H_ 12 | #define REGISTERS_H_ 13 | 14 | #define DRIVER_OUTPUT_REGISTER 0xFFAAu 15 | #define DRIVER_INPUT_REGISTER 0XFFABu 16 | #define DRIVER_PERIPHERAL_ENABLE_REG 0xFFACu 17 | #define DRIVER_PERIPHERAL_INITIALIZE_REG 0xFFACu 18 | 19 | #define HARDWARE_VERSION_REGISTER 0xFF00u 20 | #define HARDWARE_REV_A 0x00u 21 | #define HARDWARE_REV_B 0x01u 22 | 23 | #endif /* REGISTERS_H_ */ 24 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/examples/embedded_ui/DISPLAY.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | 9 | 10 | 11 | /* 12 | * DISPLAY.h 13 | * 14 | * Created on: Dec 17, 2010 15 | * Author: mlong 16 | */ 17 | 18 | #ifndef DISPLAY_H_ 19 | #define DISPLAY_H_ 20 | 21 | void DISPLAY_init(); 22 | void DISPLAY_clear(); 23 | unsigned int DISPLAY_get_line_capacity(); 24 | unsigned int DISPLAY_get_line_insert_index(); 25 | void DISPLAY_output(char * message); 26 | 27 | #endif /* DISPLAY_H_ */ 28 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/examples/embedded_ui/Kata.txt: -------------------------------------------------------------------------------- 1 | 2 | Problem Definition 3 | ------------------ 4 | The task is to write a user interface module for an embedded device. 5 | 6 | Interrupts: 7 | * The user interface is responsible for initializing the display. 8 | * The user interface will register an interrupt handler for GPIO input 2 (a 9 | push button). 10 | * It will be possible to register a callback function for button presses. 11 | * When there is no callback function set the irq handler will increment a 12 | missed irq counter. 13 | * When the interrupt occurs the handler will schedule or execute the button 14 | press callback if there is one registered. 15 | Output: 16 | * Tasks can write messages to the user interface to be output on the display. 17 | * The display is line oriented; when the last line of the display is written 18 | the user interface is responsible for clearing the display. 19 | * The display is 26 characters wide. Any string longer than that must be 20 | truncated before being sent to the display. The string must be null 21 | terminated and thus maximum 27 bytes long. 22 | 23 | * BONUS: Have the display be scrolling, i.e. when the display is full, the 24 | previous lines must be shifted up one and the new line written in the bottom 25 | line. 26 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/examples/embedded_ui/SYSTEM.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | 9 | 10 | 11 | /* 12 | * DISPLAY.h 13 | * 14 | * Created on: Dec 17, 2010 15 | * Author: mlong 16 | */ 17 | 18 | #ifndef SYSTEM_H_ 19 | #define SYSTEM_H_ 20 | 21 | typedef void (*irq_func_t)(void); 22 | 23 | #define IRQ_GPIO_0 0x70 24 | #define IRQ_GPIO_1 0x71 25 | #define IRQ_GPIO_2 0x72 26 | #define IRQ_GPIO_3 0x73 27 | 28 | 29 | void SYSTEM_register_irq(irq_func_t, unsigned int irq); 30 | 31 | #endif /* SYSTEM_H_ */ 32 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/examples/embedded_ui/UI.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | 9 | #include "UI.h" 10 | #include "DISPLAY.h" 11 | #include "SYSTEM.h" 12 | #include 13 | 14 | static unsigned int missed_irq_counter; 15 | button_cbk_t button_cbk; 16 | 17 | 18 | void UI_init() 19 | { 20 | DISPLAY_init(); 21 | SYSTEM_register_irq(UI_button_irq_handler, IRQ_GPIO_2); 22 | button_cbk = 0; 23 | missed_irq_counter = 0; 24 | } 25 | 26 | unsigned int UI_get_missed_irqs() 27 | { 28 | return missed_irq_counter; 29 | } 30 | 31 | void UI_button_irq_handler() 32 | { 33 | if(button_cbk) 34 | { 35 | button_cbk(); 36 | } 37 | else 38 | { 39 | missed_irq_counter++; 40 | } 41 | } 42 | 43 | void UI_register_button_cbk(button_cbk_t cbk) 44 | { 45 | button_cbk = cbk; 46 | } 47 | 48 | void UI_write_line(char *line) 49 | { 50 | static char out[27]; 51 | strncpy(out, line, 26); 52 | out[26] = '\0'; 53 | if(DISPLAY_get_line_capacity() == DISPLAY_get_line_insert_index()) 54 | DISPLAY_clear(); 55 | DISPLAY_output(out); 56 | } 57 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/examples/embedded_ui/UI.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | 9 | 10 | 11 | #ifndef UI_H_ 12 | #define UI_H_ 13 | 14 | typedef void (*button_cbk_t)(void); 15 | 16 | void UI_init(); 17 | unsigned int UI_get_missed_irqs(); 18 | void UI_button_irq_handler(); 19 | void UI_register_button_cbk(button_cbk_t cbk); 20 | void UI_write_line(char *line); 21 | 22 | #endif /* UI_H_ */ 23 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/examples/embedded_ui/test_suite_template.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | 9 | #include "../../test/c_test_framework.h" 10 | 11 | /* Initialializers called for every test */ 12 | void setup() 13 | { 14 | 15 | } 16 | 17 | /* Tests go here */ 18 | TEST_F(GreeterTests, hello_world) 19 | { 20 | assert(1 == 0); 21 | } 22 | 23 | 24 | 25 | int main() 26 | { 27 | setbuf(stderr, NULL); 28 | fprintf(stdout, "-------------\n"); 29 | fprintf(stdout, "Running Tests\n"); 30 | fprintf(stdout, "-------------\n\n"); 31 | fflush(0); 32 | 33 | /* Run tests */ 34 | RUN_TEST(GreeterTests, hello_world); 35 | 36 | 37 | printf("\n-------------\n"); 38 | printf("Complete\n"); 39 | printf("-------------\n\n"); 40 | 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/gtest/Makefile: -------------------------------------------------------------------------------- 1 | 2 | BUILD_DIR = ../build 3 | LIBS := -lpthread 4 | CPP_OBJS=$(BUILD_DIR)/gtest-all.o $(BUILD_DIR)/gtest-main.o 5 | 6 | SOURCES=gtest-all.cc gtest-main.cc 7 | 8 | 9 | # Each subdirectory must supply rules for building sources it contributes 10 | $(BUILD_DIR)/%.o: %.cc 11 | @echo 'Building file: $<' 12 | @echo 'Invoking: GCC C++ Compiler' 13 | g++ -I../ -O0 -g3 -Wall -DGTEST_USE_OWN_TR1_TUPLE=1 -c -o "$@" "$<" 14 | @echo 'Finished building: $<' 15 | @echo ' ' 16 | 17 | all: $(CPP_OBJS) 18 | 19 | clean: 20 | -$(RM) $(CPP_OBJS) 21 | -@echo ' ' 22 | 23 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/gtest/gtest-main.cc: -------------------------------------------------------------------------------- 1 | #include "gtest.h" 2 | 3 | int main(int argc, char **argv) { 4 | ::testing::InitGoogleTest(&argc, argv); 5 | return RUN_ALL_TESTS(); 6 | } 7 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/test/c_test_framework.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | 9 | 10 | 11 | #ifndef C_TEST_FRAMEWORK_H_ 12 | #define C_TEST_FRAMEWORK_H_ 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | /* Test Framework :-) */ 19 | void setup(); 20 | #define TEST_F(SUITE, NAME) void NAME() 21 | #define RUN_TEST(SUITE, TESTNAME) printf(" Running %s.%s: \n", #SUITE, #TESTNAME); setup(); TESTNAME(); printf(" SUCCESS\n"); 22 | #define ASSERT_EQ(A, B) assert((A) == (B)) 23 | #define ASSERT_TRUE(A) assert((A)) 24 | 25 | #endif /* C_TEST_FRAMEWORK_H_ */ 26 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/test/fff_test_global_cpp.cpp: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | 9 | 10 | extern "C"{ 11 | #include "global_fakes.h" 12 | } 13 | #include 14 | 15 | DEFINE_FFF_GLOBALS; 16 | 17 | class FFFTestSuite: public testing::Test 18 | { 19 | public: 20 | void SetUp() 21 | { 22 | RESET_FAKE(voidfunc1); 23 | RESET_FAKE(voidfunc2); 24 | RESET_FAKE(longfunc0); 25 | FFF_RESET_HISTORY(); 26 | } 27 | }; 28 | 29 | #include "test_cases.include" 30 | 31 | 32 | -------------------------------------------------------------------------------- /plugins/fff/vendor/fff/test/global_fakes.c: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | 9 | #include "global_fakes.h" 10 | #include // for memcpy 11 | 12 | DEFINE_FAKE_VOID_FUNC1(voidfunc1, int); 13 | DEFINE_FAKE_VOID_FUNC2(voidfunc2, char, char); 14 | DEFINE_FAKE_VALUE_FUNC0(long, longfunc0); 15 | DEFINE_FAKE_VALUE_FUNC0(enum MYBOOL, enumfunc0); 16 | DEFINE_FAKE_VALUE_FUNC0(struct MyStruct, structfunc0); 17 | DEFINE_FAKE_VOID_FUNC3_VARARG(voidfunc3var, const char *, int, ...); 18 | #ifndef __cplusplus 19 | DEFINE_FAKE_VALUE_FUNC3(int, strlcpy3, char* const, const char* const, const size_t); 20 | #endif /* __cplusplus */ 21 | DEFINE_FAKE_VOID_FUNC20(voidfunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); 22 | -------------------------------------------------------------------------------- /plugins/gcov/lib/reportinator_helper.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | require 'ceedling/constants' 9 | 10 | 11 | class ReportinatorHelper 12 | 13 | def initialize(system_objects) 14 | # Convenience alias 15 | @loginator = system_objects[:loginator] 16 | end 17 | 18 | # Output the shell result to the console. 19 | def print_shell_result(shell_result) 20 | if !(shell_result.nil?) 21 | msg = "Done in %.3f seconds." % shell_result[:time] 22 | @loginator.log(msg, Verbosity::NORMAL) 23 | 24 | if !(shell_result[:output].nil?) && (shell_result[:output].length > 0) 25 | @loginator.log(shell_result[:output], Verbosity::OBNOXIOUS) 26 | end 27 | end 28 | end 29 | 30 | end 31 | -------------------------------------------------------------------------------- /plugins/module_generator/assets/stubby1.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef STUBBY_H 9 | #define STUBBY_H 10 | 11 | void shorty(int); 12 | 13 | #endif // STUBBY_H 14 | -------------------------------------------------------------------------------- /plugins/module_generator/assets/stubby2.h: -------------------------------------------------------------------------------- 1 | /* ========================================================================= 2 | Ceedling - Test-Centered Build System for C 3 | ThrowTheSwitch.org 4 | Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | SPDX-License-Identifier: MIT 6 | ========================================================================= */ 7 | 8 | #ifndef STUBBY_H 9 | #define STUBBY_H 10 | 11 | void shrimpy(void); 12 | void shorty(int); 13 | int tiny(int a); 14 | 15 | #endif // STUBBY_H 16 | -------------------------------------------------------------------------------- /plugins/module_generator/config/module_generator.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | :module_generator: 9 | :naming: :snake #options: :bumpy, :camel, :caps, or :snake 10 | :boilerplates: 11 | :src: "" 12 | :inc: "" 13 | :tst: "" -------------------------------------------------------------------------------- /plugins/report_build_warnings_log/README.md: -------------------------------------------------------------------------------- 1 | # Ceedling Plugin: Build Warnings Log 2 | 3 | Capture build process warnings from command tools to a plain text log file. 4 | 5 | # Plugin Overview 6 | 7 | This plugin captures warning messages output by command line tools throughout a 8 | build. At the end of a build, any collected warning messages are written to one 9 | or more plain text log files. 10 | 11 | Warning messages are collected for all compilation-related builds and 12 | differentiated by build context — `test`, `release`, or plugin-modified build 13 | (e.g. `gcov`). 14 | 15 | Ceedling warning messages or warning messages from code generation will not 16 | appear in log files; warnings are only collected from build step command line 17 | tools for the predefined build steps of preprocessing, compilation, and 18 | linking. 19 | 20 | Log files are written to `/artifacts//`. 21 | 22 | # Setup 23 | 24 | Enable the plugin in your Ceedling project file: 25 | 26 | ```yaml 27 | :plugins: 28 | :enabled: 29 | - report_build_warnings_log 30 | ``` 31 | 32 | # Configuration 33 | 34 | To change the default filename of `warning.log`, add your desired filename to 35 | your configuration file using `:report_build_warnings_log:` ↳ `:filename`. 36 | 37 | ```yaml 38 | :report_build_warnings_log: 39 | :filename: more_better_filename.ext 40 | ``` 41 | -------------------------------------------------------------------------------- /plugins/report_build_warnings_log/config/defaults.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | --- 10 | :report_build_warnings_log: 11 | :filename: warnings.log 12 | ... -------------------------------------------------------------------------------- /plugins/report_tests_gtestlike_stdout/config/report_tests_gtestlike_stdout.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | --- 9 | :plugins: 10 | # tell Ceedling we got results display taken care of 11 | :display_raw_test_results: FALSE 12 | -------------------------------------------------------------------------------- /plugins/report_tests_ide_stdout/config/report_tests_ide_stdout.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | --- 9 | :plugins: 10 | # tell Ceedling we got results display taken care of 11 | :display_raw_test_results: FALSE 12 | -------------------------------------------------------------------------------- /plugins/report_tests_log_factory/config/defaults.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | --- 9 | :report_tests_log_factory: 10 | :reports: [] 11 | ... -------------------------------------------------------------------------------- /plugins/report_tests_log_factory/sample_html_report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThrowTheSwitch/Ceedling/9a3b32a8cfe414763408a0e82043cd7a028f7553/plugins/report_tests_log_factory/sample_html_report.png -------------------------------------------------------------------------------- /plugins/report_tests_pretty_stdout/README.md: -------------------------------------------------------------------------------- 1 | # Ceedling Plugin: Pretty Test Suite Console Report 2 | 3 | Prints to the console ($stdout) simple, readable test suite results. 4 | 5 | # Plugin Overview 6 | 7 | This plugin is intended to be the default option for formatting a test suite's 8 | results when displayed at the console. It collects raw test results from the 9 | individual test executables of your test suite and presents them in a more 10 | readable summary form. 11 | 12 | # Setup 13 | 14 | Enable the plugin in your project.yml by adding `report_tests_pretty_stdout` to 15 | the list of enabled plugins instead of any other `report_tests_*_stdout` 16 | plugin. 17 | 18 | ``` YAML 19 | :plugins: 20 | :enabled: 21 | - report_tests_pretty_stdout 22 | ``` 23 | 24 | # Configuration 25 | 26 | No additional configuration is needed once the plugin is enabled. 27 | 28 | # Example Output 29 | 30 | ```sh 31 | > ceedling test:Model 32 | ``` 33 | 34 | ``` 35 | ------------------- 36 | FAILED TEST SUMMARY 37 | ------------------- 38 | [test/TestModel.c] 39 | Test: testInitShouldCallSchedulerAndTemperatureFilterInit 40 | At line (21): "Function TaskScheduler_Init() called more times than expected." 41 | 42 | -------------------- 43 | OVERALL TEST SUMMARY 44 | -------------------- 45 | TESTED: 1 46 | PASSED: 0 47 | FAILED: 1 48 | IGNORED: 0 49 | 50 | --------------------- 51 | BUILD FAILURE SUMMARY 52 | --------------------- 53 | Unit test failures. 54 | ``` 55 | -------------------------------------------------------------------------------- /plugins/report_tests_pretty_stdout/config/report_tests_pretty_stdout.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | --- 9 | :plugins: 10 | # tell Ceedling we got results display taken care of 11 | :display_raw_test_results: FALSE 12 | -------------------------------------------------------------------------------- /plugins/report_tests_teamcity_stdout/config/defaults.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | --- 9 | :teamcity: 10 | # Override to FALSE in user, local project options to prevent CI $stdout messages 11 | :build: TRUE 12 | ... -------------------------------------------------------------------------------- /plugins/report_tests_teamcity_stdout/config/report_tests_teamcity_stdout.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | --- 9 | :plugins: 10 | # tell Ceedling we got results display taken care of 11 | :display_raw_test_results: FALSE 12 | -------------------------------------------------------------------------------- /spec/configurator_builder_spec.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | #derived from test_graveyard/unit/busted/configurator_builder_test.rb 10 | 11 | require 'spec_helper' 12 | require 'ceedling/configurator_builder' 13 | 14 | describe ConfiguratorBuilder do 15 | xit "is scary" 16 | end -------------------------------------------------------------------------------- /spec/configurator_helper_spec.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | require 'spec_helper' 9 | 10 | describe "ConfiguratorHelper" do 11 | xit "doesn't exist..." 12 | end -------------------------------------------------------------------------------- /spec/configurator_spec.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | require 'spec_helper' 9 | require 'ceedling/configurator' 10 | 11 | describe Configurator do 12 | describe "#standardize_paths" do 13 | xit "should standardize [:project][:build_root]" 14 | xit "should standardize [:paths]" 15 | xit "should standardize [:files]" 16 | xit "should standardize [:tools]" 17 | end 18 | end -------------------------------------------------------------------------------- /spec/manual/stress_test.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | iterations = (ARGV[0] || 25).to_i 9 | puts "Stress Testing Each Scenario #{iterations} times..." 10 | 11 | require 'open3' 12 | 13 | defaults = { :dir => File.expand_path(File.dirname(__FILE__)) + '/../../examples/temp_sensor' } 14 | 15 | tasks = { 16 | 'ceedling clobber test:all' => defaults, 17 | 'ceedling -v=4 clobber test:all' => defaults, 18 | 'ceedling test:all' => defaults, 19 | 'ceedling --verbosity=obnoxious --mixin=add_unity_helper --mixin=add_gcov clobber test:all' => defaults, 20 | } 21 | 22 | tasks.each_pair do |k,v| 23 | Dir.chdir(v[:dir]) do 24 | iterations.times do |i| 25 | puts "=============== RUNNING ITERATION #{i+1}:\n#{k.to_s}\n===============\n\n" 26 | stdout, stderr, status = Open3.capture3(k) 27 | puts stdout,stderr,status 28 | raise "\n\nCrashed on #{k} Iteration #{i+1}" unless status.success? 29 | end 30 | end 31 | end -------------------------------------------------------------------------------- /spec/reportinator_spec.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | require 'spec_helper' 9 | require 'ceedling/reportinator' 10 | 11 | describe Reportinator do 12 | before(:each) do 13 | @rp = described_class.new 14 | end 15 | 16 | describe '#generate_banner' do 17 | it 'generates a banner with a width based on a string' do 18 | expect(@rp.generate_banner("Hello world!")).to eq("------------\nHello world!\n------------\n") 19 | end 20 | 21 | it 'generates a banner with a fixed width' do 22 | expect(@rp.generate_banner("Hello world!", 3)).to eq("---\nHello world!\n---\n") 23 | end 24 | end 25 | 26 | end 27 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | require 'require_all' 9 | require 'constructor' 10 | 11 | RSpec.configure do |config| 12 | config.raise_errors_for_deprecations! 13 | end 14 | 15 | here = File.dirname(__FILE__) 16 | 17 | $: << File.join(here, '../lib') 18 | $: << File.join(here, '../vendor/cmock/lib') 19 | $: << File.join(here, '../vendor/unity/auto') 20 | 21 | support_files = File.join(File.dirname(__FILE__), "support/**/*.rb") 22 | require_all Dir.glob(support_files, File::FNM_PATHNAME) 23 | support_dir = File.join(File.dirname(__FILE__), 'support') 24 | 25 | # Eventually, we should use this. 26 | # 27 | # # ceedling_files = File.join(File.dirname(__FILE__), '../lib/**/*.rb') 28 | # # require_all Dir.glob(ceedling_files, File::FNM_PATHNAME) 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /spec/support/other_target.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | -------------------------------------------------------------------------------- /spec/support/target.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | -------------------------------------------------------------------------------- /spec/support/test_example.fail: -------------------------------------------------------------------------------- 1 | --- 2 | :source: 3 | :file: some/place/test_example.c 4 | :dirname: some/place 5 | :basename: test_example.c 6 | :successes: [] 7 | :failures: 8 | - :test: test_one 9 | :line: 257 10 | :message: '' 11 | :unity_test_time: 0 12 | - :test: test_two 13 | :line: 269 14 | :message: '' 15 | :unity_test_time: 0 16 | :ignores: [] 17 | :counts: 18 | :total: 2 19 | :passed: 0 20 | :failed: 2 21 | :ignored: 0 22 | :stdout: 23 | - Verbose output one 24 | - Verbous output two 25 | :time: 0.0 26 | -------------------------------------------------------------------------------- /spec/support/test_example.pass: -------------------------------------------------------------------------------- 1 | --- 2 | :source: 3 | :file: some/place/test_example.c 4 | :dirname: some/place 5 | :basename: test_example.c 6 | :successes: 7 | - :test: test_one 8 | :line: 257 9 | :message: '' 10 | :unity_test_time: 0 11 | - :test: test_two 12 | :line: 269 13 | :message: '' 14 | :unity_test_time: 0 15 | :failures: [] 16 | :ignores: [] 17 | :counts: 18 | :total: 2 19 | :passed: 2 20 | :failed: 0 21 | :ignored: 0 22 | :stdout: 23 | - Verbose output one 24 | - Verbous output two 25 | :time: 0.0 26 | -------------------------------------------------------------------------------- /spec/support/test_example_empty.pass: -------------------------------------------------------------------------------- 1 | --- 2 | :source: 3 | :file: some/place/test_example.c 4 | :dirname: some/place 5 | :basename: test_example.c 6 | :successes: [] 7 | :failures: [] 8 | :ignores: [] 9 | :counts: 10 | :total: 0 11 | :passed: 0 12 | :failed: 0 13 | :ignored: 0 14 | :stdout: [] 15 | :time: 0.0 16 | -------------------------------------------------------------------------------- /spec/support/test_example_ignore.pass: -------------------------------------------------------------------------------- 1 | --- 2 | :source: 3 | :file: some/place/test_example.c 4 | :dirname: some/place 5 | :basename: test_example.c 6 | :successes: [] 7 | :failures: [] 8 | :ignores: 9 | - :test: test_one 10 | :line: 257 11 | :message: '' 12 | :unity_test_time: 0 13 | - :test: test_two 14 | :line: 269 15 | :message: '' 16 | :unity_test_time: 0 17 | :counts: 18 | :total: 2 19 | :passed: 0 20 | :failed: 0 21 | :ignored: 2 22 | :stdout: 23 | - Verbose output one 24 | - Verbous output two 25 | :time: 0.0 26 | -------------------------------------------------------------------------------- /spec/support/test_example_mangled.pass: -------------------------------------------------------------------------------- 1 | --- 2 | :source: 3 | :file: some/place/test_example.c 4 | :dirname: some/place 5 | :basename: test_example.c 6 | :successes: 7 | - :test: test_one 8 | :line: 257 9 | :message: '' 10 | :unity_test_time: 0 11 | - 12 | :failures: [] 13 | :ignores: [] 14 | :counts: 15 | :total: 2 16 | :passed: 2 17 | :failed: 0 18 | :ignored: 0 19 | :stdout: 20 | - Verbose output one 21 | - test_example.c:269:test_tVerbous output two 22 | :time: 0.0 23 | -------------------------------------------------------------------------------- /spec/support/test_example_with_time.pass: -------------------------------------------------------------------------------- 1 | --- 2 | :source: 3 | :file: some/place/test_example.c 4 | :dirname: some/place 5 | :basename: test_example.c 6 | :successes: 7 | - :test: test_one 8 | :line: 257 9 | :message: '' 10 | :unity_test_time: 0 11 | - :test: test_two 12 | :line: 269 13 | :message: '' 14 | :unity_test_time: 0 15 | :failures: [] 16 | :ignores: [] 17 | :counts: 18 | :total: 2 19 | :passed: 2 20 | :failed: 0 21 | :ignored: 0 22 | :stdout: 23 | - Verbose output one 24 | - Verbous output two 25 | :time: 0.01234 26 | -------------------------------------------------------------------------------- /spec/uncategorized_specs_spec.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | require 'spec_helper' 9 | 10 | describe "uncategorized" do 11 | describe "set_verbosity" do 12 | # drived from test_graveyard/unit/busted/configurator_test.rb:21 13 | xit "needs to be defined" 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /vendor/diy/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2007-2024 Atomic Object 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /vendor/diy/Rakefile: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | 3 | task :default => [ :test ] 4 | 5 | require 'rake/testtask' 6 | Rake::TestTask.new do |t| 7 | t.libs << "test" 8 | t.test_files = FileList['test/**/*_test.rb'] 9 | t.verbose = true 10 | end 11 | 12 | 13 | begin 14 | require 'jeweler' 15 | Jeweler::Tasks.new do |gemspec| 16 | $: << "lib" 17 | require 'diy.rb' 18 | gemspec.name = 'diy' 19 | gemspec.version = DIY::VERSION 20 | gemspec.summary = 'Constructor-based dependency injection container using YAML input.' 21 | gemspec.description = 'Constructor-based dependency injection container using YAML input.' 22 | gemspec.homepage = 'http://atomicobject.github.com/diy' 23 | gemspec.authors = 'Atomic Object' 24 | gemspec.email = 'github@atomicobject.com' 25 | gemspec.test_files = FileList['test/*_test.rb'] 26 | gemspec.add_dependency 'constructor', '>= 1.0.0' 27 | end 28 | 29 | Jeweler::GemcutterTasks.new 30 | 31 | rescue LoadError 32 | puts "(jeweler not installed)" 33 | end 34 | -------------------------------------------------------------------------------- /vendor/diy/TODO.txt: -------------------------------------------------------------------------------- 1 | Sun Dec 2 19:59:16 EST 2007 2 | crosby 3 | 4 | Features from FRE's rogue diy.rb (inside Injection) that need to be 5 | incorporated into trunk: 6 | 7 | * auto_require 8 | * use_class_directly 9 | 10 | -------------------------------------------------------------------------------- /vendor/diy/lib/diy/factory.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | module DIY #:nodoc:# 10 | class FactoryDef #:nodoc: 11 | attr_accessor :name, :target, :class_name, :library 12 | 13 | def initialize(opts) 14 | @name, @target, @library, @auto_require = 15 | opts[:name], opts[:target], opts[:library], opts[:auto_require] 16 | 17 | @class_name = Infl.camelize(@target) 18 | @library ||= Infl.underscore(@class_name) if @auto_require 19 | end 20 | end 21 | 22 | class Context 23 | def construct_factory(key) 24 | factory_def = @defs[key] 25 | # puts "requiring #{factory_def.library}" 26 | require factory_def.library if factory_def.library 27 | 28 | big_c = get_class_for_name_with_module_delimeters(factory_def.class_name) 29 | 30 | FactoryFactory.new(big_c) 31 | end 32 | end 33 | 34 | class FactoryFactory 35 | def initialize(clazz) 36 | @class_to_create = clazz 37 | end 38 | 39 | def create(*args) 40 | @class_to_create.new(*args) 41 | end 42 | end 43 | end 44 | 45 | -------------------------------------------------------------------------------- /vendor/diy/sample_code/car.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Car 10 | attr_reader :engine, :chassis 11 | def initialize(arg_hash) 12 | @engine = arg_hash[:engine] 13 | @chassis = arg_hash[:chassis] 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /vendor/diy/sample_code/chassis.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Chassis 10 | def to_s 11 | "Chassis" 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /vendor/diy/sample_code/diy_example.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | require "rubygems" 10 | require "diy" 11 | 12 | class Car 13 | attr_reader :engine, :chassis 14 | def initialize(arg_hash) 15 | @engine = arg_hash[:engine] 16 | @chassis = arg_hash[:chassis] 17 | end 18 | end 19 | 20 | class Chassis 21 | def to_s 22 | "Chassis" 23 | end 24 | end 25 | 26 | class Engine 27 | def to_s 28 | "Engine" 29 | end 30 | end 31 | 32 | context = DIY::Context.from_file("objects.yml") 33 | car = context['car'] 34 | puts "Car is made of: #{car.engine} and #{car.chassis}" 35 | -------------------------------------------------------------------------------- /vendor/diy/sample_code/engine.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Engine 10 | def to_s 11 | "Engine" 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /vendor/diy/sample_code/objects.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | --- 10 | car: 11 | compose: 12 | - engine 13 | - chassis 14 | 15 | engine: 16 | 17 | chassis: 18 | 19 | -------------------------------------------------------------------------------- /vendor/diy/test/files/broken_construction.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | 10 | dog_presenter: 11 | model: dog_model 12 | view: dog_view 13 | 14 | dog_model: 15 | # VIEW IS MISSING, PRESENTER SHOULD CRASH 16 | -------------------------------------------------------------------------------- /vendor/diy/test/files/cat/cat.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Cat 10 | constructor :heritage, :food, :strict => true, :accessors => true 11 | end 12 | -------------------------------------------------------------------------------- /vendor/diy/test/files/cat/extra_conflict.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | the_cat_lineage: 10 | 11 | cat: 12 | heritage: the_cat_lineage 13 | food: some_meat 14 | -------------------------------------------------------------------------------- /vendor/diy/test/files/cat/heritage.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Heritage 10 | end 11 | -------------------------------------------------------------------------------- /vendor/diy/test/files/cat/needs_input.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | cat: 10 | heritage: the_cat_lineage 11 | food: some_meat 12 | -------------------------------------------------------------------------------- /vendor/diy/test/files/cat/the_cat_lineage.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class TheCatLineage; end 10 | -------------------------------------------------------------------------------- /vendor/diy/test/files/dog/dog_model.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class DogModel 10 | constructor :file_resolver, :other_thing, :strict => true, :accessors => true 11 | end 12 | -------------------------------------------------------------------------------- /vendor/diy/test/files/dog/dog_presenter.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class DogPresenter 10 | constructor :model, :view, :strict => true, :accessors => true 11 | end 12 | -------------------------------------------------------------------------------- /vendor/diy/test/files/dog/dog_view.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class DogView 10 | end 11 | -------------------------------------------------------------------------------- /vendor/diy/test/files/dog/file_resolver.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class FileResolver 10 | end 11 | -------------------------------------------------------------------------------- /vendor/diy/test/files/dog/other_thing.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class OtherThing 10 | end 11 | -------------------------------------------------------------------------------- /vendor/diy/test/files/dog/simple.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | dog_presenter: 10 | model: dog_model 11 | view: dog_view 12 | 13 | file_resolver: 14 | other_thing: 15 | 16 | dog_model: 17 | compose: file_resolver, other_thing 18 | 19 | dog_view: 20 | -------------------------------------------------------------------------------- /vendor/diy/test/files/donkey/foo.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | 10 | module DiyTesting 11 | module Bar 12 | class Foo 13 | end 14 | end 15 | end 16 | 17 | -------------------------------------------------------------------------------- /vendor/diy/test/files/donkey/foo/bar/qux.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | 10 | module Foo 11 | module Bar 12 | class Qux 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /vendor/diy/test/files/factory/beef.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Beef 10 | def cook 11 | return "rare" 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /vendor/diy/test/files/factory/dog.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Dog 10 | def woof 11 | "woof" 12 | end 13 | end 14 | 15 | -------------------------------------------------------------------------------- /vendor/diy/test/files/factory/factory.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | cat_factory: 10 | builds: kitten 11 | library: kitten 12 | 13 | dog_factory: 14 | builds: dog 15 | 16 | using_namespace Farm: 17 | llama_factory: 18 | builds: llama 19 | 20 | +inny: 21 | bull_factory: 22 | builds: beef 23 | 24 | +congress: 25 | using_namespace Farm: 26 | politician: 27 | builds: pork 28 | -------------------------------------------------------------------------------- /vendor/diy/test/files/factory/farm/llama.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | module Farm 10 | class Llama 11 | def make_llama_noise 12 | "?" 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /vendor/diy/test/files/factory/farm/pork.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | module Farm 10 | class Pork 11 | def oink 12 | "money!" 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /vendor/diy/test/files/factory/kitten.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Kitten 10 | attr_accessor :a,:b 11 | 12 | def initialize(a, b) 13 | @a = a 14 | @b = b 15 | end 16 | 17 | def meow 18 | "meow" 19 | end 20 | end 21 | 22 | -------------------------------------------------------------------------------- /vendor/diy/test/files/fud/objects.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | widget: 10 | lib: toy 11 | 12 | trinket: 13 | lib: toy 14 | compose: thing_ama_jack 15 | 16 | thing_ama_jack: 17 | lib: toy 18 | 19 | toy: 20 | lib: toy 21 | compose: widget, trinket 22 | -------------------------------------------------------------------------------- /vendor/diy/test/files/fud/toy.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | 10 | class Toy 11 | constructor :widget, :trinket, :accessors => true, :strict => true 12 | end 13 | 14 | class Widget 15 | end 16 | 17 | class ThingAmaJack 18 | end 19 | 20 | class Trinket 21 | constructor :thing_ama_jack, :accessors => true, :strict => true 22 | end 23 | -------------------------------------------------------------------------------- /vendor/diy/test/files/functions/attached_things_builder.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class AttachedThingsBuilder 10 | end -------------------------------------------------------------------------------- /vendor/diy/test/files/functions/invalid_method.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | thing_builder: 10 | 11 | method build_thing: 12 | object: thing_builder 13 | method: no_exist -------------------------------------------------------------------------------- /vendor/diy/test/files/functions/method_extractor.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class MethodExtractor 10 | 11 | end -------------------------------------------------------------------------------- /vendor/diy/test/files/functions/nonsingleton_objects.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | thing_builder: 10 | singleton: false 11 | 12 | method build_thing: 13 | object: thing_builder 14 | method: build -------------------------------------------------------------------------------- /vendor/diy/test/files/functions/objects.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | thing_builder: 10 | 11 | method_extractor: 12 | 13 | attached_things_builder: 14 | 15 | method build_thing: 16 | object: thing_builder 17 | method: build 18 | attach: 19 | - attached_things_builder 20 | 21 | method build_default_thing: 22 | object: thing_builder 23 | method: build_default 24 | attach: 25 | - attached_things_builder 26 | - things_builder 27 | 28 | things_builder: 29 | compose: 30 | - build_thing -------------------------------------------------------------------------------- /vendor/diy/test/files/functions/thing.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Thing 10 | constructor :name, :ability, :accessors => true 11 | end -------------------------------------------------------------------------------- /vendor/diy/test/files/functions/thing_builder.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | require 'thing' 10 | 11 | class ThingBuilder 12 | @@builder_count = 0 13 | 14 | def self.reset_builder_count 15 | @@builder_count = 0 16 | end 17 | 18 | def self.builder_count 19 | @@builder_count 20 | end 21 | 22 | def initialize 23 | @@builder_count += 1 24 | end 25 | 26 | def build(name, ability) 27 | Thing.new(:name => name, :ability => ability) 28 | end 29 | 30 | def build_default 31 | Thing.new(:name => "Thing", :ability => "nothing") 32 | end 33 | end -------------------------------------------------------------------------------- /vendor/diy/test/files/functions/things_builder.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class ThingsBuilder 10 | constructor :build_thing, :accessors => true 11 | end -------------------------------------------------------------------------------- /vendor/diy/test/files/gnu/objects.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | 10 | injected: 11 | 12 | thinger: 13 | compose: injected 14 | 15 | +inny: 16 | inner_injected: 17 | 18 | inner_thinger: 19 | injected: inner_injected 20 | lib: thinger 21 | class: Thinger 22 | 23 | -------------------------------------------------------------------------------- /vendor/diy/test/files/gnu/thinger.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | 10 | 11 | class Thinger 12 | constructor :injected 13 | attr_reader :injected 14 | end 15 | 16 | -------------------------------------------------------------------------------- /vendor/diy/test/files/goat/base.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Base 10 | def test_output(name) 11 | # See diy_context_test.rb 12 | File.open($goat_test_output_file, "a") do |f| 13 | f.puts "#{name} built" 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /vendor/diy/test/files/goat/can.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | require 'base' 10 | class Can < Base 11 | def initialize 12 | test_output "can" 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /vendor/diy/test/files/goat/goat.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | require 'base' 10 | class Goat < Base 11 | def initialize 12 | test_output "goat" 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /vendor/diy/test/files/goat/objects.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | can: 10 | 11 | paper: 12 | 13 | shirt: 14 | 15 | goat: 16 | 17 | +the_sub_context: 18 | plane: 19 | compose: wings 20 | wings: 21 | -------------------------------------------------------------------------------- /vendor/diy/test/files/goat/paper.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | require 'base' 10 | class Paper < Base 11 | def initialize 12 | test_output "paper" 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /vendor/diy/test/files/goat/plane.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | require 'base' 10 | class Plane < Base 11 | constructor :wings, :strict => true 12 | def setup 13 | test_output "plane" 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /vendor/diy/test/files/goat/shirt.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | require 'base' 10 | class Shirt < Base 11 | def initialize 12 | test_output "shirt" 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /vendor/diy/test/files/goat/wings.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | require 'base' 10 | class Wings < Base 11 | def initialize 12 | test_output "wings" 13 | end 14 | def stay_on; end 15 | def fall_off; end 16 | end 17 | -------------------------------------------------------------------------------- /vendor/diy/test/files/horse/holder_thing.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class HolderThing 10 | constructor :thing_held, :strict => true, :accessors => true 11 | end 12 | -------------------------------------------------------------------------------- /vendor/diy/test/files/horse/objects.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | holder_thing: 10 | thing_held: this_context 11 | 12 | +repeater: 13 | other_thing: 14 | class: HolderThing 15 | thing_held: this_context 16 | -------------------------------------------------------------------------------- /vendor/diy/test/files/namespace/animal/bird.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | module Animal 10 | class Bird 11 | constructor :sky, :accessors => true 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /vendor/diy/test/files/namespace/animal/cat.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | module Animal 10 | class Cat 11 | constructor :road, :accessors => true 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /vendor/diy/test/files/namespace/animal/reptile/hardshell/turtle.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | module Animal 10 | module Reptile 11 | module Hardshell 12 | class Turtle 13 | end 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /vendor/diy/test/files/namespace/animal/reptile/lizard.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | module Animal 10 | module Reptile 11 | class Lizard 12 | constructor :bird, :accessors => true 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /vendor/diy/test/files/namespace/bad_module_specified.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | 10 | sky: 11 | 12 | using_namespace FuzzyCreature: 13 | 14 | bird: 15 | compose: sky 16 | 17 | -------------------------------------------------------------------------------- /vendor/diy/test/files/namespace/class_name_combine.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | road: 10 | 11 | using_namespace Animal: 12 | 13 | garfield: 14 | class: Cat 15 | compose: road 16 | 17 | -------------------------------------------------------------------------------- /vendor/diy/test/files/namespace/hello.txt: -------------------------------------------------------------------------------- 1 | this is the info -------------------------------------------------------------------------------- /vendor/diy/test/files/namespace/no_module_specified.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | 10 | sky: 11 | 12 | using_namespace: 13 | 14 | bird: 15 | compose: sky 16 | 17 | -------------------------------------------------------------------------------- /vendor/diy/test/files/namespace/objects.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | road: 10 | 11 | sky: 12 | 13 | using_namespace Animal: 14 | 15 | cat: 16 | compose: road 17 | 18 | bird: 19 | compose: sky 20 | 21 | using_namespace Animal Reptile: 22 | 23 | lizard: 24 | compose: bird 25 | 26 | using_namespace Animal::Reptile::Hardshell: 27 | 28 | turtle: 29 | 30 | -------------------------------------------------------------------------------- /vendor/diy/test/files/namespace/road.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Road 10 | end 11 | -------------------------------------------------------------------------------- /vendor/diy/test/files/namespace/sky.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Sky 10 | end 11 | -------------------------------------------------------------------------------- /vendor/diy/test/files/namespace/subcontext.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | road: 10 | 11 | sky: 12 | 13 | using_namespace Animal: 14 | 15 | cat: 16 | compose: road 17 | 18 | 19 | +aviary: 20 | using_namespace Animal: 21 | bird: 22 | compose: sky 23 | 24 | using_namespace Animal Reptile: 25 | lizard: 26 | compose: bird 27 | 28 | using_namespace Animal::Reptile::Hardshell: 29 | turtle: 30 | 31 | -------------------------------------------------------------------------------- /vendor/diy/test/files/non_singleton/air.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Air 10 | end 11 | -------------------------------------------------------------------------------- /vendor/diy/test/files/non_singleton/fat_cat.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class FatCat 10 | constructor :thread_spinner, :tick, :yard, :accessors => true 11 | end 12 | -------------------------------------------------------------------------------- /vendor/diy/test/files/non_singleton/objects.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | air: 10 | 11 | thread_spinner: 12 | compose: air 13 | singleton: false 14 | 15 | yard: 16 | 17 | pig: 18 | compose: thread_spinner, yard 19 | 20 | +inner_sanctum: 21 | tick: 22 | compose: thread_spinner 23 | singleton: false 24 | 25 | fat_cat: 26 | compose: thread_spinner, tick, yard 27 | 28 | -------------------------------------------------------------------------------- /vendor/diy/test/files/non_singleton/pig.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Pig 10 | constructor :thread_spinner, :yard, :accessors => true 11 | end 12 | -------------------------------------------------------------------------------- /vendor/diy/test/files/non_singleton/thread_spinner.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class ThreadSpinner 10 | constructor :air, :accessors => true 11 | end 12 | -------------------------------------------------------------------------------- /vendor/diy/test/files/non_singleton/tick.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Tick 10 | constructor :thread_spinner, :accessors => true 11 | end 12 | -------------------------------------------------------------------------------- /vendor/diy/test/files/non_singleton/yard.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Yard 10 | end 11 | -------------------------------------------------------------------------------- /vendor/diy/test/files/yak/core_model.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class CoreModel 10 | constructor :data_source, :strict => true 11 | end 12 | -------------------------------------------------------------------------------- /vendor/diy/test/files/yak/core_presenter.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class CorePresenter 10 | constructor :model, :view, :strict => true 11 | end 12 | -------------------------------------------------------------------------------- /vendor/diy/test/files/yak/core_view.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class CoreView; end 10 | -------------------------------------------------------------------------------- /vendor/diy/test/files/yak/data_source.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class DataSource; end 10 | -------------------------------------------------------------------------------- /vendor/diy/test/files/yak/fringe_model.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class FringeModel 10 | constructor :connected, :accessors => true, :strict => true 11 | end 12 | -------------------------------------------------------------------------------- /vendor/diy/test/files/yak/fringe_presenter.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class FringePresenter 10 | constructor :fringe_model, :fringe_view, :strict => true 11 | end 12 | -------------------------------------------------------------------------------- /vendor/diy/test/files/yak/fringe_view.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class FringeView; end 10 | -------------------------------------------------------------------------------- /vendor/diy/test/files/yak/giant_squid.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class GiantSquid 10 | constructor :fringe_view, :core_model, :krill, :accessors => true 11 | end 12 | -------------------------------------------------------------------------------- /vendor/diy/test/files/yak/krill.rb: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | class Krill 10 | end 11 | -------------------------------------------------------------------------------- /vendor/diy/test/files/yak/my_objects.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | 10 | core_model: 11 | compose: data_source 12 | 13 | core_view: 14 | 15 | core_presenter: 16 | model: core_model 17 | view: core_view 18 | 19 | data_source: 20 | 21 | +fringe_context: 22 | 23 | fringe_model: 24 | connected: core_model 25 | 26 | fringe_view: 27 | 28 | fringe_presenter: 29 | compose: fringe_model, fringe_view 30 | -------------------------------------------------------------------------------- /vendor/diy/test/files/yak/sub_sub_context_test.yml: -------------------------------------------------------------------------------- 1 | # ========================================================================= 2 | # Ceedling - Test-Centered Build System for C 3 | # ThrowTheSwitch.org 4 | # Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================= 7 | 8 | 9 | 10 | core_model: 11 | compose: data_source 12 | 13 | core_view: 14 | 15 | core_presenter: 16 | model: core_model 17 | view: core_view 18 | 19 | data_source: 20 | 21 | +fringe_context: 22 | 23 | fringe_model: 24 | connected: core_model 25 | 26 | fringe_view: 27 | 28 | fringe_presenter: 29 | compose: fringe_model, fringe_view 30 | 31 | +deep_context: 32 | krill: 33 | 34 | giant_squid: 35 | compose: fringe_view, core_model, krill 36 | --------------------------------------------------------------------------------