MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / sortTests

Function sortTests

Bcore/src/main/cpp/Dobby/tests/catch.hpp:9905–9922  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9903namespace Catch {
9904
9905std::vector<TestCase> sortTests(IConfig const &config, std::vector<TestCase> const &unsortedTestCases) {
9906
9907 std::vector<TestCase> sorted = unsortedTestCases;
9908
9909 switch (config.runOrder()) {
9910 case RunTests::InLexicographicalOrder:
9911 std::sort(sorted.begin(), sorted.end());
9912 break;
9913 case RunTests::InRandomOrder:
9914 seedRng(config);
9915 RandomNumberGenerator::shuffle(sorted);
9916 break;
9917 case RunTests::InDeclarationOrder:
9918 // already in declaration order
9919 break;
9920 }
9921 return sorted;
9922}
9923bool matchTest(TestCase const &testCase, TestSpec const &testSpec, IConfig const &config) {
9924 return testSpec.matches(testCase) && (config.allowThrows() || !testCase.throws());
9925}

Callers 1

catch.hppFile · 0.85

Calls 4

seedRngFunction · 0.85
runOrderMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected