- Timestamp:
- Nov 24, 2021, 9:47:56 PM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 5235d49
- Parents:
- 94647b0b (diff), 3cc1111 (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:
- tests
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/.expect/declarationSpecifier.x64.txt
r94647b0b r7770cc8 1132 1132 char **_X13cfa_args_argvPPc_1; 1133 1133 char **_X13cfa_args_envpPPc_1; 1134 signed int _X17cfa_main_returnedi_1 = ((signed int )0);1134 __attribute__ ((weak)) extern signed int _X17cfa_main_returnedi_1; 1135 1135 signed int main(signed int _X4argci_1, char **_X4argvPPc_1, char **_X4envpPPc_1){ 1136 1136 __attribute__ ((unused)) signed int _X12_retval_maini_1; … … 1149 1149 signed int _tmp_cp_ret6; 1150 1150 signed int _X3reti_2 = (((void)(_tmp_cp_ret6=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret6); 1151 { 1152 ((void)(_X17cfa_main_returnedi_1=((signed int )1))); 1151 if ( ((&_X17cfa_main_returnedi_1)!=((signed int *)0)) ) { 1152 { 1153 ((void)(_X17cfa_main_returnedi_1=((signed int )1))); 1154 } 1155 1153 1156 } 1154 1157 -
tests/.expect/declarationSpecifier.x86.txt
r94647b0b r7770cc8 1132 1132 char **_X13cfa_args_argvPPc_1; 1133 1133 char **_X13cfa_args_envpPPc_1; 1134 signed int _X17cfa_main_returnedi_1 = ((signed int )0);1134 __attribute__ ((weak)) extern signed int _X17cfa_main_returnedi_1; 1135 1135 signed int main(signed int _X4argci_1, char **_X4argvPPc_1, char **_X4envpPPc_1){ 1136 1136 __attribute__ ((unused)) signed int _X12_retval_maini_1; … … 1149 1149 signed int _tmp_cp_ret6; 1150 1150 signed int _X3reti_2 = (((void)(_tmp_cp_ret6=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret6); 1151 { 1152 ((void)(_X17cfa_main_returnedi_1=((signed int )1))); 1151 if ( ((&_X17cfa_main_returnedi_1)!=((signed int *)0)) ) { 1152 { 1153 ((void)(_X17cfa_main_returnedi_1=((signed int )1))); 1154 } 1155 1153 1156 } 1154 1157 -
tests/.expect/gccExtensions.x64.txt
r94647b0b r7770cc8 324 324 char **_X13cfa_args_argvPPc_1; 325 325 char **_X13cfa_args_envpPPc_1; 326 signed int _X17cfa_main_returnedi_1 = ((signed int )0);326 __attribute__ ((weak)) extern signed int _X17cfa_main_returnedi_1; 327 327 signed int main(signed int _X4argci_1, char **_X4argvPPc_1, char **_X4envpPPc_1){ 328 328 __attribute__ ((unused)) signed int _X12_retval_maini_1; … … 341 341 signed int _tmp_cp_ret6; 342 342 signed int _X3reti_2 = (((void)(_tmp_cp_ret6=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret6); 343 { 344 ((void)(_X17cfa_main_returnedi_1=((signed int )1))); 343 if ( ((&_X17cfa_main_returnedi_1)!=((signed int *)0)) ) { 344 { 345 ((void)(_X17cfa_main_returnedi_1=((signed int )1))); 346 } 347 345 348 } 346 349 -
tests/.expect/gccExtensions.x86.txt
r94647b0b r7770cc8 302 302 char **_X13cfa_args_argvPPc_1; 303 303 char **_X13cfa_args_envpPPc_1; 304 signed int _X17cfa_main_returnedi_1 = ((signed int )0);304 __attribute__ ((weak)) extern signed int _X17cfa_main_returnedi_1; 305 305 signed int main(signed int _X4argci_1, char **_X4argvPPc_1, char **_X4envpPPc_1){ 306 306 __attribute__ ((unused)) signed int _X12_retval_maini_1; … … 319 319 signed int _tmp_cp_ret6; 320 320 signed int _X3reti_2 = (((void)(_tmp_cp_ret6=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret6); 321 { 322 ((void)(_X17cfa_main_returnedi_1=((signed int )1))); 321 if ( ((&_X17cfa_main_returnedi_1)!=((signed int *)0)) ) { 322 { 323 ((void)(_X17cfa_main_returnedi_1=((signed int )1))); 324 } 325 323 326 } 324 327 -
tests/concurrent/semaphore.cfa
r94647b0b r7770cc8 2 2 #include <locks.hfa> 3 3 #include <thread.hfa> 4 #include <mutex_stmt.hfa> 4 5 5 6 enum { num_blockers = 17, num_unblockers = 13 }; … … 28 29 thrash(); 29 30 P(ben); 30 if(((thread&)this).seqable.next != 0p) sout | acquire |"Link not invalidated";31 if(((thread&)this).seqable.next != 0p) mutex(sout) sout | "Link not invalidated"; 31 32 thrash(); 32 33 } -
tests/concurrent/sleep.cfa
r94647b0b r7770cc8 1 1 #include <fstream.hfa> 2 2 #include <thread.hfa> 3 #include <mutex_stmt.hfa> 3 4 #include <time.hfa> 4 5 … … 29 30 30 31 int main() { 31 sout | acquire| "start";32 mutex( sout ) sout | "start"; 32 33 { 33 34 slow_sleeper slow; … … 36 37 yield(); 37 38 } 38 sout | acquire| "done";39 mutex( sout ) sout | "done"; 39 40 } 40 41 -
tests/io/io-acquire.cfa
r94647b0b r7770cc8 10 10 // Created On : Mon Mar 1 18:40:09 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Apr 27 11:49:34202113 // Update Count : 1812 // Last Modified On : Wed Oct 6 18:04:58 2021 13 // Update Count : 72 14 14 // 15 15 16 16 #include <fstream.hfa> 17 17 #include <thread.hfa> 18 #include <mutex_stmt.hfa> 18 19 19 20 thread T {}; … … 21 22 // output from parallel threads should not be scrambled 22 23 23 for ( 100 ) { // localprotection24 sout | acquire| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;24 for ( 100 ) { // expression protection 25 mutex(sout) sout | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; 25 26 } 26 { // global protection (RAII) 27 osacquire acq = { sout }; 27 mutex( sout ) { // statement protection 28 28 for ( 100 ) { 29 29 sout | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; … … 31 31 } 32 32 { // duplicate protection demonstrating recursive lock 33 osacquire acq = { sout }; 34 for ( 100 ) { 35 osacquire acq = { sout }; 36 sout | acquire | 1 | 2 | 3 | 4 | 5 | acquire | 6 | 7 | 8 | 9; 37 sout | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; 33 ofstream & h1( ofstream & os ) { // helper 34 mutex( os ) return os | 1 | 2 | 3 | 4; // unnecessary mutex 35 } 36 ofstream & h2( ofstream & os ) { // helper 37 mutex( os ) return os | 6 | 7 | 8 | 9; // unnecessary mutex 38 } 39 mutex( sout ) { // unnecessary mutex 40 for ( 100 ) { 41 mutex( sout ) { 42 sout | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; 43 sout | h1 | 5 | h2; // refactored code 44 } 45 } 38 46 } 39 47 } … … 42 50 43 51 int a, b, c, d, e, f, g, h, i; 44 for ( 100 ) { // localprotection45 sin | acquire| a | b | c | d | e | f | g | h | i;52 for ( 100 ) { // expression protection 53 mutex(sin) sin | a | b | c | d | e | f | g | h | i; 46 54 } 47 { // global protection (RAII) 48 isacquire acq = { sin }; 55 mutex( sin ) { // statement protection 49 56 for ( 100 ) { 50 57 sin | a | b | c | d | e | f | g | h | i; … … 52 59 } 53 60 { // duplicate protection demonstrating recursive lock 54 isacquire acq = { sin }; 55 for ( 100 ) { 56 isacquire acq = { sin }; 57 sin | acquire | a | b | c | d | e | acquire | f | g | h | i; 58 sin | a | b | c | d | e | f | g | h | i; 61 ifstream & h1( ifstream & is ) { // helper 62 mutex( is ) return is | a | b | c | d; // unnecessary mutex 63 } 64 ifstream & h2( ifstream & is ) { // helper 65 mutex( is ) return is | f | g | h | i; // unnecessary mutex 66 } 67 mutex( sin ) { // unnecessary mutex 68 for ( 5 ) { 69 mutex( sin ) { 70 sin | a | b | c | d | e | f | g | h | i; 71 sin | h1 | e | h2; // refactored code 72 } 73 } 59 74 } 60 75 } -
tests/linking/io-acquire.cfa
r94647b0b r7770cc8 17 17 #include <fstream.hfa> 18 18 #include <stdlib.hfa> 19 #include <mutex_stmt.hfa> 19 20 20 21 int main() { 21 22 int i; 22 23 if(threading_enabled()) { 23 stdout | acquire| "YES";24 mutex( stdout ) stdout | "YES"; 24 25 stdin | i; 25 26 } else { 26 stdout | acquire| "NO";27 mutex( stdout ) stdout | "NO"; 27 28 stdin | i; 28 29 } -
tests/pybin/test_run.py
r94647b0b r7770cc8 65 65 def toString( cls, retcode, duration ): 66 66 if settings.generating : 67 if retcode == TestResult.SUCCESS: text = "Done "68 elif retcode == TestResult.TIMEOUT: text = "TIMEOUT"69 else : 67 if retcode == TestResult.SUCCESS: key = 'pass'; text = "Done " 68 elif retcode == TestResult.TIMEOUT: key = 'time'; text = "TIMEOUT" 69 else : key = 'fail'; text = "ERROR code %d" % retcode 70 70 else : 71 if retcode == TestResult.SUCCESS: text = "PASSED "72 elif retcode == TestResult.TIMEOUT: text = "TIMEOUT"73 else : 71 if retcode == TestResult.SUCCESS: key = 'pass'; text = "PASSED " 72 elif retcode == TestResult.TIMEOUT: key = 'time'; text = "TIMEOUT" 73 else : key = 'fail'; text = "FAILED with code %d" % retcode 74 74 75 75 text += " C%s - R%s" % (fmtDur(duration[0]), fmtDur(duration[1])) 76 return text76 return key, text -
tests/test.py
r94647b0b r7770cc8 257 257 258 258 # update output based on current action 259 result_ txt = TestResult.toString( retcode, duration )259 result_key, result_txt = TestResult.toString( retcode, duration ) 260 260 261 261 #print result with error if needed … … 265 265 text = text + '\n' + error 266 266 267 return retcode == TestResult.SUCCESS, text267 return retcode == TestResult.SUCCESS, result_key, text 268 268 except KeyboardInterrupt: 269 return False, ""269 return False, 'keybrd', "" 270 270 # except Exception as ex: 271 271 # print("Unexpected error in worker thread running {}: {}".format(t.target(), ex), file=sys.stderr) … … 283 283 284 284 failed = False 285 rescnts = { 'pass': 0, 'fail': 0, 'time': 0, 'keybrd': 0 } 286 other = 0 285 287 286 288 # for each test to run … … 294 296 ) 295 297 296 for i, (succ, txt) in enumerate(timed(results, timeout = settings.timeout.total), 1) : 298 for i, (succ, code, txt) in enumerate(timed(results, timeout = settings.timeout.total), 1) : 299 if code in rescnts.keys(): 300 rescnts[code] += 1 301 else: 302 other += 1 303 297 304 if not succ : 298 305 failed = True … … 319 326 # clean the workspace 320 327 make('clean', output_file=subprocess.DEVNULL, error=subprocess.DEVNULL) 328 329 print("{} passes, {} failures, {} timeouts, {} cancelled, {} other".format(rescnts['pass'], rescnts['fail'], rescnts['time'], rescnts['keybrd'], other)) 321 330 322 331 return failed … … 443 452 failed = run_tests(local_tests, options.jobs) 444 453 if failed: 445 result = 1446 454 if not settings.continue_: 447 455 break
Note:
See TracChangeset
for help on using the changeset viewer.