- Timestamp:
- Aug 19, 2018, 10:21:35 AM (6 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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 90ed538
- Parents:
- 90cac45 (diff), 72a5a75 (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:
-
- 13 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
tests/Makefile.am
r90cac45 r4bd3069 24 24 concurrent= 25 25 26 TEST_PY = python ${ srcdir}/test.py26 TEST_PY = python ${builddir}/test.py 27 27 28 28 # applies to both programs -
tests/Makefile.in
r90cac45 r4bd3069 301 301 quick_test = avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes 302 302 concurrent = 303 TEST_PY = python ${ srcdir}/test.py303 TEST_PY = python ${builddir}/test.py 304 304 305 305 # applies to both programs -
tests/concurrent/examples/boundedBufferEXT.c
r90cac45 r4bd3069 8 8 // Created On : Wed Apr 18 22:52:12 2018 9 9 // Last Modified By : Peter A. Buhr 10 // Last Modified On : Wed May 2 16:12:58201811 // Update Count : 710 // Last Modified On : Thu Aug 16 08:17:03 2018 11 // Update Count : 8 12 12 // 13 13 … … 73 73 void main( Consumer & cons ) with( cons ) { 74 74 sum = 0; 75 for ( ;;) {75 for () { 76 76 yield( random( 5 ) ); 77 77 int item = remove( buffer ); -
tests/concurrent/examples/boundedBufferINT.c
r90cac45 r4bd3069 8 8 // Created On : Mon Oct 30 12:45:13 2017 9 9 // Last Modified By : Peter A. Buhr 10 // Last Modified On : Thu A pr 26 23:08:17201811 // Update Count : 8 210 // Last Modified On : Thu Aug 16 08:17:58 2018 11 // Update Count : 83 12 12 // 13 13 … … 74 74 void main( Consumer & cons ) with( cons ) { 75 75 sum = 0; 76 for ( ;;) {76 for () { 77 77 yield( random( 5 ) ); 78 78 int item = remove( buffer ); -
tests/concurrent/examples/quickSort.c
r90cac45 r4bd3069 9 9 // Created On : Wed Dec 6 12:15:52 2017 10 10 // Last Modified By : Peter A. Buhr 11 // Last Modified On : T ue Jan 30 15:58:58201812 // Update Count : 16 211 // Last Modified On : Thu Aug 16 08:17:41 2018 12 // Update Count : 163 13 13 // 14 14 … … 131 131 132 132 if ( &unsortedfile ) { // generate output ? 133 for ( ;;) {133 for () { 134 134 unsortedfile | size; // read number of elements in the list 135 135 if ( eof( unsortedfile ) ) break; -
tests/config.py.in
r90cac45 r4bd3069 5 5 """ 6 6 7 SRCDIR = "@ srcdir@"8 BUILDDIR = "@ builddir@"7 SRCDIR = "@abs_srcdir@" 8 BUILDDIR = "@abs_builddir@" 9 9 HOSTARCH = "@host_cpu@" -
tests/coroutine/fibonacci.c
r90cac45 r4bd3069 11 11 // Created On : Thu Jun 8 07:29:37 2017 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Fri Apr 27 08:55:31201814 // Update Count : 1913 // Last Modified On : Thu Aug 16 08:18:16 2018 14 // Update Count : 20 15 15 // 16 16 … … 26 26 fn = 1; fn2 = fn1; fn1 = fn; // 2nd case 27 27 suspend(); // restart last resume 28 for ( ;;) {28 for () { 29 29 fn = fn1 + fn2; fn2 = fn1; fn1 = fn; // general case 30 30 suspend(); // restart last resume -
tests/coroutine/fmtLines.c
r90cac45 r4bd3069 10 10 // Created On : Sun Sep 17 21:56:15 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue May 15 12:25:33201813 // Update Count : 4 212 // Last Modified On : Thu Aug 16 08:20:54 2018 13 // Update Count : 45 14 14 // 15 15 … … 23 23 24 24 void main( Format & fmt ) with( fmt ) { 25 for ( ;; ) {// for as many characters26 for ( g = 0; g < 5; g += 1 ) {// groups of 5 blocks27 for ( b = 0; b < 4; b += 1 ) {// blocks of 4 characters28 for ( ;; ) {// for newline characters25 for () { // for as many characters 26 for ( g; 5 ) { // groups of 5 blocks 27 for ( b; 4 ) { // blocks of 4 characters 28 for () { // for newline characters 29 29 suspend(); 30 30 if ( ch != '\n' ) break; // ignore newline … … 53 53 Format fmt; 54 54 55 eof: for ( ;; ) {// read until end of file55 eof: for () { // read until end of file 56 56 sin | fmt.ch; // read one character 57 57 if ( eof( sin ) ) break eof; // eof ? -
tests/coroutine/runningTotal.c
r90cac45 r4bd3069 10 10 // Created On : Wed Dec 6 08:05:27 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 6 08:09:24 201713 // Update Count : 212 // Last Modified On : Thu Aug 16 08:22:29 2018 13 // Update Count : 3 14 14 // 15 15 … … 29 29 30 30 void main( RunTotal & rntl ) with( rntl ) { 31 for ( ;;) {31 for () { 32 32 update( rntl, input ); 33 33 } // for … … 41 41 int main() { 42 42 RunTotal rntl; 43 for ( i nt i = 0; i < 10; i += 1) {43 for ( i; 10 ) { 44 44 sout | i | add( rntl, i ) | endl; 45 45 } // for -
tests/fallthrough.c
r90cac45 r4bd3069 10 10 // Created On : Wed Mar 14 10:06:25 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 14 22:45:13201813 // Update Count : 1 312 // Last Modified On : Thu Aug 16 08:21:46 2018 13 // Update Count : 14 14 14 // 15 15 … … 92 92 choose ( 3 ) { 93 93 case 2: 94 for ( ;;) {94 for () { 95 95 choose ( 2 ) { 96 96 case 1: -
tests/forctrl.c
r90cac45 r4bd3069 10 10 // Created On : Wed Aug 8 18:32:59 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 9 07:50:48201813 // Update Count : 512 // Last Modified On : Thu Aug 16 09:25:47 2018 13 // Update Count : 6 14 14 // 15 15 16 #include <fstream >16 #include <fstream.hfa> 17 17 18 18 struct S { int i, j; }; -
tests/labelledExit.c
r90cac45 r4bd3069 10 10 // Created On : Wed Aug 10 07:29:39 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 10 07:30:15 201613 // Update Count : 112 // Last Modified On : Thu Aug 16 08:55:39 2018 13 // Update Count : 3 14 14 // 15 15 … … 60 60 } 61 61 62 D: for ( ;;) {62 D: for () { 63 63 break D; 64 64 continue D; … … 67 67 Z : i += 1; 68 68 goto Z; 69 X: Y: for ( ;;) {69 X: Y: for () { 70 70 i += 1; 71 71 if ( i > 5 ) continue X; … … 74 74 break; 75 75 } 76 XX: for ( ;;) {77 YY: for ( ;;) {78 ZZ: for ( ;;) {76 XX: for () { 77 YY: for () { 78 ZZ: for () { 79 79 i += 1; 80 80 if ( i > 5 ) continue XX; … … 89 89 } 90 90 91 for ( ;;) ;91 for () ; 92 92 for ( int i = 0 ;; ) ; 93 93 for ( ; i < 0; ) ; … … 97 97 L20: L21: L22: L23: L24: L25: L26: L27: L28: L29: 98 98 L31: L32: L33: L34: 99 for ( ;;) {99 for () { 100 100 break L0; 101 101 } -
tests/pybin/settings.py
r90cac45 r4bd3069 6 6 7 7 try : 8 sys.path.append(os.getcwd()) 8 testpath = os.path.dirname(os.path.abspath(os.path.join(os.getcwd(), sys.argv[0]))) 9 sys.path.append(testpath) 9 10 import config 10 11 11 12 SRCDIR = os.path.abspath(config.SRCDIR) 12 13 BUILDDIR = os.path.abspath(config.BUILDDIR) 14 os.chdir(testpath) 15 13 16 except: 14 17 print('ERROR: missing config.py, re-run configure script.', file=sys.stderr) … … 88 91 self.flags = """INSTALL_FLAGS="%s" """ % ("" if value else "-in-tree") 89 92 93 class Timeouts: 94 def __init__(self, ts, tg): 95 self.single = Timeouts.check(ts) 96 self.total = Timeouts.check(tg) 97 98 @classmethod 99 def check(_, value): 100 if value < 1: 101 print("Timeouts must be at least 1 second", file=sys.stderr) 102 sys.exit(1) 103 104 return value 105 90 106 def init( options ): 91 107 global arch … … 95 111 global debug 96 112 global install 113 global timeout 97 114 98 115 dry_run = options.dry_run … … 102 119 install = Install(options.install) 103 120 arch = Architecture(options.arch) 121 timeout = Timeouts(options.timeout, options.global_timeout) 104 122 105 123 … … 110 128 111 129 def validate(): 112 make_ret, _ = tools.make( ".validate", error_file = ".validate.err", redirects = "2> /dev/null 1> /dev/null", ) 130 errf = os.path.join(BUILDDIR, ".validate.err") 131 make_ret, _ = tools.make( ".validate", error_file = errf, redirects = "2> /dev/null 1> /dev/null", ) 113 132 if make_ret != 0: 114 with open ( ".validate.err", "r") as myfile:133 with open (errf, "r") as myfile: 115 134 error=myfile.read() 116 135 print("ERROR: Invalid configuration %s:%s" % (arch.string, debug.string), file=sys.stderr) 117 136 print(" verify returned : \n%s" % error, file=sys.stderr) 118 tools.rm( "%s/.validate.err" % BUILDDIR)137 tools.rm(errf) 119 138 sys.exit(1) 120 139 121 tools.rm( "%s/.validate.err" % BUILDDIR)140 tools.rm(errf) -
tests/test.py
r90cac45 r4bd3069 88 88 parser.add_argument('--install', help='Run all tests based on installed binaries or tree binaries', type=yes_no, default='no') 89 89 parser.add_argument('--arch', help='Test for specific architecture', type=str, default='') 90 parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=60) 91 parser.add_argument('--global-timeout', help='Maximum cumulative duration in seconds after the ALL tests are considered to have timed out', type=int, default=7200) 90 92 parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true') 91 93 parser.add_argument('--list', help='List all test available', action='store_true') … … 160 162 if settings.dry_run or fileIsExecutable(exe_file) : 161 163 # run test 162 retcode, _ = sh("timeout 60 %s > %s 2>&1" % (exe_file, out_file), input = in_file)164 retcode, _ = sh("timeout %d %s > %s 2>&1" % (settings.timeout.single, exe_file, out_file), input = in_file) 163 165 else : 164 166 # simply cat the result into the output … … 234 236 tests, 235 237 chunksize = 1 236 ).get( 7200)238 ).get(settings.timeout.total) 237 239 except KeyboardInterrupt: 238 240 pool.terminate() … … 283 285 # users may want to simply list the tests 284 286 if options.list_comp : 285 print("-h --help --debug --dry-run --list --arch --all --regenerate-expected - j --jobs ", end='')287 print("-h --help --debug --dry-run --list --arch --all --regenerate-expected --install --timeout --global-timeout -j --jobs ", end='') 286 288 print(" ".join(map(lambda t: "%s" % (t.target()), tests))) 287 289
Note: See TracChangeset
for help on using the changeset viewer.