rusefi/unit_tests
FDSoftware bd66c1b602 technical debt: NT -> US -> NT in unit test scheduler [update tests]
see #7245
2025-03-06 22:37:56 -04:00
..
chibios-mock unit_test: ThreadReference mock 2024-03-11 16:54:58 -04:00
googletest@c231e6f5b1 fresh googletest 2024-03-15 21:32:42 -06:00
test-framework technical debt: NT -> US -> NT in unit test scheduler [fix code & prepare flag for now broken test] 2025-03-06 22:37:56 -04:00
test_basic_math only: wow, all of this was dead code 2024-07-03 10:16:24 -04:00
test_results Create readme.md 2024-12-29 21:06:34 -05:00
tests technical debt: NT -> US -> NT in unit test scheduler [update tests] 2025-03-06 22:37:56 -04:00
.cproject dead warningEnabled global variable (#5636) 2023-10-24 18:55:29 -04:00
.gitignore unit_tests "logic analyzer" moved to dedicated folder 2024-12-27 15:32:17 -04:00
.project
Makefile unit tests to write MS logs #7222 2024-12-27 22:38:52 -05:00
_time_tests.sh Break out unit tests - linking - also compilation time stats #2627 2025-02-26 20:31:56 -05:00
adc_inputs.h adc: fix unit tests 2024-05-05 13:26:24 -04:00
boards.cpp adc: try to clean naming mess: getVoltageDivided() rename to adcGetScaledVoltage() 2024-12-09 07:43:43 -05:00
boards.h adc: try to clean naming mess: getAdcValue() rename to adcGetRawValue() 2024-12-09 07:43:43 -05:00
ci_gcov.sh
clean_compile.bat
clean_compile.sh
efifeatures.h EFI_HIP_9011_LOGIC 2025-01-19 15:34:57 -05:00
global.h time for VCS_VERSION to go 2024-05-29 18:10:01 -04:00
global_mocks.cpp https://sourceware.org/bugzilla/show_bug.cgi?id=9687 Weak symbols not working on mingw32 2024-08-03 12:24:06 -04:00
gmock-all.cpp
gtest-all.cpp
logicdata.cpp unit_tests "logic analyzer" style output #6403 2024-12-24 22:39:46 -05:00
logicdata.h unit_tests "logic analyzer" style output #6403 2024-12-24 22:39:46 -05:00
main.cpp Usability: critical error in case of unneeded second channel #6419 2024-04-26 22:18:01 -04:00
mocks.cpp only:testability 2024-09-18 00:33:15 -04:00
mocks.h etb: fix unit tests 2025-02-27 11:07:20 -05:00
readme.md only:Two-step TDD 2025-03-04 10:16:12 -05:00
rules.mk fix unit tests cleaning 2024-02-24 19:37:15 -05:00
run_clean_gcov.sh
run_logicdata_sandbox.bat
run_sharded_tests.sh
test.mk only: renaming .cpp 2024-04-30 16:15:13 -04:00
triggers.txt Trigger wheel definitions 2025-02-02 18:10:52 +00:00
unit_test_rules.mk compile coverage 2025-01-08 19:34:07 -05:00

readme.md

See https://github.com/rusefi/rusefi/wiki/Dev-Quality-Control

TL, DR: just follow tests folder as examples. tests/nitrous_control is a great starting point!

gcc/makefile/gtest

  1. Run 'make' to build desktop binary.
  2. Execute rusefi_test binary on your PC/Mac, it's expected to say SUCCESS and not fail :) Googletest will also print results summary.
  3. To run only one test use command line like build/rusefi_test --gtest_filter=*TEST_NAME* uncomment and modify main.cpp line ::testing::GTEST_FLAG(filter)

In this folder we have rusEFI unit tests using https://github.com/google/googletest

Unit tests are not aware of ChibiOS or ARM or else, they are just plain C/C++ which you build for your desktop, not your MCU.

Code Coverage Report

See also https://github.com/rusefi/rusefi/wiki/Build-Server-and-Automation

Triggers Images

Trigger images generation is still a two-step manual process:

Step 1: Invoke unit_tests. One of the unit_tests artifacts is triggers.txt

Step 2: Once we have triggers.txt updated by unit_tests we can invoke firmware/gen_trigger_images.bat in order to generate actual trigger images.

Two-step TDD

We are trying to https://en.wikipedia.org/wiki/Test-driven_development

Ideal change happens as two commits:

  • first we add coverage for current behaviour. In case of a defect we add green coverage confirming defect.
  • second step would be change in production code alongside of change in coverage.