Changeset 3403534 for src/tests


Ignore:
Timestamp:
Sep 4, 2016, 10:34:35 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, stuck-waitfor-destruct, with_gc
Children:
f04a8b81
Parents:
28307be (diff), b16898e (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.
Message:

Merge branch 'master' of plg2:software/cfa/cfa-cc

Location:
src/tests
Files:
3 added
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • src/tests/.expect/64/declarationSpecifier.txt

    r28307be r3403534  
    530530    return ((int )_retVal0);
    531531}
    532 __attribute__ ((constructor(),)) static void _init_declarationSpecifier(void){
    533     ((void)___constructor__F_P13s__anonymous0_autogen___1(((struct __anonymous0 *)(&__x10__CV13s__anonymous0_1))));
    534     ((void)___constructor__F_P13s__anonymous1_autogen___1(((struct __anonymous1 *)(&__x11__CV13s__anonymous1_1))));
    535     ((void)___constructor__F_P13s__anonymous2_autogen___1(((struct __anonymous2 *)(&__x12__CV13s__anonymous2_1))));
    536     ((void)___constructor__F_P13s__anonymous3_autogen___1(((struct __anonymous3 *)(&__x13__CV13s__anonymous3_1))));
    537     ((void)___constructor__F_P13s__anonymous4_autogen___1(((struct __anonymous4 *)(&__x14__CV13s__anonymous4_1))));
    538     ((void)___constructor__F_P13s__anonymous5_autogen___1(((struct __anonymous5 *)(&__x15__CV13s__anonymous5_1))));
    539     ((void)___constructor__F_P13s__anonymous6_autogen___1(((struct __anonymous6 *)(&__x16__CV13s__anonymous6_1))));
    540     ((void)___constructor__F_P13s__anonymous7_autogen___1(((struct __anonymous7 *)(&__x17__CV13s__anonymous7_1))));
    541     ((void)___constructor__F_P13s__anonymous8_autogen___1(((struct __anonymous8 *)(&__x29__CV13s__anonymous8_1))));
    542     ((void)___constructor__F_P13s__anonymous9_autogen___1(((struct __anonymous9 *)(&__x30__CV13s__anonymous9_1))));
    543     ((void)___constructor__F_P14s__anonymous10_autogen___1(((struct __anonymous10 *)(&__x31__CV14s__anonymous10_1))));
    544     ((void)___constructor__F_P14s__anonymous11_autogen___1(((struct __anonymous11 *)(&__x32__CV14s__anonymous11_1))));
    545     ((void)___constructor__F_P14s__anonymous12_autogen___1(((struct __anonymous12 *)(&__x33__CV14s__anonymous12_1))));
    546     ((void)___constructor__F_P14s__anonymous13_autogen___1(((struct __anonymous13 *)(&__x34__CV14s__anonymous13_1))));
    547     ((void)___constructor__F_P14s__anonymous14_autogen___1(((struct __anonymous14 *)(&__x35__CV14s__anonymous14_1))));
    548     ((void)___constructor__F_P14s__anonymous15_autogen___1(((struct __anonymous15 *)(&__x36__CV14s__anonymous15_1))));
    549 }
    550 __attribute__ ((destructor(),)) static void _destroy_declarationSpecifier(void){
    551     ((void)___destructor__F_P14s__anonymous15_autogen___1(((struct __anonymous15 *)(&__x36__CV14s__anonymous15_1))));
    552     ((void)___destructor__F_P14s__anonymous14_autogen___1(((struct __anonymous14 *)(&__x35__CV14s__anonymous14_1))));
    553     ((void)___destructor__F_P14s__anonymous13_autogen___1(((struct __anonymous13 *)(&__x34__CV14s__anonymous13_1))));
    554     ((void)___destructor__F_P14s__anonymous12_autogen___1(((struct __anonymous12 *)(&__x33__CV14s__anonymous12_1))));
    555     ((void)___destructor__F_P14s__anonymous11_autogen___1(((struct __anonymous11 *)(&__x32__CV14s__anonymous11_1))));
    556     ((void)___destructor__F_P14s__anonymous10_autogen___1(((struct __anonymous10 *)(&__x31__CV14s__anonymous10_1))));
    557     ((void)___destructor__F_P13s__anonymous9_autogen___1(((struct __anonymous9 *)(&__x30__CV13s__anonymous9_1))));
    558     ((void)___destructor__F_P13s__anonymous8_autogen___1(((struct __anonymous8 *)(&__x29__CV13s__anonymous8_1))));
    559     ((void)___destructor__F_P13s__anonymous7_autogen___1(((struct __anonymous7 *)(&__x17__CV13s__anonymous7_1))));
    560     ((void)___destructor__F_P13s__anonymous6_autogen___1(((struct __anonymous6 *)(&__x16__CV13s__anonymous6_1))));
    561     ((void)___destructor__F_P13s__anonymous5_autogen___1(((struct __anonymous5 *)(&__x15__CV13s__anonymous5_1))));
    562     ((void)___destructor__F_P13s__anonymous4_autogen___1(((struct __anonymous4 *)(&__x14__CV13s__anonymous4_1))));
    563     ((void)___destructor__F_P13s__anonymous3_autogen___1(((struct __anonymous3 *)(&__x13__CV13s__anonymous3_1))));
    564     ((void)___destructor__F_P13s__anonymous2_autogen___1(((struct __anonymous2 *)(&__x12__CV13s__anonymous2_1))));
    565     ((void)___destructor__F_P13s__anonymous1_autogen___1(((struct __anonymous1 *)(&__x11__CV13s__anonymous1_1))));
    566     ((void)___destructor__F_P13s__anonymous0_autogen___1(((struct __anonymous0 *)(&__x10__CV13s__anonymous0_1))));
    567 }
  • src/tests/.expect/64/extension.txt

    r28307be r3403534  
    8686        __extension__ int __c__i_2;
    8787    };
    88     int __i__i_2;
    89     ((void)((*((int *)(&__i__i_2)))=(__extension__ __a__i_1+__extension__ 3)) /* ?{} */);
     88    int __i__i_2 = ((int )(__extension__ __a__i_1+__extension__ 3));
    9089    ((void)__extension__ 3);
    9190    ((void)__extension__ __a__i_1);
  • src/tests/.expect/64/gccExtensions.txt

    r28307be r3403534  
    7676        ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))=__c__i_2) /* ?{} */);
    7777    }
    78     int __i__i_2;
    79     ((void)((*((int *)(&__i__i_2)))=__extension__ 3) /* ?{} */);
     78    int __i__i_2 = ((int )__extension__ 3);
    8079    __extension__ int __a__i_2;
    8180    __extension__ int __b__i_2;
     
    133132    }
    134133    struct s3 __x1__3ss3_2;
    135     ((void)___constructor__F_P3ss3_autogen___2(((struct s3 *)(&__x1__3ss3_2))));
    136134    struct s3 __y1__3ss3_2;
    137     ((void)___constructor__F_P3ss3_autogen___2(((struct s3 *)(&__y1__3ss3_2))));
    138135    struct s4 {
    139136        int __i__i_2;
     
    141138    inline struct s4 ___operator_assign__F3ss4_P3ss43ss4_autogen___2(struct s4 *___dst__P3ss4_2, struct s4 ___src__3ss4_2){
    142139        ((void)((*___dst__P3ss4_2).__i__i_2=___src__3ss4_2.__i__i_2));
    143         ((void)___destructor__F_P3ss3_autogen___2(((struct s3 *)(&__y1__3ss3_2))));
    144         ((void)___destructor__F_P3ss3_autogen___2(((struct s3 *)(&__x1__3ss3_2))));
    145140        return ((struct s4 )___src__3ss4_2);
    146141    }
     
    158153    }
    159154    struct s4 __x2__3ss4_2;
    160     ((void)___constructor__F_P3ss4_autogen___2(((struct s4 *)(&__x2__3ss4_2))));
    161155    struct s4 __y2__3ss4_2;
    162     ((void)___constructor__F_P3ss4_autogen___2(((struct s4 *)(&__y2__3ss4_2))));
    163156    int __m1__A0i_2[((long unsigned int )10)];
    164157    int __m2__A0A0i_2[((long unsigned int )10)][((long unsigned int )10)];
     
    166159    int _retVal0 = { 0 };
    167160    ((void)(_retVal0=0) /* ?{} */);
    168     ((void)___destructor__F_P3ss4_autogen___2(((struct s4 *)(&__y2__3ss4_2))));
    169     ((void)___destructor__F_P3ss4_autogen___2(((struct s4 *)(&__x2__3ss4_2))));
    170     ((void)___destructor__F_P3ss3_autogen___2(((struct s3 *)(&__y1__3ss3_2))));
    171     ((void)___destructor__F_P3ss3_autogen___2(((struct s3 *)(&__x1__3ss3_2))));
    172161    return ((int )_retVal0);
    173     ((void)___destructor__F_P3ss4_autogen___2(((struct s4 *)(&__y2__3ss4_2))));
    174     ((void)___destructor__F_P3ss4_autogen___2(((struct s4 *)(&__x2__3ss4_2))));
    175     ((void)___destructor__F_P3ss3_autogen___2(((struct s3 *)(&__y1__3ss3_2))));
    176     ((void)___destructor__F_P3ss3_autogen___2(((struct s3 *)(&__x1__3ss3_2))));
    177162}
  • src/tests/Makefile.am

    r28307be r3403534  
    6262        ${CC} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
    6363
    64 ctorWarnings: ctorWarnings.c
    65         ${CC} ${CFALGS} -CFA -XCFA -p ${<} -o /dev/null 2> ${@}
     64memberCtors-ERR1: memberCtors.c
     65        ${CC} ${CFALGS} -DERR1 ${<} -o ${@}
    6666
  • src/tests/Makefile.in

    r28307be r3403534  
    670670        ${CC} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
    671671
    672 ctorWarnings: ctorWarnings.c
    673         ${CC} ${CFALGS} -CFA -XCFA -p ${<} -o /dev/null 2> ${@}
     672memberCtors-ERR1: memberCtors.c
     673        ${CC} ${CFALGS} -DERR1 ${<} -o ${@}
    674674
    675675# Tell versions [3.59,3.63) of GNU make to not export all variables.
  • src/tests/test.py

    r28307be r3403534  
    22from __future__ import print_function
    33
     4from functools import partial
     5from multiprocessing import Pool
    46from os import listdir, environ
    57from os.path import isfile, join, splitext
     
    102104#               running test functions
    103105################################################################################
    104 def run_test_instance(test, generate, dry_run):
     106def run_single_test(test, generate, dry_run):
    105107
    106108        # find the output file based on the test name and options flag
     
    163165        return retcode, error
    164166
     167def run_test_instance(t, generate, dry_run) :
     168        # print formated name
     169        name_txt = "%20s  " % t.name
     170
     171        #run the test instance and collect the result
     172        test_failed, error = run_single_test(t, generate, dry_run)
     173
     174        # update output based on current action
     175        if generate :
     176                failed_txt = "ERROR"
     177                success_txt = "Done"
     178        else :
     179                failed_txt = "FAILED"
     180                success_txt = "PASSED"
     181
     182        #print result with error if needed
     183        text = name_txt + (failed_txt if test_failed else success_txt)
     184        out = sys.stdout
     185        if error :
     186                text = text + "\n" + error
     187                out = sys.stderr
     188
     189        print(text, file = out);
     190        sys.stdout.flush()
     191        sys.stderr.flush()
     192
     193        return test_failed
     194
    165195# run the given list of tests with the given parameters
    166196def run_tests(tests, generate, dry_run, jobs) :
     
    174204                print( "Regenerate tests for: " )
    175205
    176         failed = False;
    177         # for eeach test to run
    178         for t in tests:
    179                 # print formated name
    180                 name_txt = "%20s  " % t.name
    181 
    182                 #run the test instance and collect the result
    183                 test_failed, error = run_test_instance(t, generate, dry_run)
    184 
    185                 # aggregate test suite result
    186                 failed = test_failed or failed
    187 
    188                 # update output based on current action
    189                 if generate :
    190                         failed_txt = "ERROR"
    191                         success_txt = "Done"
    192                 else :
    193                         failed_txt = "FAILED"
    194                         success_txt = "PASSED"
    195 
    196                 #print result with error if needed
    197                 text = name_txt + (failed_txt if test_failed else success_txt)
    198                 out = sys.stdout
    199                 if error :
    200                         text = text + "\n" + error
    201                         out = sys.stderr
    202 
    203                 print(text, file = out);
    204                 sys.stdout.flush()
    205                 sys.stderr.flush()
    206 
     206        # for each test to run
     207        pool = Pool(jobs)
     208        try :
     209                results = pool.map_async(partial(run_test_instance, generate=generate, dry_run=dry_run), tests ).get(99999999)
     210        except KeyboardInterrupt:
     211                pool.terminate()
     212                print("Tests interrupted by user")
     213                sys.exit(1)
    207214
    208215        #clean the workspace
    209216        sh("%s clean > /dev/null 2>&1" % make_cmd, dry_run)
    210217
    211         return 1 if failed else 0
     218        for failed in results:
     219                if failed :
     220                        return 1
     221
     222        return 0
    212223
    213224################################################################################
     
    279290
    280291# make sure we have a valid number of jobs that corresponds to user input
    281 options.jobs = int(make_max_jobs) if make_max_jobs else options.jobs
     292options.jobs = int(make_max_jobs) if make_max_jobs else (options.jobs if options.jobs else 1)
    282293if options.jobs <= 0 :
    283294        print('ERROR: Invalid number of jobs', file=sys.stderr)
    284295        sys.exit(1)
    285296
     297print('Running on %i cores' % options.jobs)
     298
    286299# users may want to simply list the tests
    287300if options.list :
  • src/tests/typeof.c

    r28307be r3403534  
    88    typeof( int ( int, int p ) ) *v7;
    99    typeof( [int] ( int, int p ) ) *v8;
     10    (typeof(v1)) v2; // cast with typeof
    1011}
Note: See TracChangeset for help on using the changeset viewer.