Changeset 903
- Timestamp:
- 12/29/19 16:07:19 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tester/tester.py
r854 r903 1 1 import os, os.path, sys, platform, re, copy 2 import traceback # for custom printing of exception trace/stack 2 3 import errno # for delete_file_if_present() 3 4 import argparse … … 150 151 exename[0] = re.sub(rule[0], rule[1], exename[0]) 151 152 return exename 153 154 155 def print_exception(): 156 print("\n"+("-"*60),'begin exception') 157 traceback.print_exc() 158 print("-"*60,'end exception') 152 159 153 160 … … 235 242 if is_test_active(): 236 243 print("\t", command, '"%s"' % line[1], end=" ") 237 contents = [] 238 with open(os.path.join(globals.FILESDIR, line[1]), 'r') as main_test_filename: 239 for line in main_test_filename: 240 contents.append(globals.stripEOL(line)) 241 ok = compare(contents, outfile, '_file') 244 try: 245 contents = [] 246 with open(os.path.join(globals.FILESDIR, line[1]), 'r') as main_test_filename: 247 for line in main_test_filename: 248 contents.append(globals.stripEOL(line)) 249 ok = compare(contents, outfile, '_file') 250 except Exception as e: # could also 'raise' for some types of exceptions if we wanted 251 print_exception() 252 ok = 0 242 253 tests_failed += int(not ok) 243 254 tests_total += 1 … … 245 256 if is_test_active(): 246 257 print("\t", command, end=" ") 247 ok = test(args, test_name, input_text, output_net, output_msg, exe_prog, exeargs) 258 try: 259 ok = test(args, test_name, input_text, output_net, output_msg, exe_prog, exeargs) 260 except Exception as e: # could also 'raise' for some types of exceptions if we wanted 261 print_exception() 262 ok = 0 248 263 tests_failed += int(not ok) 249 264 tests_total += 1
Note: See TracChangeset
for help on using the changeset viewer.