ApprovalTests provides the following macros to detect the release version, with a set of example values shown in italics:
APPROVALTESTS_VERSION_MAJOR
: 8APPROVALTESTS_VERSION_MINOR
: 1APPROVALTESTS_VERSION_PATCH
: 2APPROVALTESTS_VERSION_STR
: 8.1.2APPROVALTESTS_VERSION
: 80102
See CMake Integration.
See Troubleshooting Misconfigured Build, for explanations, fixes and workarounds.
See the v.7.0.0 milestone for the full list of changes.
See Using Approval Tests With [Boost].UT.
See Existing Project - with your main().
Approval tests will now never launch any reporters on supported Continuous Integration machines.
See Approving multiple files in one test
See Using custom filename extensions
See Multiple output files per test.
See SeparateApprovedAndReceivedDirectoriesNamer
See Registering a Custom Namer
See Using Approval Tests With Google Tests
Sometimes you will want tests to only run on certain machines. Machine blockers are a great way to do this.
TEST_CASE("Only run this test on John's machine")
{
auto blocker = MachineBlocker::onMachinesNotNamed("JOHNS_MACHINE");
if (blocker.isBlockingOnThisMachine())
{
return;
}
// Write tests here that depend on John's environment.
REQUIRE(SystemUtils::getMachineName() == "JOHNS_MACHINE");
}
See Using sub-directories for approved files