Running Tests¶
Main Test Suite¶
Building¶
Tests are not built by default, --tests must be passed to the configure script.
This will build all the tests.
There are a few ways to only have specific tests built:
If using Make, specify the targets instead of leaving it default to the
alltarget.Run MPC on the test directory and build separately. Make sure to also build the test’s dependencies.
Create a custom workspace with the tests and pass it to the
configurescript using the--workspaceoption. Also make sure to include the test’s dependencies.
Running¶
Note
Make sure ACE_ROOT and DDS_ROOT are set, which can be done by running source setenv.sh on Linux and macOS or call setenv.cmd on Windows.
OpenDDS’ main suite of tests is ran by the tests/auto_run_tests.pl Perl script that reads lists of tests from files and selectively runs based on how the script has been configured.
For Unixes (Linux, macOS, BSDs, etc)¶
Run this in DDS_ROOT:
bin/auto_run_tests.pl
For Windows¶
Run this in DDS_ROOT:
bin\auto_run_tests.pl
If OpenDDS was built in Release mode add -ExeSubDir Release.
If it was built as static libraries add -ExeSubDir Static_Debug or -ExeSubDir Static_Release.
Manual Configuration¶
Manual configuration is done by passing -Config and test list files arguments to the script.
To manually configure what tests to run:
See the
--list-all-configsor--show-all-configsoptions to see the existing configurations used by all test list files.See the
--list-configsor--show-configsoptions to see the existing configurations used by specific test list files.--list-testslists the tests that would run for the current options.--list-all-testsis the same but includes all the known list files.See the test list files for the tests themselves:
-
This is included by default. Use
--no-dcpsto exclude this list.If
--no-auto-configwas passed, then--dcpswill have to be passed to include this.
tests/security/security_tests.lstUse
--securityto include this list.
java/tests/dcps_java_tests.lstUse
--javato include this list.
tools/modeling/tests/modeling_tests.lstUse
--modelingto include this list.
-
In a test list file each of the-space delimited words after the colon determines when the test is ran.
Passing
-Config RTPSwill run tests that haveRTPSand leave out tests with!RTPS.There are
-Configoptions that are added automatically if--no-auto-configwasn’t passed:-Config RTPS-Config GH_ACTIONSif running on GitHub ActionsThese are based on the OS
auto_run_tests.plis running under:-Config Win32-Config macOS-Config Linux
-Excludeexcludes test paths and arguments (but not the configurations) that match the argument. Passing-Exclude tests/DCPSwill exclude all tests intests/DCPS. This option uses RegEx, so passing-Exclude tests/(DCPS|FACE)will also exclude tests intests/FACE.Assuming they were built, CMake tests are ran if
--cmakeis passed. This uses CTest, which is a system that is separate from the one previously described.See
--helpfor all the available options.
Note
For those editing and creating test list files:
The ConfigList code in ACE can’t properly handle multiple test list entries with the same command.
It will run all those entries if the last one will run, even if based on the configs only one entry should run.
auto_run_tests.pl will warn about this if it’s using a test list file that has this problem.