Changeset 2980667


Ignore:
Timestamp:
Mar 26, 2020, 2:34:41 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
136f86b
Parents:
2a35f14
Message:

Some restructuring in tests to allow tests to be run for multiple configs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/test.py

    r2a35f14 r2980667  
    293293        settings.init( options )
    294294
    295         # fetch the liest of all valid tests
    296         all_tests = list_tests( options.include, options.exclude )
    297 
    298 
    299         # if user wants all tests than no other treatement of the test list is required
    300         if options.all or options.list or options.list_comp or options.include :
    301                 tests = all_tests
    302 
    303         #otherwise we need to validate that the test list that was entered is valid
    304         else :
    305                 tests = valid_tests( options )
    306 
    307         # make sure we have at least some test to run
    308         if not tests :
    309                 print('ERROR: No valid test to run', file=sys.stderr)
    310                 sys.exit(1)
    311 
    312 
    313         # sort the test alphabetically for convenience
    314         tests.sort(key=lambda t: (t.arch if t.arch else '') + t.target())
    315 
    316295        # users may want to simply list the tests
    317296        if options.list_comp :
     297                # fetch the liest of all valid tests
     298                tests = list_tests( None, None )
     299
     300                # sort the test alphabetically for convenience
     301                tests.sort(key=lambda t: (t.arch if t.arch else '') + t.target())
     302
     303                # print the possible options
    318304                print("-h --help --debug --dry-run --list --arch --all --regenerate-expected --archive-errors --install --timeout --global-timeout --timeout-with-gdb -j --jobs ", end='')
    319305                print(" ".join(map(lambda t: "%s" % (t.target()), tests)))
    320306
    321307        elif options.list :
     308                # fetch the liest of all valid tests
     309                tests = list_tests( options.include, options.exclude )
     310
     311                # sort the test alphabetically for convenience
     312                tests.sort(key=lambda t: (t.arch if t.arch else '') + t.target())
     313
     314                # print the available tests
    322315                print("Listing for %s:%s"% (settings.arch.string, settings.debug.string))
    323316                fancy_print("\n".join(map(lambda t: t.toString(), tests)))
    324317
    325318        else :
     319                # fetch the liest of all valid tests
     320                all_tests = list_tests( options.include, options.exclude )
     321
     322                # if user wants all tests than no other treatement of the test list is required
     323                if options.all or options.include :
     324                        tests = all_tests
     325
     326                #otherwise we need to validate that the test list that was entered is valid
     327                else :
     328                        tests = valid_tests( options )
     329
     330                # make sure we have at least some test to run
     331                if not tests :
     332                        print('ERROR: No valid test to run', file=sys.stderr)
     333                        sys.exit(1)
     334
     335                # sort the test alphabetically for convenience
     336                tests.sort(key=lambda t: (t.arch if t.arch else '') + t.target())
     337
    326338                # check the build configuration works
    327339                settings.prep_output(tests)
Note: See TracChangeset for help on using the changeset viewer.