User Tools

Site Tools


for_developers:testing

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
for_developers:testing [2019/02/13 09:11] – [Running the Tests] graffor_developers:testing [2021/05/25 14:11] (current) – [Suppress Logger Output] ursgraf
Line 10: Line 10:
  
 ===== Running the Tests ===== ===== Running the Tests =====
-Navigate to the directory ''test'' of the build directory of eeros and run the tests as follows.: +Make sure to compile the unit tests with the cmake argument ''-DUSE_TESTS=TRUE''Navigate to the directory ''test'' of the build directory of eeros and run the tests as follows.: 
 <code cpp> <code cpp>
 $ ./unitTests  --library sim                  // run all the tests using the simulator as hal $ ./unitTests  --library sim                  // run all the tests using the simulator as hal
Line 22: Line 22:
 $ ./unitTests  -l sim --gtest_filter=hal*     // run all the tests in hal using the simulator $ ./unitTests  -l sim --gtest_filter=hal*     // run all the tests in hal using the simulator
 </code> </code>
 +
 +For the test with the HAL you need to install the [[getting_started:install_wrapper#simulator|]] and set the library path (see [[getting_started:deploy|]]) so that the simulator library can be found.
 +
 +===== 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 'cout' to 'failed' state. This will prevent output to be written to the log.
 +<code cpp>
 +std::cout.setstate(std::ios_base::badbit);
 +eeros::logger::Logger::setDefaultStreamLogger(std::cout);
 +</code>
 +
 +
  
for_developers/testing.1550045512.txt.gz · Last modified: 2019/02/13 09:11 by graf