Changes in / [1f17e07:9724df0]


Ignore:
Files:
1 added
15 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    r1f17e07 r9724df0  
    55//===========================================================================================================
    66//Compilation script is done here but environnement set-up and error handling is done in main loop
    7 def cfa_build(boolean full_build) {
     7def cfa_build() {
    88        build_stage 'Checkout'
    99                def install_dir = pwd tmp: true
     
    2828                //Run the tests from the example directory
    2929                dir ('src/tests') {
    30                         if (full_build) {
    31                                 sh 'python test.py --all'
    32                         }
    33                         else {
    34                                 sh './runTests.sh'
    35                         }
     30                        sh './runTests.sh'
    3631                }
    3732
  • src/tests/.expect/abs.txt

    r1f17e07 r9724df0  
     1/usr/local/bin/cfa -g -Wall -Wno-unused-function     abs.c   -o abs
     2CFA Version 1.0.0 (debug)
    13char                    ¿       abs A
    24signed int              -65     abs 65
  • src/tests/.expect/minmax.txt

    r1f17e07 r9724df0  
    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

    r1f17e07 r9724df0  
    11//cforall context declaration
    2 trait has_q( otype T ) {
     2context has_q( otype T ) {
    33        T q( T );
    44};
  • src/tests/Forall.c

    r1f17e07 r9724df0  
    1010        void f( int );
    1111        void h( void (*p)(void) );
    12 
     12 
    1313        int x;
    1414        void (*y)(void);
    1515        char z;
    1616        float w;
    17 
     17 
    1818        f( x );
    1919        f( y );
     
    2626        forall( otype T ) void f( T, T );
    2727        forall( otype T, otype U ) void f( T, U );
    28 
     28 
    2929        int x;
    3030        float y;
    3131        int *z;
    3232        float *w;
    33 
     33 
    3434        f( x, y );
    3535        f( z, w );
     
    4646}
    4747
    48 trait sumable( otype T ) {
     48context sumable( otype T ) {
    4949        const T 0;
    5050        T ?+?(T, T);
  • src/tests/Operators.c

    r1f17e07 r9724df0  
    1 int ?*?( int a, int b ) {
    2         return 0;
    3 }
     1int ?*?( int, int );
    42
    53int ?()( int number1, int number2 ) {
     
    75}
    86
    9 int ?+?( int a, int b ) {
    10         return 0;
    11 }
     7int ?+?( int, int );
    128
    13 int ?=?( int *a, int b ) {
    14         return 0;
    15 }
     9int ?=?( int *, int );
    1610struct accumulator {
    1711        int total;
    1812};
    1913
    20 char ?()( struct accumulator a, char number1, char number2 ) {
    21         return 'a';
    22 }
     14char ?()( struct accumulator a, char number1, char number2 );
    2315
    2416void f( void ) {
     
    3123}
    3224
    33 int main(int argc, char const *argv[]) {
    34         /* code */
    35         return 0;
    36 }
    37 
    3825// Local Variables: //
    3926// tab-width: 4 //
  • src/tests/Scope.c

    r1f17e07 r9724df0  
    1515y p;
    1616
    17 trait has_u( otype z ) {
     17context has_u( otype z ) {
    1818        z u(z);
    1919};
  • src/tests/Subrange.c

    r1f17e07 r9724df0  
    11// A small context defining the notion of an ordered otype.  (The standard
    22// library should probably contain a context for this purpose.)
    3 trait ordered(otype T) {
     3context ordered(otype T) {
    44    int ?<?(T, T), ?<=?(T, T);
    55};
  • src/tests/Switch.c

    r1f17e07 r9724df0  
    1 int main(int argc, char const *argv[]) {
     1int fred() {
    22    int i;
    33    switch ( i ) case 3 : i = 1;
  • src/tests/Typedef.c

    r1f17e07 r9724df0  
    1818a c;
    1919
    20 typedef typeof(3) x, y;  // GCC
     20typedef otypeof(3) x, y;  // GCC
    2121
    2222x p;
     
    2424
    2525int main() {
    26     typedef typeof(3) z, p;
     26    typedef otypeof(3) z, p;
    2727    z w;
    2828    p x;
  • src/tests/limits.c

    r1f17e07 r9724df0  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // limits.c --
     7// limits.c -- 
    88//
    99// Author           : Peter A. Buhr
     
    1212// Last Modified On : Tue May 10 20:45:28 2016
    1313// Update Count     : 1
    14 //
     14// 
    1515
    1616#include <limits>
     
    109109long _Complex _1_sqrt_2 = _1_SQRT_2;
    110110
    111 int main(int argc, char const *argv[]) {
    112         //DUMMY
    113         return 0;
    114 }
    115 
    116111// Local Variables: //
    117112// tab-width: 4 //
  • src/tests/test.py

    r1f17e07 r9724df0  
    33
    44from os import listdir
    5 from os.path import isfile, join, splitext
     5from os.path import isfile, join
    66from subprocess import Popen, PIPE, STDOUT
    77
     
    1313################################################################################
    1414def 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                )]
    1819
    1920        return list
     
    3940
    4041        # 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)
    4243
    4344        if make_ret == 0 :
     
    5051        retcode = 0
    5152        if not generate :
     53                # touch expected files so empty output are supported by default
     54                sh("touch .expect/%s.txt" % test, dry_run)
     55
    5256                # diff the output of the files
    5357                retcode = sh("diff .expect/%s.txt .out/%s.log" % (test, test), dry_run)
     
    6367
    6468        if generate :
    65                 print( "Regenerate tests for: " )
     69                print( "Regenerate tests for: ", end="" )
     70                print( ", ".join( tests ) )
    6671
    6772        failed = False;
    6873        for t in tests:
    69                 print("%20s  " % t, end="")
     74                if not generate :
     75                        print("%20s  " % t, end="")
    7076                sys.stdout.flush()
    7177                test_failed = run_test_instance(t, generate, dry_run)
     
    7480                if not generate :
    7581                        print("FAILED" if test_failed else "PASSED")
    76                 else :
    77                         print( "Done" )
    7882
    7983        sh('make clean > /dev/null 2>&1', dry_run)
     84
     85        if generate :
     86                print( "Done" )
    8087
    8188        return 0 if failed else 1
     
    8693parser = argparse.ArgumentParser(description='Script which runs cforall tests')
    8794parser.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')
    8995parser.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')
     96parser.add_argument('--generate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true')
    9197parser.add_argument('tests', metavar='test', type=str, nargs='*', help='a list of tests to run')
    9298
    9399options = parser.parse_args()
    94100
    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) :
     101if len(options.tests) > 0 and options.all :
    97102        print('ERROR: must have option \'--all\' or non-empty test list', file=sys.stderr)
    98103        parser.print_help()
    99104        sys.exit(1)
    100105
    101 allTests = listTests()
     106tests = listTests() if options.all else options.tests
    102107
    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) )
     108sys.exit( run_tests(tests, options.generate_expected, options.dry_run) )
Note: See TracChangeset for help on using the changeset viewer.