rusefi/unit_tests
FDSoftware a48c014a6f calculated fuel vs fuel pressure compensation table
see #7594
2025-03-11 13:36:13 -04:00
..
chibios-mock
googletest@c231e6f5b1
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
test_results Create readme.md 2024-12-29 21:06:34 -05:00
tests calculated fuel vs fuel pressure compensation table 2025-03-11 13:36:13 -04:00
.cproject
.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
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
global_mocks.cpp
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
mocks.cpp
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
run_clean_gcov.sh
run_logicdata_sandbox.bat
run_sharded_tests.sh
test.mk
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.