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