for_developers:testing
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| for_developers:testing [2017/05/24 11:07] – graf | for_developers:testing [2025/06/04 16:03] (current) – [Suppress Logger Output] ursgraf | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Testing ====== | ====== Testing ====== | ||
| - | We use [[https:// | + | We use [[https://google.github.io/googletest/|Google Test]] as our test framework. Read [[https://google.github.io/ | 
| + | |||
| + | ===== Naming ===== | ||
| + | All the tests must be named in the following manner. | ||
| + | <code cpp> | ||
| + | TEST(testName, | ||
| + | </ | ||
| + | '' | ||
| + | |||
| + | ===== Running the Tests ===== | ||
| + | Make sure to compile the unit tests with the cmake argument '' | ||
| + | <code cpp> | ||
| + | $ ./ | ||
| + | $ ./ | ||
| + | $ ./ | ||
| + | $ ./ | ||
| + | $ ./ | ||
| + | $ ./ | ||
| + | $ ./ | ||
| + | $ ./ | ||
| + | $ ./ | ||
| + | $ ./ | ||
| + | </ | ||
| + | |||
| + | For the test with the HAL you need to install the [[getting_started: | ||
| + | |||
| + | ===== Suppress Logger Output ===== | ||
| + | We do not want to mangle output from control blocks or from the safety system with output from the testing framework. If you test a component which uses the logger framework, make sure to set the default stream logger and to set ' | ||
| + | <code cpp> | ||
| + | std:: | ||
| + | eeros:: | ||
| + | </ | ||
| + | |||
| + | ===== Running the Tests with a Script ===== | ||
| + | You can find a script under ''/ | ||
| + | |||
for_developers/testing.1495616841.txt.gz · Last modified: 2017/05/24 11:07 (external edit)
                
                