@@ -17,13 +17,13 @@ struct Config
17
17
uint repeat = 10 ;
18
18
}
19
19
20
- string runCmd (string cmd, bool verbose)
20
+ string runCmd (string cmd, bool verbose, in char [] workDir = null )
21
21
{
22
22
import std.exception : enforce;
23
- import std.process : executeShell;
23
+ import std.process : executeShell, Config ;
24
24
25
25
if (verbose) writeln(cmd);
26
- auto res = executeShell(cmd);
26
+ auto res = executeShell(cmd, null , Config.none, size_t .max, workDir );
27
27
enforce(res.status == 0 , res.output);
28
28
return res.output;
29
29
}
@@ -72,13 +72,15 @@ void runTests(Config cfg)
72
72
73
73
import std.parallelism : parallel;
74
74
immutable bindir = absolutePath(" bin" , cwd);
75
+ immutable objdir = absolutePath(" obj" , cwd);
75
76
76
77
foreach (ref src; sources.parallel(1 ))
77
78
{
78
79
writeln(" COMPILING " , src);
79
80
version (Windows ) enum exe = " exe" ; else enum exe = " " ;
80
81
auto bin = buildPath(bindir, src.relativePath(cwd).setExtension(exe));
81
- auto cmd = std.string.format (" %s %s -op -odobj -of%s %s" , cfg.dmd, cfg.dflags, bin, src);
82
+ auto obj = buildPath(objdir, src.relativePath(cwd).setExtension(exe));
83
+ auto cmd = std.string.format (" %s %s -op -od%s -of%s %s" , cfg.dmd, cfg.dflags, obj, bin, src);
82
84
if (auto ex = src in extra_sources)
83
85
cmd ~= " -I" ~ src[0 .. $- 2 ] ~ " .extra" ~ * ex;
84
86
runCmd(cmd, cfg.verbose);
@@ -109,7 +111,7 @@ void runTests(Config cfg)
109
111
foreach (_; 0 .. cfg.repeat)
110
112
{
111
113
sw.reset;
112
- auto output = runCmd(cmd, cfg.verbose);
114
+ auto output = runCmd(cmd, cfg.verbose, cwd );
113
115
auto dur = cast (Duration)sw.peek;
114
116
115
117
auto parts = dur.split! (" seconds" , " msecs" );
0 commit comments