MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / sortTests

Function sortTests

unittests/catch.hpp:9994–10011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9992namespace Catch {
9993
9994 std::vector<TestCase> sortTests( IConfig const& config, std::vector<TestCase> const& unsortedTestCases ) {
9995
9996 std::vector<TestCase> sorted = unsortedTestCases;
9997
9998 switch( config.runOrder() ) {
9999 case RunTests::InLexicographicalOrder:
10000 std::sort( sorted.begin(), sorted.end() );
10001 break;
10002 case RunTests::InRandomOrder:
10003 seedRng( config );
10004 RandomNumberGenerator::shuffle( sorted );
10005 break;
10006 case RunTests::InDeclarationOrder:
10007 // already in declaration order
10008 break;
10009 }
10010 return sorted;
10011 }
10012 bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ) {
10013 return testSpec.matches( testCase ) && ( config.allowThrows() || !testCase.throws() );
10014 }

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