Skip to content

More consistent flag conventions for ctest and run-tests.sh #1945

@Rangi42

Description

@Rangi42

The test/run-tests.sh script takes some optional flags: --only-internal, --only-external, --only-free, --os <os>, and --installed-rgbds.

The test/CMakeLists.txt file, as invoked by ctest, uses a different convention, more like what other CMake/CTest commands do. You can specify ctest -DTESTS_RUN_NONFREE to not pass ./run-tests.sh --only-free, and specify ctest -DTESTS_OS_NAME=<os> to pass ./run-tests.sh --os <os>. However, as of #1931, you specify ctest --label-exclude external to pass ./run-tests.sh --only-internal (because of how we use LABELS "external"). (And there's no way to indirectly pass --only-external or --installed-rgbds.)

Running test/run-tests.sh --help prints usage information describing all those flags (and even with that, one could argue that a bunch of Boolean flags controlling which tests get run is not an elegant design). However, AFAIK, there's no simple way to check all of the different ways to configure our ctest.

  • The ctest flags should be more consistent. Probably we'd want LABELs for every group of tests, instead of just for the "external" group.
  • The ctest flags should be documented, or if there's a built-in way to print them out, we should still mention that, e.g. in CONTRIBUTING.md.
  • Maybe the run-tests.sh flags should be redesigned, so instead of partially-overlapping Booleans (the --only-free tests include all of the --only-internal ones and some of the --only-external ones), there's one mechanism for specifying tests to exclude, same as ctest.
  • Ideally we'd have more groups. Right now ctest reports five groups: rgbasm, rgblink, rgbfix, rgbgfx, and external. This makes it difficult to tell whether the free and/or nonfree external tests were run. I think we should at least split them into external-free and external-nonfree groups, and maybe even have one "group" per external repo (though we'd still want a concise way to exclude the three nonfree disassembly repos).

Metadata

Metadata

Assignees

Labels

enhancementTypically new features; lesser priority than bugstestsThis affects the test suite

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions