Changeset 4a60488 for tests/test.py


Ignore:
Timestamp:
Sep 27, 2019, 3:35:46 PM (6 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
90ce35aa
Parents:
8e1467d (diff), 849720f (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:

Merged from master taking the lvalue changes to expression and everything before that.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/test.py

    r8e1467d r4a60488  
    9191        parser.add_argument('--all', help='Run all test available', action='store_true')
    9292        parser.add_argument('--regenerate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true')
     93        parser.add_argument('--archive-errors', help='If called with a valid path, on test crashes the test script will copy the core dump and the executable to the specified path.', type=str, default='')
    9394        parser.add_argument('-j', '--jobs', help='Number of tests to run simultaneously', type=int)
    9495        parser.add_argument('--list-comp', help='List all valide arguments', action='store_true')
     
    142143        # build, skipping to next test on error
    143144        with Timed() as comp_dur:
    144                 make_ret, _ = make( test.target(), output=subprocess.DEVNULL, error=out_file, error_file = err_file )
     145                make_ret, _ = make( test.target(), output_file=subprocess.DEVNULL, error=out_file, error_file = err_file )
    145146
    146147        run_dur = None
     
    152153                                if settings.dry_run or is_exe(exe_file):
    153154                                        # run test
    154                                         retcode, _ = sh(exe_file, output=out_file, input=in_file, timeout=True)
     155                                        retcode, _ = sh(exe_file, output_file=out_file, input_file=in_file, timeout=True)
    155156                                else :
    156157                                        # simply cat the result into the output
     
    179180                        error = error + info if error else info
    180181
     182                        if settings.archive:
     183                                error = error + '\n' + core_archive(settings.archive, test.target(), exe_file)
     184
    181185
    182186
     
    215219def run_tests(tests, jobs) :
    216220        # clean the sandbox from previous commands
    217         make('clean', output=subprocess.DEVNULL, error=subprocess.DEVNULL)
     221        make('clean', output_file=subprocess.DEVNULL, error=subprocess.DEVNULL)
    218222
    219223        # create the executor for our jobs and handle the signal properly
     
    256260
    257261        # clean the workspace
    258         make('clean', output=subprocess.DEVNULL, error=subprocess.DEVNULL)
     262        make('clean', output_file=subprocess.DEVNULL, error=subprocess.DEVNULL)
    259263
    260264        return 1 if failed else 0
     
    295299        # users may want to simply list the tests
    296300        if options.list_comp :
    297                 print("-h --help --debug --dry-run --list --arch --all --regenerate-expected --install --timeout --global-timeout -j --jobs ", end='')
     301                print("-h --help --debug --dry-run --list --arch --all --regenerate-expected --archive-errors --install --timeout --global-timeout -j --jobs ", end='')
    298302                print(" ".join(map(lambda t: "%s" % (t.target()), tests)))
    299303
Note: See TracChangeset for help on using the changeset viewer.