MercuryDPM
Alpha
|
To ensure that future updates to the code don't break existing features, MercuryDPM has a suite of test codes that each new commit to has to pass.
Each kernel feature should be tested to ensure future updates to the code don't break existing features. Users are also encouraged to write tests for their own codes, to detect quickly if an update to the Kernel caused a change in the USER code.
You can run the test suite by calling make fullTest in your build directory. The test suite first checks that all codes in the Drivers directory compile, then tests the test codes.
There are 3 types of tests, which are recognizable by the ending of the *.cpp* file name:
SelfTest: All codes whose file name ends with SelfTest.cpp are recognised by the test suite as unit tests. Those tests should run in 10 seconds or less and create output files that are checked against gold data.
To create your own self test: Let's assume you developed a new Driver, for example Compression.cpp in MercurySource/Drivers/USER/JohnDoe, and you want to create a test to ensure that any new Kernel features won't affect the results of your code. To do so,
Before any new feature is committed, all tests have to be run and return a positive result (see Committing your code to SVN). Any commit that breaks one or more tests is a violation of the MercuryDPM coding standard, and is punishable by a round of beers to all other developers. To execute all test, run the following command before committing:
Note that tests can also be run individually, e.g. to run FreeFallUnitTest use ctest -R FreeFallUnitTest