Changes in / [9724df0:1f17e07]
- Files:
-
- 15 added
- 1 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
r9724df0 r1f17e07 5 5 //=========================================================================================================== 6 6 //Compilation script is done here but environnement set-up and error handling is done in main loop 7 def cfa_build( ) {7 def cfa_build(boolean full_build) { 8 8 build_stage 'Checkout' 9 9 def install_dir = pwd tmp: true … … 28 28 //Run the tests from the example directory 29 29 dir ('src/tests') { 30 sh './runTests.sh' 30 if (full_build) { 31 sh 'python test.py --all' 32 } 33 else { 34 sh './runTests.sh' 35 } 31 36 } 32 37 -
src/tests/.expect/abs.txt
r9724df0 r1f17e07 1 /usr/local/bin/cfa -g -Wall -Wno-unused-function abs.c -o abs2 CFA Version 1.0.0 (debug)3 1 char ¿ abs A 4 2 signed int -65 abs 65 -
src/tests/.expect/minmax.txt
r9724df0 r1f17e07 1 char z a min a 2 signed int 4 3 min 3 3 unsigned int 4 3 min 3 4 signed long int 4 3 min 3 5 unsigned long int 4 3 min 3 6 signed long long int 4 3 min 3 7 unsigned long long int 4 3 min 3 8 float 4 3.1 min 3.1 9 double 4 3.1 min 3.1 10 long double 4 3.1 min 3.1 11 12 char z a max z 13 signed int 4 3 max 4 14 unsigned int 4 3 max 4 15 signed long int 4 3 max 4 16 unsigned long int 4 3 max 4 17 signed long long int 4 3 max 4 18 unsigned long long int 4 3 max 4 19 float 4 3.1 max 4 20 double 4 3.1 max 4 21 long double 4 3.1 max 4 -
src/tests/Context.c
r9724df0 r1f17e07 1 1 //cforall context declaration 2 context has_q( otype T ) {2 trait has_q( otype T ) { 3 3 T q( T ); 4 4 }; -
src/tests/Forall.c
r9724df0 r1f17e07 10 10 void f( int ); 11 11 void h( void (*p)(void) ); 12 12 13 13 int x; 14 14 void (*y)(void); 15 15 char z; 16 16 float w; 17 17 18 18 f( x ); 19 19 f( y ); … … 26 26 forall( otype T ) void f( T, T ); 27 27 forall( otype T, otype U ) void f( T, U ); 28 28 29 29 int x; 30 30 float y; 31 31 int *z; 32 32 float *w; 33 33 34 34 f( x, y ); 35 35 f( z, w ); … … 46 46 } 47 47 48 context sumable( otype T ) {48 trait sumable( otype T ) { 49 49 const T 0; 50 50 T ?+?(T, T); -
src/tests/Operators.c
r9724df0 r1f17e07 1 int ?*?( int, int ); 1 int ?*?( int a, int b ) { 2 return 0; 3 } 2 4 3 5 int ?()( int number1, int number2 ) { … … 5 7 } 6 8 7 int ?+?( int, int ); 9 int ?+?( int a, int b ) { 10 return 0; 11 } 8 12 9 int ?=?( int *, int ); 13 int ?=?( int *a, int b ) { 14 return 0; 15 } 10 16 struct accumulator { 11 17 int total; 12 18 }; 13 19 14 char ?()( struct accumulator a, char number1, char number2 ); 20 char ?()( struct accumulator a, char number1, char number2 ) { 21 return 'a'; 22 } 15 23 16 24 void f( void ) { … … 23 31 } 24 32 33 int main(int argc, char const *argv[]) { 34 /* code */ 35 return 0; 36 } 37 25 38 // Local Variables: // 26 39 // tab-width: 4 // -
src/tests/Scope.c
r9724df0 r1f17e07 15 15 y p; 16 16 17 context has_u( otype z ) {17 trait has_u( otype z ) { 18 18 z u(z); 19 19 }; -
src/tests/Subrange.c
r9724df0 r1f17e07 1 1 // A small context defining the notion of an ordered otype. (The standard 2 2 // library should probably contain a context for this purpose.) 3 context ordered(otype T) {3 trait ordered(otype T) { 4 4 int ?<?(T, T), ?<=?(T, T); 5 5 }; -
src/tests/Switch.c
r9724df0 r1f17e07 1 int fred() {1 int main(int argc, char const *argv[]) { 2 2 int i; 3 3 switch ( i ) case 3 : i = 1; -
src/tests/Typedef.c
r9724df0 r1f17e07 18 18 a c; 19 19 20 typedef otypeof(3) x, y; // GCC20 typedef typeof(3) x, y; // GCC 21 21 22 22 x p; … … 24 24 25 25 int main() { 26 typedef otypeof(3) z, p;26 typedef typeof(3) z, p; 27 27 z w; 28 28 p x; -
src/tests/limits.c
r9724df0 r1f17e07 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // limits.c -- 7 // limits.c -- 8 8 // 9 9 // Author : Peter A. Buhr … … 12 12 // Last Modified On : Tue May 10 20:45:28 2016 13 13 // Update Count : 1 14 // 14 // 15 15 16 16 #include <limits> … … 109 109 long _Complex _1_sqrt_2 = _1_SQRT_2; 110 110 111 int main(int argc, char const *argv[]) { 112 //DUMMY 113 return 0; 114 } 115 111 116 // Local Variables: // 112 117 // tab-width: 4 // -
src/tests/test.py
r9724df0 r1f17e07 3 3 4 4 from os import listdir 5 from os.path import isfile, join 5 from os.path import isfile, join, splitext 6 6 from subprocess import Popen, PIPE, STDOUT 7 7 … … 13 13 ################################################################################ 14 14 def listTests(): 15 list = [f.rstrip('.c') for f in listdir('.') 16 if not f.startswith('.') and ( 17 not isfile(f) or f.endswith('.c') 18 )] 15 list = [splitext(f)[0] for f in listdir('./.expect') 16 if not f.startswith('.') and f.endswith('.txt') 17 ] 19 18 20 19 return list … … 40 39 41 40 # build, skipping to next test on error 42 make_ret = sh("make -j 8 %s > %s 2>&1" % (test, out_file), dry_run)41 make_ret = sh("make -j 8 %s 2> %s 1> /dev/null" % (test, out_file), dry_run) 43 42 44 43 if make_ret == 0 : … … 51 50 retcode = 0 52 51 if not generate : 53 # touch expected files so empty output are supported by default54 sh("touch .expect/%s.txt" % test, dry_run)55 56 52 # diff the output of the files 57 53 retcode = sh("diff .expect/%s.txt .out/%s.log" % (test, test), dry_run) … … 67 63 68 64 if generate : 69 print( "Regenerate tests for: ", end="" ) 70 print( ", ".join( tests ) ) 65 print( "Regenerate tests for: " ) 71 66 72 67 failed = False; 73 68 for t in tests: 74 if not generate : 75 print("%20s " % t, end="") 69 print("%20s " % t, end="") 76 70 sys.stdout.flush() 77 71 test_failed = run_test_instance(t, generate, dry_run) … … 80 74 if not generate : 81 75 print("FAILED" if test_failed else "PASSED") 76 else : 77 print( "Done" ) 82 78 83 79 sh('make clean > /dev/null 2>&1', dry_run) 84 85 if generate :86 print( "Done" )87 80 88 81 return 0 if failed else 1 … … 93 86 parser = argparse.ArgumentParser(description='Script which runs cforall tests') 94 87 parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true') 88 parser.add_argument('--list', help='List all test available', action='store_true') 95 89 parser.add_argument('--all', help='Run all test available', action='store_true') 96 parser.add_argument('-- generate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true')90 parser.add_argument('--regenerate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true') 97 91 parser.add_argument('tests', metavar='test', type=str, nargs='*', help='a list of tests to run') 98 92 99 93 options = parser.parse_args() 100 94 101 if len(options.tests) > 0 and options.all : 95 if (len(options.tests) > 0 and options.all and not options.list) \ 96 or (len(options.tests) == 0 and not options.all and not options.list) : 102 97 print('ERROR: must have option \'--all\' or non-empty test list', file=sys.stderr) 103 98 parser.print_help() 104 99 sys.exit(1) 105 100 106 tests = listTests() if options.all else options.tests 101 allTests = listTests() 107 102 108 sys.exit( run_tests(tests, options.generate_expected, options.dry_run) ) 103 if options.all or options.list : 104 tests = allTests 105 106 else : 107 tests = [] 108 for test in options.tests: 109 if test in allTests : 110 tests.append(test) 111 else : 112 print('ERROR: No expected file for test %s, ignoring it' % test, file=sys.stderr) 113 114 if len(tests) == 0 : 115 print('ERROR: No valid test to run', file=sys.stderr) 116 sys.exit(1) 117 118 if options.list : 119 print("\n".join(tests)) 120 121 else : 122 sys.exit( run_tests(tests, options.regenerate_expected, options.dry_run) )
Note: See TracChangeset
for help on using the changeset viewer.