Changes in src/tests/test.py [f85bc15:ed45af6]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/test.py
rf85bc15 red45af6 19 19 20 20 def matchTest(path): 21 match = re.search(" %s\/([\w\/\-_]*).expect\/([\w\-_]+)(\.[\w\-_]+)?\.txt" % settings.SRCDIR, path)21 match = re.search("(\.[\w\/\-_]*)\/.expect\/([\w\-_]+)(\.[\w\-_]+)?\.txt", path) 22 22 if match : 23 23 test = Test() … … 116 116 # running test functions 117 117 ################################################################################ 118 # fix the absolute paths in the output119 def fixoutput( fname ):120 if not is_ascii(fname):121 return122 123 file_replace(fname, "%s/" % settings.SRCDIR, "")124 125 126 118 # logic to run a single test and return the result (No handling of printing or other test framework logic) 127 119 def run_single_test(test): 128 120 129 121 # find the output file based on the test name and options flag 130 exe_file = test.target_executable();131 122 out_file = test.target_output() 132 123 err_file = test.error_log() … … 138 129 139 130 # remove any outputs from the previous tests to prevent side effects 140 rm( (out_file, err_file, exe_file) )131 rm( (out_file, err_file, test.target()) ) 141 132 142 133 # build, skipping to next test on error … … 155 146 if make_ret == 0 or settings.dry_run: 156 147 before = time.time() 157 if settings.dry_run or fileIsExecutable( exe_file) :148 if settings.dry_run or fileIsExecutable(test.target()) : 158 149 # run test 159 retcode, _ = sh("timeout 60 %s > %s 2>&1" % ( exe_file, out_file), input = in_file)150 retcode, _ = sh("timeout 60 %s > %s 2>&1" % (test.target(), out_file), input = in_file) 160 151 else : 161 152 # simply cat the result into the output 162 retcode, _ = sh("cat %s > %s" % ( exe_file, out_file))153 retcode, _ = sh("cat %s > %s" % (test.target(), out_file)) 163 154 164 155 after = time.time() … … 179 170 else : 180 171 # fetch return code and error from the diff command 181 fixoutput(out_file)182 172 retcode, error = diff(cmp_file, out_file) 183 173 … … 251 241 ################################################################################ 252 242 if __name__ == "__main__": 243 #always run from same folder 244 chdir() 253 245 254 246 # parse the command line arguments
Note:
See TracChangeset
for help on using the changeset viewer.