@@ -91,6 +91,7 @@ int main(string[] args)
91
91
import std.file , std.getopt , std.path ;
92
92
import std.parallelism : parallel;
93
93
import std.process : environment;
94
+ import std.typecons : Tuple ;
94
95
95
96
auto specDir = __FILE_FULL_PATH__.dirName.buildPath(" spec" );
96
97
config.dmdBinPath = environment.get (" DMD" , " dmd" );
@@ -115,12 +116,17 @@ int main(string[] args)
115
116
.findDdocMacro(ddocKey)
116
117
.map! ddocMacroToCode;
117
118
118
- enum ddocKey = " $(SPEC_RUNNABLE_EXAMPLE" ;
119
-
119
+ alias SpecType = Tuple ! (string , " key" , CompileConfig.TestMode, " mode" );
120
+ auto specTypes = [
121
+ SpecType(" $(SPEC_RUNNABLE_EXAMPLE" , CompileConfig.TestMode.compile),
122
+ SpecType(" $(SPEC_RUNNABLE_EXAMPLE_RUN" , CompileConfig.TestMode.run),
123
+ SpecType(" $(SPEC_RUNNABLE_EXAMPLE_FAIL" , CompileConfig.TestMode.fail),
124
+ ];
120
125
foreach (file; specDir.dirEntries(" *.dd" , SpanMode.depth).parallel(1 ))
121
126
{
122
- CompileConfig compileConfig = {mode: CompileConfig.TestMode.compile};
123
- auto allTests = findExamples(file, ddocKey).map! (e => compileAndCheck(e, compileConfig));
127
+ auto allTests = specTypes.map! (c => findExamples(file, c.key)
128
+ .map! (e => compileAndCheck(e, CompileConfig(c.mode))))
129
+ .joiner;
124
130
if (! allTests.empty)
125
131
{
126
132
writefln(" %s: %d examples found" , file.baseName, allTests.walkLength);
0 commit comments