- Timestamp:
- May 18, 2018, 3:36:36 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- cac8a6e
- Parents:
- cb6314e (diff), c7d8100c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/SemanticError.cc
rcb6314e r4a333d35 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed May 2 18:13:37201813 // Update Count : 812 // Last Modified On : Wed May 16 15:01:20 2018 13 // Update Count : 9 14 14 // 15 15 … … 70 70 //----------------------------------------------------------------------------- 71 71 // Semantic Error 72 bool SemanticErrorThrow = false; 73 72 74 SemanticErrorException::SemanticErrorException( CodeLocation location, std::string error ) { 73 75 append( location, error ); … … 94 96 95 97 void SemanticError( CodeLocation location, std::string error ) { 98 SemanticErrorThrow = true; 96 99 throw SemanticErrorException(location, error); 97 100 } -
src/Common/SemanticError.h
rcb6314e r4a333d35 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed May 2 18:13:15201813 // Update Count : 2912 // Last Modified On : Wed May 16 15:01:23 2018 13 // Update Count : 30 14 14 // 15 15 … … 21 21 //----------------------------------------------------------------------------- 22 22 // Errors 23 24 extern bool SemanticErrorThrow; 23 25 24 26 __attribute__((noreturn)) void SemanticError( CodeLocation location, std::string error ); -
src/tests/pybin/test_run.py
rcb6314e r4a333d35 4 4 5 5 import pybin.settings 6 import datetime 7 8 from string import Template 9 10 class DeltaTemplate(Template): 11 delimiter = "%" 12 13 def strfdelta(tdelta, fmt): 14 d["H"], rem = divmod(tdelta.seconds, 3600) 15 d["M"], d["S"] = divmod(rem, 60) 16 t = DeltaTemplate(fmt) 17 return t.substitute(**d) 6 18 7 19 # Test class that defines what a test is … … 57 69 58 70 @classmethod 59 def toString( cls, retcode ):71 def toString( cls, retcode, duration ): 60 72 if settings.generating : 61 if retcode == TestResult.SUCCESS: return "Done"62 elif retcode == TestResult.TIMEOUT: return"TIMEOUT"63 else : return"ERROR code %d" % retcode73 if retcode == TestResult.SUCCESS: text = "Done " 74 elif retcode == TestResult.TIMEOUT: text = "TIMEOUT" 75 else : text = "ERROR code %d" % retcode 64 76 else : 65 if retcode == TestResult.SUCCESS: return "PASSED" 66 elif retcode == TestResult.TIMEOUT: return "TIMEOUT" 67 else : return "FAILED with code %d" % retcode 77 if retcode == TestResult.SUCCESS: text = "PASSED " 78 elif retcode == TestResult.TIMEOUT: text = "TIMEOUT" 79 else : text = "FAILED with code %d" % retcode 80 81 text += " C%s - R%s" % (cls.fmtDur(duration[0]), cls.fmtDur(duration[1])) 82 return text 83 84 @classmethod 85 def fmtDur( cls, duration ): 86 if duration : 87 hours, rem = divmod(duration, 3600) 88 minutes, rem = divmod(rem, 60) 89 seconds, millis = divmod(rem, 1) 90 return "%2d:%02d.%03d" % (minutes, seconds, millis * 1000) 91 return " n/a" -
src/tests/test.py
rcb6314e r4a333d35 9 9 import re 10 10 import sys 11 import time 11 12 12 13 ################################################################################ … … 136 137 137 138 # build, skipping to next test on error 139 before = time.time() 138 140 make_ret, _ = make( test.target(), 139 141 redirects = "2> %s 1> /dev/null" % out_file, 140 142 error_file = err_file 141 143 ) 144 after = time.time() 145 146 comp_dur = after - before 147 148 run_dur = None 142 149 143 150 # if the make command succeds continue otherwise skip to diff 144 151 if make_ret == 0 or settings.dry_run: 152 before = time.time() 145 153 if settings.dry_run or fileIsExecutable(test.target()) : 146 154 # run test … … 149 157 # simply cat the result into the output 150 158 retcode, _ = sh("cat %s > %s" % (test.target(), out_file)) 159 160 after = time.time() 161 run_dur = after - before 151 162 else: 152 163 retcode, _ = sh("mv %s %s" % (err_file, out_file)) … … 174 185 sh("rm -f %s > /dev/null 2>&1" % test.target()) 175 186 176 return retcode, error 187 return retcode, error, [comp_dur, run_dur] 177 188 178 189 # run a single test and handle the errors, outputs, printing, exception handling, etc. … … 183 194 name_txt = "%20s " % t.name 184 195 185 retcode, error = run_single_test(t)196 retcode, error, duration = run_single_test(t) 186 197 187 198 # update output based on current action 188 result_txt = TestResult.toString( retcode )199 result_txt = TestResult.toString( retcode, duration ) 189 200 190 201 #print result with error if needed
Note: See TracChangeset
for help on using the changeset viewer.