Changeset 66999e7 for src/tests


Ignore:
Timestamp:
Jun 28, 2016, 5:29:00 PM (10 years ago)
Author:
Aaron Moss <a3moss@…>
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:
59f9273, c017d5b, d06010a
Parents:
22cad76 (diff), 472ca32 (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 plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/tests
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/tests/Makefile.am

    r22cad76 r66999e7  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Mon Jun 20 14:30:52 2016
    14 ## Update Count     : 33
     13## Last Modified On : Mon Jun 27 14:39:08 2016
     14## Update Count     : 34
    1515###############################################################################
    1616
     
    2727
    2828all-local :
    29         python test.py vector_test avl_test operators numericConstants expression enum asmName array typeof cast
     29        +python test.py vector_test avl_test operators numericConstants expression enum asmName array typeof cast
    3030
    3131all-tests :
    32         python test.py --all
     32        +python test.py --all
    3333
    3434clean-local :
     
    3636
    3737list :
    38         python test.py --list
     38        +python test.py --list
    3939
    4040constant0-1DP : constant0-1.c
  • src/tests/Makefile.in

    r22cad76 r66999e7  
    634634
    635635all-local :
    636         python test.py vector_test avl_test operators numericConstants expression enum asmName array typeof cast
     636        +python test.py vector_test avl_test operators numericConstants expression enum asmName array typeof cast
    637637
    638638all-tests :
    639         python test.py --all
     639        +python test.py --all
    640640
    641641clean-local :
     
    643643
    644644list :
    645         python test.py --list
     645        +python test.py --list
    646646
    647647constant0-1DP : constant0-1.c
  • src/tests/test.py

    r22cad76 r66999e7  
    2121        return list
    2222
    23 def sh(cmd, dry_run):
     23def sh(cmd, dry_run = False, print2stdout = True):
    2424        if dry_run :
    2525                print("cmd: %s" % cmd)
    26                 return 0
     26                return 0, None
    2727        else :
    28                 proc = Popen(cmd, stderr=STDOUT, shell=True)
    29                 proc.communicate()
    30                 return proc.returncode
     28                proc = Popen(cmd, stdout=None if print2stdout else PIPE, stderr=STDOUT, shell=True)
     29                out, err = proc.communicate()
     30                return proc.returncode, out
    3131
    3232def file_replace(fname, pat, s_after):
     
    6161
    6262        # build, skipping to next test on error
    63         make_ret = sh("%s %s 2> %s 1> /dev/null" % (make_cmd, test, out_file), dry_run)
     63        make_ret, _ = sh("%s %s 2> %s 1> /dev/null" % (make_cmd, test, out_file), dry_run)
    6464
    6565        if make_ret == 0 :
     
    7171
    7272        retcode = 0
     73        error = None
    7374
    7475        fix_MakeLevel(out_file)
     
    7677        if not generate :
    7778                # diff the output of the files
    78                 retcode = sh("diff .expect/%s.txt .out/%s.log" % (test, test), dry_run)
     79                diff_cmd = ("diff --old-group-format='\t\tmissing lines :\n"
     80                                        "%%<' \\\n"
     81                                        "--new-group-format='\t\tnew lines :\n"
     82                                        "%%>' \\\n"
     83                                        "--unchanged-group-format='%%=' \\"
     84                                        "--changed-group-format='\t\texpected :\n"
     85                                        "%%<\n"
     86                                        "\t\tgot :\n"
     87                                        "%%>' \\\n"
     88                                        "--new-line-format='\t\t%%dn\t%%L' \\\n"
     89                                        "--old-line-format='\t\t%%dn\t%%L' \\\n"
     90                                        "--unchanged-line-format='' \\\n"
     91                                        ".expect/%s.txt .out/%s.log")
     92
     93                retcode, error = sh(diff_cmd % (test, test), dry_run, False)
    7994
    8095        # clean the executable
    8196        sh("rm -f %s > /dev/null 2>&1" % test, dry_run)
    8297
    83         return retcode
     98        return retcode, error
    8499
    85100def run_tests(tests, generate, dry_run) :
     
    94109                print("%20s  " % t, end="")
    95110                sys.stdout.flush()
    96                 test_failed = run_test_instance(t, generate, dry_run)
     111                test_failed, error = run_test_instance(t, generate, dry_run)
    97112                failed = test_failed or failed
    98113
    99114                if not generate :
    100115                        print("FAILED" if test_failed else "PASSED")
     116                        if error :
     117                                print(error)
    101118                else :
    102119                        print( "Done" )
  • src/tests/typedef.c

    r22cad76 r66999e7  
    22
    33void f( void ) {
    4     int T( T );
     4    int T( T p ) { return 3; }
    55    T( 3 );
    66}
     
    3838typedef [ int, int ] tupleType;
    3939typedef * [ int, int ] tupleTypePtr;
    40 typedef * int a, b;
     40typedef * int c, d;
    4141typedef [ int ] f( * int ), g;
    4242typedef [ * [static 10] int ] t;
    43 typedef [ * [static 10] int x ] f();
     43typedef [ * [static 10] int x ] h();
    4444
    4545// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.