File tree Expand file tree Collapse file tree 1 file changed +34
-11
lines changed Expand file tree Collapse file tree 1 file changed +34
-11
lines changed Original file line number Diff line number Diff line change 11import glob
2+ import logging
23import os
34import sys
45
6+ from e3 .os .process import Run , command_line_image
7+
8+
59from drivers import ALSTestDriver
610from e3 .testsuite .driver .classic import TestAbortWithFailure
711
@@ -29,17 +33,36 @@ def run(self):
2933 if self .env .options .format :
3034 cmd .append ("--format=%s" % self .env .options .format )
3135
36+ env = {
37+ "ALS" : self .env .als ,
38+ "ALS_HOME" : self .env .als_home ,
39+ "ALS_WAIT_FACTOR" : str (self .env .wait_factor ),
40+ "PYTHON" : sys .executable ,
41+ }
42+
3243 if self .env .main_options .debug :
3344 cmd .append ("--debug" )
3445
35- self .shell (
36- cmd ,
37- cwd = wd ,
38- env = {
39- "ALS" : self .env .als ,
40- "ALS_HOME" : self .env .als_home ,
41- "ALS_WAIT_FACTOR" : str (self .env .wait_factor ),
42- "PYTHON" : sys .executable ,
43- },
44- ignore_environ = False ,
45- )
46+ # In debug mode, we want to run the subprocess without piping so that it
47+ # can communicate the PID to debug and wait for input. So we use
48+ # e3.process.Run directly instead of self.shell.
49+ logging .info (f"Running: cd { wd } ; { command_line_image (cmd )} " )
50+ p = Run (
51+ cmd ,
52+ cwd = wd ,
53+ env = env ,
54+ ignore_environ = False ,
55+ output = None ,
56+ )
57+ if p .status != 0 :
58+ raise TestAbortWithFailure ("non-zero status code" )
59+ else :
60+ p = self .shell (
61+ cmd ,
62+ cwd = wd ,
63+ env = env ,
64+ ignore_environ = False ,
65+ )
66+
67+ if self .env .main_options .verbose :
68+ print (p .out )
You can’t perform that action at this time.
0 commit comments