MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/TriangleMeshDistance / sortTests

Function sortTests

tests/catch.hpp:11532–11549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11530namespace Catch {
11531
11532 std::vector<TestCase> sortTests( IConfig const& config, std::vector<TestCase> const& unsortedTestCases ) {
11533
11534 std::vector<TestCase> sorted = unsortedTestCases;
11535
11536 switch( config.runOrder() ) {
11537 case RunTests::InLexicographicalOrder:
11538 std::sort( sorted.begin(), sorted.end() );
11539 break;
11540 case RunTests::InRandomOrder:
11541 seedRng( config );
11542 std::shuffle( sorted.begin(), sorted.end(), rng() );
11543 break;
11544 case RunTests::InDeclarationOrder:
11545 // already in declaration order
11546 break;
11547 }
11548 return sorted;
11549 }
11550 bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ) {
11551 return testSpec.matches( testCase ) && ( config.allowThrows() || !testCase.throws() );
11552 }

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