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 all target.

  • 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 configure script using the --workspace option. 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, -Exclude, and test list files arguments to the script.

To manually configure what tests to run:

  • See the --list-all-configs or --show-all-configs options to see the existing configurations used by all test list files.

  • See the --list-configs or --show-configs options to see the existing configurations used by specific test list files.

  • See the test list files for the tests themselves:

  • In a test list file each of the-space delimited words after the colon determines when the test is ran.

  • Passing -Config RTPS will run tests that have RTPS and leave out tests with !RTPS.

  • Passing -Exclude RTPS will exclude all tests that have RTPS in the entry. This option matches using RegEx, so a test with SUPER_DUPER_RTPS will also be excluded. It also ignores inverse entries, so it will not exclude a test with !SUPER_DUPER_RTPS.

  • There are -Config options that are added automatically if --no-auto-config wasn’t passed:

    • -Config RTPS

    • -Config GH_ACTIONS if running on GitHub Actions

    • These are based on the OS auto_run_tests.pl is running under:

      • -Config Win32

      • -Config macOS

      • -Config Linux

  • Assuming they were built, CMake tests are ran if --cmake is passed. This uses CTest, which is a system that is separate from the one previously described.

  • See --help for all the available options.

Note

For those editing and creating test list files: The ConfigList code in ACE can’t properly handle mutiple 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.