@@ -87,10 +87,18 @@ def skip(cwd_cmd, to_skip):
87
87
'fib[(]30[)]' ),
88
88
}
89
89
90
+ def tests_to_run ():
91
+ if os .environ .get ('TUTORIALS' ):
92
+ return sorted (str .split (os .environ .get ('TUTORIALS' ), "," ))
93
+ else :
94
+ return sorted (tests .keys ())
95
+
90
96
errors = 0
97
+ ts = tests_to_run ()
91
98
92
99
print " [.] Running tests with SLOWNESS=%r" % (multiplier ,)
93
- for test in sorted (tests .keys ()):
100
+ print " [.] Will test %s" % (ts )
101
+ for test in ts :
94
102
(send_progs , recv_progs , output_mask ) = tests [test ]
95
103
for scwd , send_cmd in send_progs :
96
104
for rcwd , recv_cmd in recv_progs :
@@ -102,13 +110,13 @@ def skip(cwd_cmd, to_skip):
102
110
scmd = send_cmd % ctx
103
111
mask = output_mask % ctx
104
112
p = spawn (rcmd , cwd = rcwd )
105
- serror , sout = run (scmd , cwd = scwd )
113
+ exit_code , sout = run (scmd , cwd = scwd )
106
114
matched , rout = wait (p , mask )
107
- if matched and serror == 0 :
115
+ if matched and exit_code == 0 :
108
116
print " [+] %s %-30s ok" % (test , scwd + '/' + rcwd )
109
117
else :
110
118
print " [!] %s %-30s FAILED" % (test , scwd + '/' + rcwd )
111
- print " [!] %r output (error=%s) :\n %s\n " % (scmd , serror ,
119
+ print " [!] %r exited with status %s, output :\n %s\n " % (scmd , exit_code ,
112
120
sout .strip ())
113
121
print " [!] %r output:\n %s\n " % (rcmd , rout .strip ())
114
122
errors += 1
0 commit comments