@@ -13,35 +13,21 @@ import vox.tests.tests;
1313@nogc nothrow :
1414
1515i32 runTests (ref TestSuite suite) {
16- u32 numTests;
17- if (suite.filter.enabled) {
18- foreach (ref test; suite.tests) {
19- if (suite.filter.shouldRun(test)) {
20- ++ numTests;
21- }
22- }
23-
24- writefln(" Selected %s of %s tests to run" , numTests, suite.tests.length);
16+ if (suite.isFilterEnabled) {
17+ writefln(" Selected %s of %s tests to run" , suite.numTestsToRun, suite.tests.length);
2518 } else {
26- numTests = cast (u32)suite.tests.length;
27- writefln(" Running %s tests" , suite.tests.length);
19+ writefln(" Running all %s tests" , suite.numTestsToRun);
2820 }
2921
30- // Warmup (first run does all the allocations and memory faults)
31- // if (suite.filter.disabled && suite.tests.length) {
32- // context.runTest(suite.tests[0]);
33- // context.runTest(suite.tests[0]);
34- // context.runTest(suite.tests[0]);
35- // }
36- // End warmup
37-
3822 MonoTime start = currTime;
3923 foreach (ref test; suite.tests) {
40- auto context = suite.contexts[test.contextIndex];
41- context.runTest(test);
24+ if (! suite.isFilterEnabled || test.onlyThis) {
25+ auto context = suite.contexts[test.contextIndex];
26+ context.runTest(test);
27+ }
4228 }
4329 MonoTime end = currTime;
44- writefln(" Done %s tests in %s" , suite.tests.length , end - start);
30+ writefln(" Done %s tests in %s" , suite.numTestsToRun , end - start);
4531
4632 return 0 ;
4733}
0 commit comments