- Timestamp:
- Jun 28, 2016, 5:29:00 PM (10 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:
- 59f9273, c017d5b, d06010a
- Parents:
- 22cad76 (diff), 472ca32 (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/tests
- Files:
-
- 1 added
- 4 edited
-
Makefile.am (modified) (3 diffs)
-
Makefile.in (modified) (2 diffs)
-
quoted_keyword.c (added)
-
test.py (modified) (5 diffs)
-
typedef.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/tests/Makefile.am
r22cad76 r66999e7 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Mon Jun 2 0 14:30:52201614 ## Update Count : 3 313 ## Last Modified On : Mon Jun 27 14:39:08 2016 14 ## Update Count : 34 15 15 ############################################################################### 16 16 … … 27 27 28 28 all-local : 29 python test.py vector_test avl_test operators numericConstants expression enum asmName array typeof cast29 +python test.py vector_test avl_test operators numericConstants expression enum asmName array typeof cast 30 30 31 31 all-tests : 32 python test.py --all32 +python test.py --all 33 33 34 34 clean-local : … … 36 36 37 37 list : 38 python test.py --list38 +python test.py --list 39 39 40 40 constant0-1DP : constant0-1.c -
src/tests/Makefile.in
r22cad76 r66999e7 634 634 635 635 all-local : 636 python test.py vector_test avl_test operators numericConstants expression enum asmName array typeof cast636 +python test.py vector_test avl_test operators numericConstants expression enum asmName array typeof cast 637 637 638 638 all-tests : 639 python test.py --all639 +python test.py --all 640 640 641 641 clean-local : … … 643 643 644 644 list : 645 python test.py --list645 +python test.py --list 646 646 647 647 constant0-1DP : constant0-1.c -
src/tests/test.py
r22cad76 r66999e7 21 21 return list 22 22 23 def sh(cmd, dry_run ):23 def sh(cmd, dry_run = False, print2stdout = True): 24 24 if dry_run : 25 25 print("cmd: %s" % cmd) 26 return 0 26 return 0, None 27 27 else : 28 proc = Popen(cmd, std err=STDOUT, shell=True)29 proc.communicate()30 return proc.returncode 28 proc = Popen(cmd, stdout=None if print2stdout else PIPE, stderr=STDOUT, shell=True) 29 out, err = proc.communicate() 30 return proc.returncode, out 31 31 32 32 def file_replace(fname, pat, s_after): … … 61 61 62 62 # build, skipping to next test on error 63 make_ret = sh("%s %s 2> %s 1> /dev/null" % (make_cmd, test, out_file), dry_run)63 make_ret, _ = sh("%s %s 2> %s 1> /dev/null" % (make_cmd, test, out_file), dry_run) 64 64 65 65 if make_ret == 0 : … … 71 71 72 72 retcode = 0 73 error = None 73 74 74 75 fix_MakeLevel(out_file) … … 76 77 if not generate : 77 78 # diff the output of the files 78 retcode = sh("diff .expect/%s.txt .out/%s.log" % (test, test), dry_run) 79 diff_cmd = ("diff --old-group-format='\t\tmissing lines :\n" 80 "%%<' \\\n" 81 "--new-group-format='\t\tnew lines :\n" 82 "%%>' \\\n" 83 "--unchanged-group-format='%%=' \\" 84 "--changed-group-format='\t\texpected :\n" 85 "%%<\n" 86 "\t\tgot :\n" 87 "%%>' \\\n" 88 "--new-line-format='\t\t%%dn\t%%L' \\\n" 89 "--old-line-format='\t\t%%dn\t%%L' \\\n" 90 "--unchanged-line-format='' \\\n" 91 ".expect/%s.txt .out/%s.log") 92 93 retcode, error = sh(diff_cmd % (test, test), dry_run, False) 79 94 80 95 # clean the executable 81 96 sh("rm -f %s > /dev/null 2>&1" % test, dry_run) 82 97 83 return retcode 98 return retcode, error 84 99 85 100 def run_tests(tests, generate, dry_run) : … … 94 109 print("%20s " % t, end="") 95 110 sys.stdout.flush() 96 test_failed = run_test_instance(t, generate, dry_run)111 test_failed, error = run_test_instance(t, generate, dry_run) 97 112 failed = test_failed or failed 98 113 99 114 if not generate : 100 115 print("FAILED" if test_failed else "PASSED") 116 if error : 117 print(error) 101 118 else : 102 119 print( "Done" ) -
src/tests/typedef.c
r22cad76 r66999e7 2 2 3 3 void f( void ) { 4 int T( T );4 int T( T p ) { return 3; } 5 5 T( 3 ); 6 6 } … … 38 38 typedef [ int, int ] tupleType; 39 39 typedef * [ int, int ] tupleTypePtr; 40 typedef * int a, b;40 typedef * int c, d; 41 41 typedef [ int ] f( * int ), g; 42 42 typedef [ * [static 10] int ] t; 43 typedef [ * [static 10] int x ] f();43 typedef [ * [static 10] int x ] h(); 44 44 45 45 // Local Variables: //
Note:
See TracChangeset
for help on using the changeset viewer.