Changeset 987 for tester/tester.py
- Timestamp:
- 07/08/20 23:35:17 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified tester/tester.py ¶
r985 r987 15 15 # if 'cyg' in a or 'cyg' in b: #...that contain 'cyg' and therefore may be useful for detecting that we are running under cygwin 16 16 # print(a,b) 17 CYGWIN=' cygwin' in os.environ['HOME']17 CYGWIN='HOME' in os.environ and 'cygwin' in os.environ['HOME'] 18 18 if CYGWIN: 19 19 os.linesep='\n' #fix wrong value (suitable for Windows) … … 84 84 85 85 def compare(jest, goal, was_compared_to): 86 p= comparison.Comparison(jest, goal)87 if p.ok:86 compare = comparison.Comparison(jest, goal) 87 if compare.equal: 88 88 print("\r", globals.ANSI_SETGREEN + " ok" + globals.ANSI_RESET) 89 89 else: 90 90 print("\r", globals.ANSI_SETRED + " FAIL\7" + globals.ANSI_RESET) 91 print(p.result) 92 f = open(os.path.join(globals.THISDIR, '_last_failed' + was_compared_to + '.output'), 'w') # files are easier to compare than stdout 91 print(compare.result) 92 failed_result_filename = compare.list2_file + was_compared_to 93 if failed_result_filename == '': 94 failed_result_filename = '_test' 95 f = open(os.path.join(globals.THISDIR, failed_result_filename + '.Failed-output'), 'w') # files are easier to compare than stdout 93 96 print('\n'.join(jest), end="", file=f) 94 f = open(os.path.join(globals.THISDIR, '_last_failed' + was_compared_to + '.goal'), 'w') # files are easier to compare than stdout97 f = open(os.path.join(globals.THISDIR, failed_result_filename + '.Failed-goal'), 'w') # files are easier to compare than stdout 95 98 print('\n'.join(goal), end="", file=f) 96 return p.ok99 return compare.equal 97 100 98 101 … … 264 267 for line in main_test_filename: 265 268 contents.append(globals.stripEOL(line)) 266 ok = compare(contents, outfile, '_file') 269 ok = compare(contents, outfile, '_file') # +line[1] 267 270 except Exception as e: # could also 'raise' for some types of exceptions if we wanted 268 271 print_exception()
Note: See TracChangeset
for help on using the changeset viewer.