Changes in / [b2b039d:f6d4204]
- Files:
-
- 1 added
- 24 deleted
- 23 edited
-
Jenkinsfile (modified) (7 diffs)
-
doc/refrat/Makefile (modified) (1 diff)
-
doc/user/Makefile (modified) (1 diff)
-
src/examples/poly-bench.c (deleted)
-
src/tests/.expect/Array.txt (deleted)
-
src/tests/.expect/AsmName.txt (deleted)
-
src/tests/.expect/Cast.txt (deleted)
-
src/tests/.expect/CastError.txt (deleted)
-
src/tests/.expect/Constant0-1.txt (deleted)
-
src/tests/.expect/Constant0-1DP.txt (deleted)
-
src/tests/.expect/Constant0-1ND.txt (deleted)
-
src/tests/.expect/Constant0-1NDDP.txt (deleted)
-
src/tests/.expect/DeclarationErrors.txt (deleted)
-
src/tests/.expect/DeclarationSpecifier.txt (deleted)
-
src/tests/.expect/Enum.txt (deleted)
-
src/tests/.expect/Expression.txt (deleted)
-
src/tests/.expect/NumericConstants.txt (deleted)
-
src/tests/.expect/Operators.txt (deleted)
-
src/tests/.expect/ScopeErrors.txt (deleted)
-
src/tests/.expect/Switch.txt (deleted)
-
src/tests/.expect/Typeof.txt (deleted)
-
src/tests/.expect/VariableDeclarator.txt (deleted)
-
src/tests/.expect/abs.txt (modified) (1 diff)
-
src/tests/.expect/ato.txt (deleted)
-
src/tests/.expect/io.txt (deleted)
-
src/tests/.expect/limits.txt (deleted)
-
src/tests/.expect/math.txt (deleted)
-
src/tests/.expect/minmax.txt (modified) (1 diff)
-
src/tests/.expect/swap.txt (deleted)
-
src/tests/Cast.c (modified) (1 diff)
-
src/tests/CommentMisc.c (modified) (1 diff)
-
src/tests/Constant0-1.c (modified) (4 diffs)
-
src/tests/Context.c (modified) (1 diff)
-
src/tests/Exception.c (modified) (1 diff)
-
src/tests/Expression.c (modified) (3 diffs)
-
src/tests/Forall.c (modified) (3 diffs)
-
src/tests/Makefile.am (modified) (2 diffs)
-
src/tests/Makefile.in (modified) (1 diff)
-
src/tests/Operators.c (modified) (3 diffs)
-
src/tests/Scope.c (modified) (1 diff)
-
src/tests/Subrange.c (modified) (1 diff)
-
src/tests/Switch.c (modified) (1 diff)
-
src/tests/Typedef.c (modified) (2 diffs)
-
src/tests/Typeof.c (modified) (1 diff)
-
src/tests/limits.c (modified) (3 diffs)
-
src/tests/poly-bench.c (added)
-
src/tests/runTests.sh (modified) (1 diff)
-
src/tests/test.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
rb2b039d rf6d4204 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( boolean full_build) {7 def cfa_build() { 8 8 build_stage 'Checkout' 9 9 def install_dir = pwd tmp: true 10 10 //checkout the source code and clean the repo 11 11 checkout scm 12 13 //Clean all temporary files to make sure no artifacts of the previous build remain14 12 sh 'git clean -fdqx' 15 16 //Reset the git repo so no local changes persist17 13 sh 'git reset --hard' 18 14 … … 30 26 build_stage 'Test' 31 27 32 //Run the tests from the testsdirectory28 //Run the tests from the example directory 33 29 dir ('src/tests') { 34 if (full_build) { 35 sh 'python test.py --all' 36 } 37 else { 38 sh './runTests.sh' 39 } 30 sh './runTests.sh' 40 31 } 41 32 … … 44 35 //do a maintainer-clean to make sure we need to remake from scratch 45 36 sh 'make maintainer-clean > /dev/null' 46 }47 48 def make_doc() {49 def err = null50 51 try {52 sh 'make clean > /dev/null'53 sh 'make > /dev/null 2>&1'54 }55 56 catch (Exception caughtError) {57 //rethrow error later58 err = caughtError59 60 sh 'cat *.log'61 }62 63 finally {64 /* Must re-throw exception to propagate error */65 if (err) {66 throw err67 }68 }69 }70 71 def doc_build() {72 stage 'Documentation'73 74 status_prefix = 'Documentation'75 76 dir ('doc/user') {77 make_doc()78 }79 80 dir ('doc/refrat') {81 make_doc()82 }83 37 } 84 38 … … 163 117 try { 164 118 //Prevent the build from exceeding 30 minutes 165 timeout( 60) {119 timeout(30) { 166 120 167 121 //Wrap build to add timestamp to command line … … 186 140 //Compile using gcc-4.9 187 141 currentCC = new CC_Desc('gcc-4.9', 'g++-4.9', 'gcc-4.9') 188 cfa_build( doPromoteBuild2DoLang)142 cfa_build() 189 143 190 144 //Compile using gcc-5 191 145 currentCC = new CC_Desc('gcc-5', 'g++-5', 'gcc-5') 192 cfa_build( doPromoteBuild2DoLang)146 cfa_build() 193 147 194 148 //Compile using gcc-4.9 195 149 currentCC = new CC_Desc('gcc-6', 'g++-6', 'gcc-6') 196 cfa_build(doPromoteBuild2DoLang) 197 198 //Compile latex documentation 199 doc_build() 150 cfa_build() 200 151 201 152 if( doPromoteBuild2DoLang ) { … … 234 185 //=========================================================================================================== 235 186 def notify_result(boolean promote, Exception err, String status, boolean log) { 236 echo 'Build completed, sending result notification'237 187 if(promote) { 238 188 if( err ) { … … 274 224 def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase() 275 225 276 def gitLog = 'Error retrieving git logs' 277 def gitDiff = 'Error retrieving git diff' 278 279 try { 280 281 sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG" 282 gitLog = readFile('GIT_LOG') 283 284 sh "git diff --stat ${gitRefNewValue} ${gitRefOldValue} > GIT_DIFF" 285 gitDiff = readFile('GIT_DIFF') 286 } 287 catch (Exception error) {} 226 sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG" 227 def gitLog = readFile('GIT_LOG') 228 229 sh "git diff --stat ${gitRefNewValue} ${gitRefOldValue} > GIT_DIFF" 230 def gitDiff = readFile('GIT_DIFF') 288 231 289 232 def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${status}] - branch ${env.BRANCH_NAME}" -
doc/refrat/Makefile
rb2b039d rf6d4204 2 2 3 3 TeXLIB = .:../LaTeXmacros:../LaTeXmacros/listings:../LaTeXmacros/enumitem:../bibliography/: 4 LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex -halt-on-error4 LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex 5 5 BibTeX = BIBINPUTS=${TeXLIB} && export BIBINPUTS && bibtex 6 6 -
doc/user/Makefile
rb2b039d rf6d4204 2 2 3 3 TeXLIB = .:../LaTeXmacros:../LaTeXmacros/listings:../LaTeXmacros/enumitem:../bibliography/: 4 LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex -halt-on-error4 LaTeX = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex 5 5 BibTeX = BIBINPUTS=${TeXLIB} && export BIBINPUTS && bibtex 6 6 -
src/tests/.expect/abs.txt
rb2b039d rf6d4204 1 /usr/local/bin/cfa -g -Wall -Wno-unused-function abs.c -o abs 2 CFA Version 1.0.0 (debug) 1 3 char ¿ abs A 2 4 signed int -65 abs 65 -
src/tests/.expect/minmax.txt
rb2b039d rf6d4204 1 char z a min a2 signed int 4 3 min 33 unsigned int 4 3 min 34 signed long int 4 3 min 35 unsigned long int 4 3 min 36 signed long long int 4 3 min 37 unsigned long long int 4 3 min 38 float 4 3.1 min 3.19 double 4 3.1 min 3.110 long double 4 3.1 min 3.111 12 char z a max z13 signed int 4 3 max 414 unsigned int 4 3 max 415 signed long int 4 3 max 416 unsigned long int 4 3 max 417 signed long long int 4 3 max 418 unsigned long long int 4 3 max 419 float 4 3.1 max 420 double 4 3.1 max 421 long double 4 3.1 max 4 -
src/tests/Cast.c
rb2b039d rf6d4204 9 9 (int)f; 10 10 (void(*)())f; 11 //([long, long double, *[]()])([f, f, f]);11 ([long, long double, *[]()])([f, f, f]); 12 12 } 13 13 -
src/tests/CommentMisc.c
rb2b039d rf6d4204 1 /* single line */ 2 // single line 3 4 // single line containing */ 5 // single line containing /* 6 // single line containing /* */ 7 8 /* 1st */ int i; 9 int i; /* 2nd */ 10 /* 1st */ int i; /* 2nd */ 11 /* 1st */ /* 2nd */ 12 13 /* 1st 14 2nd */ int i; 15 16 /* 17 */ 18 19 /* 20 21 */ 22 23 /* 24 1st 25 */ 26 27 /* 28 1st 29 2nd 30 */ 31 32 // ignore preprocessor directives 33 34 #line 2 35 # 36 #include <fred> 37 #define mary abc 38 1 39 // alternative ANSI99 brackets 2 40 -
src/tests/Constant0-1.c
rb2b039d rf6d4204 1 // Constant test declaration 1 //Constant test declaration 2 // Cforall extension 2 3 3 4 // value … … 5 6 int 0; 6 7 const int 0; 8 static const int 0; 7 9 int 1; 8 10 const int 1; 11 static const int 1; 12 int 0, 1; 13 const int 0, 1; 14 int (0), (1); 15 int ((0)), ((1)); 16 static const int 0, 1; 9 17 struct { int i; } 0; 10 18 const struct { int i; } 1; 11 12 #ifdef DUPS 13 14 int 0; 15 const int 0; 16 int 1; 17 const int 1; 18 int (0), (1); 19 int ((0)), ((1)); 20 const int 0, 1; 21 const int (0), (1); 22 struct { int i; } 0; 23 const struct { int i; } 1; 24 25 #endif // DUPS 26 27 #ifndef NEWDECL 19 static const struct { int i; } 1; 28 20 29 21 // pointer 30 31 int *0, *1;32 int * const (0), * const 1;33 struct { int i; } *0;34 const struct { int i; } *0;35 int (*(* const x)), **0;36 37 #ifdef DUPS38 22 39 23 int *0, *1; … … 44 28 int (* const 0), (* const 1); 45 29 int ((* const 0)), ((* const 1)); 46 int (*(* const x)), *(*0);47 int (*(* const x)), (*(*0));48 30 struct { int i; } *0; 49 const struct { int i; } *0;50 int (*(* const x)), **0;51 52 #endif // DUPS53 54 #else55 31 56 32 // Cforall style … … 58 34 * int x, 0; 59 35 const * int x, 0; 36 static const * int x, 0; 60 37 * struct { int i; } 0; 61 38 const * struct { int i; } 0; 39 static const * struct { int i; } 0; 40 static * int x, 0; 41 static const * int x, 0; 62 42 const * * int x, 0; 63 43 64 #ifdef DUPS65 66 * int x, 0;67 const * int x, 0;68 69 #endif // DUPS70 71 #endif // NEWDECL72 73 44 int main() { 74 #ifndef NEWDECL75 45 int 1, * 0; 76 #else77 46 * int x, 0; 78 #endif // NEWDECL79 47 } -
src/tests/Context.c
rb2b039d rf6d4204 1 // trait declaration 2 3 trait has_q( otype T ) { 1 //cforall context declaration 2 context has_q( otype T ) { 4 3 T q( T ); 5 4 }; 6 5 7 6 forall( otype z | has_q( z ) ) void f() { 8 trait has_r( otype T, otype U ) {7 context has_r( otype T, otype U ) { 9 8 T r( T, T (T,U) ); 10 9 }; -
src/tests/Exception.c
rb2b039d rf6d4204 10 10 try { 11 11 x/4; 12 } catch( int ) {12 } catch( int) { 13 13 } catch( int x ) { 14 14 } catch( struct { int i; } ) { -
src/tests/Expression.c
rb2b039d rf6d4204 1 int main() {2 struct s { int i; } x, *p = &x;3 int i = 3;1 int fred() { 2 struct s { int i; } *p; 3 int i; 4 4 5 // order of evaluation (GCC is different) 6 /* 7 i = sizeof( (int) {3} ); 8 i = sizeof (int) {3}; 9 */ 5 10 // operators 6 11 … … 37 42 i||i; 38 43 p->i; 44 i+=i; 45 i-=i; 39 46 i*=i; 40 47 i/=i; 41 48 i%=i; 42 i+=i;43 i-=i;44 49 i&=i; 45 50 i|=i; … … 49 54 50 55 i?i:i; 51 } // main 56 57 // cast 58 /* 59 double d; 60 int *ip; 61 (int *) i; 62 (* int) i; 63 ([char, int *])[d, d]; 64 [i,ip,ip] = ([int, * int, int *])[1,(void *)2,(void *)3]; 65 [i,ip,ip] = ([int, * int, int *])([1,(void *)2,(void *)3]); 66 */ 67 } 68 69 //Dummy main 70 int main(int argc, char const *argv[]) 71 { 72 return 0; 73 } -
src/tests/Forall.c
rb2b039d rf6d4204 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 trait sumable( otype T ) {48 context sumable( otype T ) { 49 49 const T 0; 50 50 T ?+?(T, T); -
src/tests/Makefile.am
rb2b039d rf6d4204 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Mon J un 20 14:30:52 201614 ## Update Count : 3313 ## Last Modified On : Mon Jan 25 22:31:42 2016 14 ## Update Count : 25 15 15 ############################################################################### 16 16 … … 23 23 vector_test_SOURCES = vector/vector_int.c vector/array.c vector/vector_test.c 24 24 avl_test_SOURCES = avltree/avl_test.c avltree/avl0.c avltree/avl1.c avltree/avl2.c avltree/avl3.c avltree/avl4.c avltree/avl-private.c 25 26 Constant0-1DP : Constant0-1.c27 ${CC} ${CFLAGS} -DDUPS ${<} -o ${@}28 29 Constant0-1ND : Constant0-1.c30 ${CC} ${CFLAGS} -DNEWDECL ${<} -o ${@}31 32 Constant0-1NDDP : Constant0-1.c33 ${CC} ${CFLAGS} -DNEWDECL -DDUPS ${<} -o ${@} -
src/tests/Makefile.in
rb2b039d rf6d4204 621 621 622 622 623 Constant0-1DP : Constant0-1.c624 ${CC} ${CFLAGS} -DDUPS ${<} -o ${@}625 626 Constant0-1ND : Constant0-1.c627 ${CC} ${CFLAGS} -DNEWDECL ${<} -o ${@}628 629 Constant0-1NDDP : Constant0-1.c630 ${CC} ${CFLAGS} -DNEWDECL -DDUPS ${<} -o ${@}631 632 623 # Tell versions [3.59,3.63) of GNU make to not export all variables. 633 624 # Otherwise a system limit (for SysV at least) may be exceeded. -
src/tests/Operators.c
rb2b039d rf6d4204 1 int ?*?( int a, int b ) { 2 return 0; 3 } 1 int ?*?( int, int ); 4 2 5 3 int ?()( int number1, int number2 ) { … … 7 5 } 8 6 9 int ?+?( int a, int b ) { 10 return 0; 11 } 7 int ?+?( int, int ); 12 8 13 int ?=?( int *a, int b ) { 14 return 0; 15 } 9 int ?=?( int *, int ); 16 10 struct accumulator { 17 11 int total; 18 12 }; 19 13 20 char ?()( struct accumulator a, char number1, char number2 ) { 21 return 'a'; 22 } 14 char ?()( struct accumulator a, char number1, char number2 ); 23 15 24 16 void f( void ) { … … 31 23 } 32 24 33 int main(int argc, char const *argv[]) {34 /* code */35 return 0;36 }37 38 25 // Local Variables: // 39 26 // tab-width: 4 // -
src/tests/Scope.c
rb2b039d rf6d4204 15 15 y p; 16 16 17 trait has_u( otype z ) {17 context has_u( otype z ) { 18 18 z u(z); 19 19 }; -
src/tests/Subrange.c
rb2b039d rf6d4204 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 trait ordered(otype T) {3 context ordered(otype T) { 4 4 int ?<?(T, T), ?<=?(T, T); 5 5 }; -
src/tests/Switch.c
rb2b039d rf6d4204 1 int main(int argc, char const *argv[]) {1 int fred() { 2 2 int i; 3 3 switch ( i ) case 3 : i = 1; -
src/tests/Typedef.c
rb2b039d rf6d4204 18 18 a c; 19 19 20 typedef typeof(3) x, y; // GCC20 typedef otypeof(3) x, y; // GCC 21 21 22 22 x p; … … 24 24 25 25 int main() { 26 typedef typeof(3) z, p;26 typedef otypeof(3) z, p; 27 27 z w; 28 28 p x; -
src/tests/Typeof.c
rb2b039d rf6d4204 1 1 int main() { 2 2 int *v1; 3 typeof(v1) v2;4 typeof(*v1) v3[4];3 otypeof(v1) v2; 4 otypeof(*v1) v3[4]; 5 5 char *v4[4]; 6 typeof(typeof(char *)[4]) v5;7 typeof (int *) v6;8 typeof( int ( int, int p ) ) *v7;9 typeof( [int] ( int, int p ) ) *v8;6 otypeof(otypeof(char *)[4]) v5; 7 otypeof (int *) v6; 8 otypeof( int ( int, int p ) ) *v7; 9 otypeof( [int] ( int, int p ) ) *v8; 10 10 } -
src/tests/limits.c
rb2b039d rf6d4204 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 //DUMMY113 return 0;114 }115 116 111 // Local Variables: // 117 112 // tab-width: 4 // -
src/tests/runTests.sh
rb2b039d rf6d4204 69 69 python test.py ${tests} 70 70 71 ret_val= $?71 ret_val=0 72 72 exit $((ret_val)) -
src/tests/test.py
rb2b039d rf6d4204 3 3 4 4 from os import listdir 5 from os.path import isfile, join , splitext5 from os.path import isfile, join 6 6 from subprocess import Popen, PIPE, STDOUT 7 7 … … 13 13 ################################################################################ 14 14 def listTests(): 15 list = [splitext(f)[0] for f in listdir('./.expect') 16 if not f.startswith('.') and f.endswith('.txt') 17 ] 15 list = [f.rstrip('.c') for f in listdir('.') 16 if not f.startswith('.') and ( 17 not isfile(f) or f.endswith('.c') 18 )] 18 19 19 20 return list … … 39 40 40 41 # build, skipping to next test on error 41 make_ret = sh("make -j 8 %s 2> %s 1> /dev/null" % (test, out_file), dry_run)42 make_ret = sh("make -j 8 %s > %s 2>&1" % (test, out_file), dry_run) 42 43 43 44 if make_ret == 0 : … … 50 51 retcode = 0 51 52 if not generate : 53 # touch expected files so empty output are supported by default 54 sh("touch .expect/%s.txt" % test, dry_run) 55 52 56 # diff the output of the files 53 57 retcode = sh("diff .expect/%s.txt .out/%s.log" % (test, test), dry_run) … … 63 67 64 68 if generate : 65 print( "Regenerate tests for: " ) 69 print( "Regenerate tests for: ", end="" ) 70 print( ", ".join( tests ) ) 66 71 67 72 failed = False; 68 73 for t in tests: 69 print("%20s " % t, end="") 74 if not generate : 75 print("%20s " % t, end="") 70 76 sys.stdout.flush() 71 77 test_failed = run_test_instance(t, generate, dry_run) … … 74 80 if not generate : 75 81 print("FAILED" if test_failed else "PASSED") 76 else :77 print( "Done" )78 82 79 83 sh('make clean > /dev/null 2>&1', dry_run) 80 84 81 return 1 if failed else 0 85 if generate : 86 print( "Done" ) 87 88 return 0 if failed else 1 82 89 83 90 ################################################################################ … … 86 93 parser = argparse.ArgumentParser(description='Script which runs cforall tests') 87 94 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')89 95 parser.add_argument('--all', help='Run all test available', 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')96 parser.add_argument('--generate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true') 91 97 parser.add_argument('tests', metavar='test', type=str, nargs='*', help='a list of tests to run') 92 98 93 99 options = parser.parse_args() 94 100 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) : 101 if len(options.tests) > 0 and options.all : 97 102 print('ERROR: must have option \'--all\' or non-empty test list', file=sys.stderr) 98 103 parser.print_help() 99 104 sys.exit(1) 100 105 101 allTests = listTests() 106 tests = listTests() if options.all else options.tests 102 107 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) ) 108 sys.exit( run_tests(tests, options.generate_expected, options.dry_run) )
Note:
See TracChangeset
for help on using the changeset viewer.