MCPcopy Create free account
hub / github.com/RenderKit/embree / sortTests

Function sortTests

tutorials/external/catch.hpp:11806–11823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11804namespace Catch {
11805
11806 std::vector<TestCase> sortTests( IConfig const& config, std::vector<TestCase> const& unsortedTestCases ) {
11807
11808 std::vector<TestCase> sorted = unsortedTestCases;
11809
11810 switch( config.runOrder() ) {
11811 case RunTests::InLexicographicalOrder:
11812 std::sort( sorted.begin(), sorted.end() );
11813 break;
11814 case RunTests::InRandomOrder:
11815 seedRng( config );
11816 std::shuffle( sorted.begin(), sorted.end(), rng() );
11817 break;
11818 case RunTests::InDeclarationOrder:
11819 // already in declaration order
11820 break;
11821 }
11822 return sorted;
11823 }
11824 bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ) {
11825 return testSpec.matches( testCase ) && ( config.allowThrows() || !testCase.throws() );
11826 }

Callers 1

catch.hppFile · 0.85

Calls 6

sortFunction · 0.85
seedRngFunction · 0.85
runOrderMethod · 0.80
shuffleFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected