5
5
6
6
7
7
def _mutateCommandLine (context , commandline ):
8
- timefile = context .tmpBase + ".time"
8
+ timefile = os . path . normpath ( context .tmpBase + ".time" )
9
9
config = context .config
10
10
cmd = shellcommand .parse (commandline )
11
11
@@ -16,24 +16,28 @@ def _mutateCommandLine(context, commandline):
16
16
timeit_name = "timeit"
17
17
else :
18
18
timeit_name = "timeit-target"
19
- timeit = "%s/tools/%s" % (config .test_source_root , timeit_name )
20
- args = ["--limit-core" , "0" ]
21
- args += ["--limit-cpu" , "7200" ]
22
- args += ["--timeout" , "7200" ]
23
- args += ["--limit-file-size" , "209715200" ]
24
- args += ["--limit-rss-size" , "838860800" ]
25
- workdir = cmd .workdir
19
+
20
+ timeit = os .path .normpath ("%s/tools/%s" % (config .test_source_root , timeit_name ))
21
+ args = ["--timeout" , "7200" ]
22
+ if os .name != 'nt' :
23
+ args += ["--limit-core" , "0" ]
24
+ args += ["--limit-cpu" , "7200" ]
25
+ args += ["--limit-file-size" , "209715200" ]
26
+ args += ["--limit-rss-size" , "838860800" ]
27
+
28
+ workdir = os .path .normpath (cmd .workdir ) if cmd .workdir is not None else None
29
+
26
30
if not config .traditional_output :
27
31
stdout = cmd .stdout
28
32
if cmd .stdout is not None :
29
33
if not os .path .isabs (stdout ) and workdir is not None :
30
- stdout = os .path .join (workdir , stdout )
34
+ stdout = os .path .join (workdir , os . path . normpath ( stdout ) )
31
35
args += ["--redirect-stdout" , stdout ]
32
36
cmd .stdout = None
33
37
stderr = cmd .stderr
34
38
if stderr is not None :
35
39
if not os .path .isabs (stderr ) and workdir is not None :
36
- stderr = os .path .join (workdir , stderr )
40
+ stderr = os .path .join (workdir , os . path . normpath ( stderr ) )
37
41
args += ["--redirect-stderr" , stderr ]
38
42
cmd .stderr = None
39
43
else :
@@ -42,17 +46,18 @@ def _mutateCommandLine(context, commandline):
42
46
"Separate stdout/stderr redirection not "
43
47
+ "possible with traditional output"
44
48
)
45
- outfile = context .tmpBase + ".out"
49
+ outfile = os . path . normpath ( context .tmpBase + ".out" )
46
50
args += ["--append-exitstatus" ]
47
51
args += ["--redirect-output" , outfile ]
48
52
stdin = cmd .stdin
49
53
if stdin is not None :
50
54
if not os .path .isabs (stdin ) and workdir is not None :
51
- stdin = os .path .join (workdir , stdin )
55
+ stdin = os .path .join (workdir , os . path . normpath ( stdin ) )
52
56
args += ["--redirect-input" , stdin ]
53
57
cmd .stdin = None
54
58
else :
55
- args += ["--redirect-input" , "/dev/null" ]
59
+ if os .name != 'nt' :
60
+ args += ["--redirect-input" , "/dev/null" ]
56
61
if workdir is not None :
57
62
args += ["--chdir" , workdir ]
58
63
cmd .workdir = None
0 commit comments