Changeset 4e9151f for src


Ignore:
Timestamp:
Apr 24, 2017, 12:55:22 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, 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, with_gc
Children:
00303d50
Parents:
b3d70eba
Message:
  • Fixed tests to no longer use make errors, pipeing CC errors directly instead
  • Tests now use the number of cores as the number of jobs if jobserver is not defined
  • Tests now support both jobserver-fds and and jobserver-auth as the file descriptor variables
  • Tests now limit the number of concurrent jobs to the total number of tests
  • Tests now ignore whitespaces and blank lines when comparing diffs
Location:
src/tests
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • src/tests/.expect/castError.txt

    rb3d70eba r4e9151f  
    3939
    4040
    41 make: *** [castError] Error 1
  • src/tests/.expect/completeTypeError.txt

    rb3d70eba r4e9151f  
    4141
    4242
    43 make: *** [completeTypeError] Error 1
  • src/tests/.expect/constant0-1DP.txt

    rb3d70eba r4e9151f  
    3131constant0-1.c:50 error: duplicate object definition for x: const pointer to pointer to signed int
    3232constant0-1.c:50 error: duplicate object definition for 0: pointer to pointer to signed int
    33 make: *** [constant0-1DP] Error 1
  • src/tests/.expect/constant0-1NDDP.txt

    rb3d70eba r4e9151f  
    1515constant0-1.c:67 error: duplicate object definition for x: const pointer to signed int
    1616constant0-1.c:67 error: duplicate object definition for 0: const pointer to signed int
    17 make: *** [constant0-1NDDP] Error 1
  • src/tests/.expect/declarationErrors.txt

    rb3d70eba r4e9151f  
    6767
    6868
    69 make: *** [declarationErrors] Error 1
  • src/tests/.expect/dtor-early-exit-ERR1.txt

    rb3d70eba r4e9151f  
    11dtor-early-exit.c:142 error: jump to label 'L1' crosses initialization of y Branch (Goto)
    2 
    3 make: *** [dtor-early-exit-ERR1] Error 1
  • src/tests/.expect/dtor-early-exit-ERR2.txt

    rb3d70eba r4e9151f  
    11dtor-early-exit.c:142 error: jump to label 'L2' crosses initialization of y Branch (Goto)
    2 
    3 make: *** [dtor-early-exit-ERR2] Error 1
  • src/tests/.expect/memberCtors-ERR1.txt

    rb3d70eba r4e9151f  
    11memberCtors.c:62 error: in void ?{}(B *b), field a2 used before being constructed
    2 make: *** [memberCtors-ERR1] Error 1
  • src/tests/.expect/scopeErrors.txt

    rb3d70eba r4e9151f  
    77  with body
    88    CompoundStmt
    9 
    10 make: *** [scopeErrors] Error 1
  • src/tests/.gitignore

    rb3d70eba r4e9151f  
    11.out/
     2.err/
  • src/tests/Makefile.am

    rb3d70eba r4e9151f  
    2929# applies to both programs
    3030EXTRA_FLAGS =
    31 CFLAGS = -g -Wall -Wno-unused-function @CFA_FLAGS@ ${EXTRA_FLAGS}
     31CFLAGS = 2> .err/${@}.log -g -Wall -Wno-unused-function @CFA_FLAGS@ ${EXTRA_FLAGS}
    3232CC = @CFA_BINDIR@/@CFA_NAME@
    3333
  • src/tests/Makefile.in

    rb3d70eba r4e9151f  
    125125CFA_NAME = @CFA_NAME@
    126126CFA_PREFIX = @CFA_PREFIX@
    127 CFLAGS = -g -Wall -Wno-unused-function @CFA_FLAGS@ ${EXTRA_FLAGS}
     127CFLAGS = 2> .err/${@}.log -g -Wall -Wno-unused-function @CFA_FLAGS@ ${EXTRA_FLAGS}
    128128CPP = @CPP@
    129129CPPFLAGS = @CPPFLAGS@
  • src/tests/test.py

    rb3d70eba r4e9151f  
    1313import stat
    1414import sys
     15import multiprocessing
    1516
    1617################################################################################
     
    115116        # find the output file based on the test name and options flag
    116117        out_file = (".out/%s.log" % test.name) if not generate else (".expect/%s.txt" % test.path)
     118        err_file = ".err/%s.log" % test.name
    117119
    118120        # remove any outputs from the previous tests to prevent side effects
     
    137139                        sh("cat %s > %s" % (test.name, out_file), dry_run)
    138140
     141        else :
     142                # command failed save the log to less temporary file
     143                sh("mv %s %s" % (err_file, out_file), dry_run)
     144
    139145        retcode = 0
    140146        error = None
    141147
    142         # fix output to prevent make depth to cause issues
    143         fix_MakeLevel(out_file)
     148        # # fix output to prevent make depth to cause issues
     149        # fix_MakeLevel(out_file)
    144150
    145151        if generate :
     
    152158        else :
    153159                # diff the output of the files
    154                 diff_cmd = ("diff --old-group-format='\t\tmissing lines :\n"
     160                diff_cmd = ("diff --ignore-all-space "
     161                                        "--ignore-blank-lines "
     162                                        "--old-group-format='\t\tmissing lines :\n"
    155163                                        "%%<' \\\n"
    156164                                        "--new-group-format='\t\tnew lines :\n"
     
    212220
    213221        #make sure the required folder are present
    214         sh('mkdir -p .out .expect', dry_run)
     222        sh('mkdir -p .out .expect .err', dry_run)
    215223
    216224        if generate :
     
    309317# check if the user already passed in a number of jobs for multi-threading
    310318make_flags = environ.get('MAKEFLAGS')
    311 make_jobs_fds = re.search("--jobserver-fds=\s*([0-9]+),([0-9]+)", make_flags) if make_flags else None
     319make_jobs_fds = re.search("--jobserver-(auth|fds)=\s*([0-9]+),([0-9]+)", make_flags) if make_flags else None
    312320if make_jobs_fds :
    313         tokens = os.read(int(make_jobs_fds.group(1)), 1024)
     321        tokens = os.read(int(make_jobs_fds.group(2)), 1024)
    314322        options.jobs = len(tokens)
    315         os.write(int(make_jobs_fds.group(2)), tokens)
     323        os.write(int(make_jobs_fds.group(3)), tokens)
     324else :
     325        options.jobs = multiprocessing.cpu_count()
    316326
    317327# make sure we have a valid number of jobs that corresponds to user input
     
    320330        sys.exit(1)
    321331
     332options.jobs = min( options.jobs, len(tests) )
     333
    322334print('Running (%s) on %i cores' % ("debug" if options.debug else "no debug", options.jobs))
    323335make_cmd = "make" if make_flags else ("make -j%i" % options.jobs)
Note: See TracChangeset for help on using the changeset viewer.