Changeset 21eb693


Ignore:
Timestamp:
Jun 20, 2016, 3:05:35 PM (8 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, 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:
554a0db
Parents:
a0dcd2e (diff), 0a346e5 (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

Conflicts:

src/tests/Context.c

Files:
14 added
12 edited
1 moved

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    ra0dcd2e r21eb693  
    55//===========================================================================================================
    66//Compilation script is done here but environnement set-up and error handling is done in main loop
    7 def cfa_build() {
     7def cfa_build(boolean full_build) {
    88        build_stage 'Checkout'
    99                def install_dir = pwd tmp: true
    1010                //checkout the source code and clean the repo
    1111                checkout scm
     12
     13                //Clean all temporary files to make sure no artifacts of the previous build remain
    1214                sh 'git clean -fdqx'
     15
     16                //Reset the git repo so no local changes persist
    1317                sh 'git reset --hard'
    1418
     
    2630        build_stage 'Test'
    2731
    28                 //Run the tests from the example directory
     32                //Run the tests from the tests directory
    2933                dir ('src/tests') {
    30                         sh './runTests.sh'
     34                        if (full_build) {
     35                                sh 'python test.py --all'
     36                        }
     37                        else {
     38                                sh './runTests.sh'
     39                        }
    3140                }
    3241
     
    140149                                //Compile using gcc-4.9
    141150                                currentCC = new CC_Desc('gcc-4.9', 'g++-4.9', 'gcc-4.9')
    142                                 cfa_build()
     151                                cfa_build(doPromoteBuild2DoLang)
    143152
    144153                                //Compile using gcc-5
    145154                                currentCC = new CC_Desc('gcc-5', 'g++-5', 'gcc-5')
    146                                 cfa_build()
     155                                cfa_build(doPromoteBuild2DoLang)
    147156
    148157                                //Compile using gcc-4.9
    149158                                currentCC = new CC_Desc('gcc-6', 'g++-6', 'gcc-6')
    150                                 cfa_build()
     159                                cfa_build(doPromoteBuild2DoLang)
    151160
    152161                                if( doPromoteBuild2DoLang ) {
     
    185194//===========================================================================================================
    186195def notify_result(boolean promote, Exception err, String status, boolean log) {
     196        echo 'Build completed, sending result notification'
    187197        if(promote)     {
    188198                if( err ) {
     
    224234        def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase()
    225235
    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')
     236        def gitLog = 'Error retrieving git logs'
     237        def gitDiff = 'Error retrieving git diff'
     238
     239        try {
     240
     241                sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG"
     242                gitLog = readFile('GIT_LOG')
     243
     244                sh "git diff --stat ${gitRefNewValue} ${gitRefOldValue} > GIT_DIFF"
     245                gitDiff = readFile('GIT_DIFF')
     246        }
     247        catch (Exception error) {}
    231248
    232249        def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${status}] - branch ${env.BRANCH_NAME}"
  • src/tests/.expect/abs.txt

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

    ra0dcd2e r21eb693  
     1char                    z a     min a
     2signed int              4 3     min 3
     3unsigned int            4 3     min 3
     4signed long int         4 3     min 3
     5unsigned long int       4 3     min 3
     6signed long long int    4 3     min 3
     7unsigned long long int  4 3     min 3
     8float                   4 3.1   min 3.1
     9double                  4 3.1   min 3.1
     10long double             4 3.1   min 3.1
     11
     12char                    z a     max z
     13signed int              4 3     max 4
     14unsigned int            4 3     max 4
     15signed long int         4 3     max 4
     16unsigned long int       4 3     max 4
     17signed long long int    4 3     max 4
     18unsigned long long int  4 3     max 4
     19float                   4 3.1   max 4
     20double                  4 3.1   max 4
     21long double             4 3.1   max 4
  • src/tests/Context.c

    ra0dcd2e r21eb693  
    11// trait declaration
     2
    23trait has_q( otype T ) {
    34        T q( T );
  • src/tests/Forall.c

    ra0dcd2e r21eb693  
    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 );
  • src/tests/Operators.c

    ra0dcd2e r21eb693  
    1 int ?*?( int, int );
     1int ?*?( int a, int b ) {
     2        return 0;
     3}
    24
    35int ?()( int number1, int number2 ) {
     
    57}
    68
    7 int ?+?( int, int );
     9int ?+?( int a, int b ) {
     10        return 0;
     11}
    812
    9 int ?=?( int *, int );
     13int ?=?( int *a, int b ) {
     14        return 0;
     15}
    1016struct accumulator {
    1117        int total;
    1218};
    1319
    14 char ?()( struct accumulator a, char number1, char number2 );
     20char ?()( struct accumulator a, char number1, char number2 ) {
     21        return 'a';
     22}
    1523
    1624void f( void ) {
     
    2331}
    2432
     33int main(int argc, char const *argv[]) {
     34        /* code */
     35        return 0;
     36}
     37
    2538// Local Variables: //
    2639// tab-width: 4 //
  • src/tests/Scope.c

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

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

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

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

    ra0dcd2e r21eb693  
    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
     111int main(int argc, char const *argv[]) {
     112        //DUMMY
     113        return 0;
     114}
     115
    111116// Local Variables: //
    112117// tab-width: 4 //
  • src/tests/test.py

    ra0dcd2e r21eb693  
    33
    44from os import listdir
    5 from os.path import isfile, join
     5from os.path import isfile, join, splitext
    66from subprocess import Popen, PIPE, STDOUT
    77
     
    1313################################################################################
    1414def 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                ]
    1918
    2019        return list
     
    4039
    4140        # 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)
    4342
    4443        if make_ret == 0 :
     
    5150        retcode = 0
    5251        if not generate :
    53                 # touch expected files so empty output are supported by default
    54                 sh("touch .expect/%s.txt" % test, dry_run)
    55 
    5652                # diff the output of the files
    5753                retcode = sh("diff .expect/%s.txt .out/%s.log" % (test, test), dry_run)
     
    6763
    6864        if generate :
    69                 print( "Regenerate tests for: ", end="" )
    70                 print( ", ".join( tests ) )
     65                print( "Regenerate tests for: " )
    7166
    7267        failed = False;
    7368        for t in tests:
    74                 if not generate :
    75                         print("%20s  " % t, end="")
     69                print("%20s  " % t, end="")
    7670                sys.stdout.flush()
    7771                test_failed = run_test_instance(t, generate, dry_run)
     
    8074                if not generate :
    8175                        print("FAILED" if test_failed else "PASSED")
     76                else :
     77                        print( "Done" )
    8278
    8379        sh('make clean > /dev/null 2>&1', dry_run)
    84 
    85         if generate :
    86                 print( "Done" )
    8780
    8881        return 0 if failed else 1
     
    9386parser = argparse.ArgumentParser(description='Script which runs cforall tests')
    9487parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true')
     88parser.add_argument('--list', help='List all test available', action='store_true')
    9589parser.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')
     90parser.add_argument('--regenerate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true')
    9791parser.add_argument('tests', metavar='test', type=str, nargs='*', help='a list of tests to run')
    9892
    9993options = parser.parse_args()
    10094
    101 if len(options.tests) > 0 and options.all :
     95if (len(options.tests) > 0  and     options.all and not options.list) \
     96or (len(options.tests) == 0 and not options.all and not options.list) :
    10297        print('ERROR: must have option \'--all\' or non-empty test list', file=sys.stderr)
    10398        parser.print_help()
    10499        sys.exit(1)
    105100
    106 tests = listTests() if options.all else options.tests
     101allTests = listTests()
    107102
    108 sys.exit( run_tests(tests, options.generate_expected, options.dry_run) )
     103if options.all or options.list :
     104        tests = allTests
     105
     106else :
     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
     118if options.list :
     119        print("\n".join(tests))
     120
     121else :
     122        sys.exit( run_tests(tests, options.regenerate_expected, options.dry_run) )
Note: See TracChangeset for help on using the changeset viewer.