trial.executor.process 0/21(0%) line coverage

      
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
160
170
180
190
200
210
220
230
240
250
260
270
280
290
300
310
320
330
340
350
360
370
380
390
400
410
420
430
440
450
460
470
480
490
500
510
520
530
540
550
560
570
580
590
600
610
620
630
640
650
660
670
680
690
700
710
720
730
740
750
760
770
780
790
module trial.executor.process; import trial.reporters.visualtrial; import trial.executor.single; public import trial.interfaces; import std.process; import std.path; import std.file; import std.datetime; import std.conv; import std.stdio; void testProcessRuner(string suiteName, string testName, VisualTrialReporterParser parser) { TestResult testResult; auto command = [ thisExePath, "-s", suiteName, "-t", testName, "-r", "visualtrial", "-e", "default" ]; auto pipes = pipeProcess(command, Redirect.stdout | Redirect.stderrToStdout); foreach(line; pipes.stdout.byLine) { parser.add(line.to!string); if(testResult is null && parser.testResult !is null) { testResult = parser.testResult; } } auto code = wait(pipes.pid); if(testResult !is null && testResult.throwable is null && code != 0) { testResult.throwable = new Exception("The process exited with code `" ~ code.to!string ~ "`", testResult.fileName, testResult.line); testResult.status = TestResult.Status.failure; } } class ProcessExecutor : DefaultExecutor { alias runTest = DefaultExecutor.runTest; alias TestProcessRun = void function(string suiteName, string testName, VisualTrialReporterParser parser); private { TestProcessRun testProcessRun; VisualTrialReporterParser parser; } this(TestProcessRun testProcessRun) { super(); this.parser = new VisualTrialReporterParser(); this.parser.onOutput = &this.onOutput; this.testProcessRun = testProcessRun; } this() { this(&testProcessRuner); } void onOutput(string line) { writeln(line); } override void runTest(ref const(TestCase) testCase, TestResult testResult) { this.parser.testResult = testResult; testProcessRun(testCase.suiteName, testCase.name, parser); } }