- Timestamp:
- Jun 30, 2016, 10:58:22 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- ca35c51, f80e0218
- Parents:
- 177a5ce
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/test.py
r177a5ce r84d4d6f 49 49 file_replace(file, "make\[%i\]" % int(environ.get('MAKELEVEL')), 'make' ) 50 50 51 def fileContainsOnly(file, text) : 52 with open(file) as f: 53 ff = f.read().strip() 54 result = ff == text.strip() 55 # 56 # print("Comparing :\n\t'%s'\nWith:\n\t'%s'" % (ff, text)) 57 # print("Result is : \n\t", end="") 58 # print(result) 59 60 return result; 61 51 62 52 63 ################################################################################ … … 75 86 fix_MakeLevel(out_file) 76 87 77 if not generate : 88 if generate : 89 if not dry_run and fileContainsOnly(out_file, "make: *** No rule to make target `%s'. Stop." % test) : 90 retcode = 1; 91 error = "\t\tNo make target for test %s!" % test 92 sh("rm %s" % out_file, False) 93 94 else : 78 95 # diff the output of the files 79 96 diff_cmd = ("diff --old-group-format='\t\tmissing lines :\n" … … 112 129 failed = test_failed or failed 113 130 114 if not generate : 115 print("FAILED" if test_failed else "PASSED") 116 if error : 117 print(error) 131 if generate : 132 failed_txt = "ERROR" 133 success_txt = "Done" 118 134 else : 119 print( "Done" ) 135 failed_txt = "FAILED" 136 success_txt = "PASSED" 137 138 print(failed_txt if test_failed else success_txt) 139 if error : 140 print(error, file=sys.stderr) 120 141 121 142 sh("%s clean > /dev/null 2>&1" % make_cmd, dry_run)
Note: See TracChangeset
for help on using the changeset viewer.