@@ -61,8 +61,11 @@ def ListTests(self, context):
6161 return tests
6262
6363 def GetParametersForTestCase (self , testcase , context ):
64- flags = testcase .flags + context .mode_flags
6564 source = self .GetSourceForTest (testcase )
65+
66+ flags = testcase .flags + context .mode_flags
67+ env = self ._get_env (source )
68+
6669 flags_match = re .findall (FLAGS_PATTERN , source )
6770 for match in flags_match :
6871 flags += match .strip ().split ()
@@ -80,8 +83,9 @@ def GetParametersForTestCase(self, testcase, context):
8083 for f in files_list ]
8184 testfilename = os .path .join (self .root , testcase .path + self .suffix ())
8285 if SELF_SCRIPT_PATTERN .search (source ):
83- env = ["-e" , "TEST_FILE_NAME=\" %s\" " % testfilename .replace ("\\ " , "\\ \\ " )]
84- files = env + files
86+ files = (
87+ ["-e" , "TEST_FILE_NAME=\" %s\" " % testfilename .replace ("\\ " , "\\ \\ " )] +
88+ files )
8589
8690 if not context .no_harness and not NO_HARNESS_PATTERN .search (source ):
8791 files .append (os .path .join (self .root , "mjsunit.js" ))
@@ -90,19 +94,20 @@ def GetParametersForTestCase(self, testcase, context):
9094 files .append ("--module" )
9195 files .append (testfilename )
9296
93- all_files = []
94- all_files += files
97+ all_files = list (files )
9598 if context .isolates :
96- all_files .append ("--isolate" )
97- all_files += files
99+ all_files += ["--isolate" ] + files
100+
101+ return all_files , flags , env
98102
103+ def _get_env (self , source ):
99104 env_match = ENV_PATTERN .search (source )
105+ env = {}
100106 if env_match :
101107 for env_pair in env_match .group (1 ).strip ().split ():
102108 var , value = env_pair .split ('=' )
103- testcase .env [var ] = value
104-
105- return all_files , flags
109+ env [var ] = value
110+ return env
106111
107112 def GetSourceForTest (self , testcase ):
108113 filename = os .path .join (self .root , testcase .path + self .suffix ())
0 commit comments