Changeset 0fc91db1 for tests/test.py


Ignore:
Timestamp:
Sep 15, 2022, 3:43:02 PM (22 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
597e395
Parents:
79ee5b3
Message:

Removed old ast from configure and tests.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/test.py

    r79ee5b3 r0fc91db1  
    2323
    2424        def match_test(path):
    25                 match = re.search("^%s\/([\w\/\-_]*).expect\/([\w\-_]+)(\.nast|\.oast)?(\.[\w\-_]+)?\.txt$" % settings.SRCDIR, path)
     25                match = re.search("^%s\/([\w\/\-_]*).expect\/([\w\-_]+)(\.[\w\-_]+)?\.txt$" % settings.SRCDIR, path)
    2626                if match :
    2727                        test = Test()
    2828                        test.name = match.group(2)
    2929                        test.path = match.group(1)
    30                         test.arch = match.group(4)[1:] if match.group(4) else None
    31 
    32                         astv = match.group(3)[1:] if match.group(3) else None
    33                         if astv == 'oast':
    34                                 test.astv = 'old'
    35                         elif astv == 'nast':
    36                                 test.astv = 'new'
    37                         elif astv:
    38                                 print('ERROR: "%s", expect file has astv but it is not "nast" or "oast"' % testname, file=sys.stderr)
    39                                 sys.exit(1)
     30                        test.arch = match.group(3)[1:] if match.group(3) else None
    4031
    4132                        expected.append(test)
     
    8172                                # this is a valid name, let's check if it already exists
    8273                                found = [test for test in all_tests if canonical_path( test.target() ) == testname]
    83                                 setup = itertools.product(settings.all_arch if options.arch else [None], settings.all_ast if options.ast else [None])
     74                                setup = itertools.product(settings.all_arch if options.arch else [None])
    8475                                if not found:
    85                                         # it's a new name, create it according to the name and specified architecture/ast version
    86                                         tests.extend( [Test.new_target(testname, arch, ast) for arch, ast in setup] )
     76                                        # it's a new name, create it according to the name and specified architecture
     77                                        tests.extend( [Test.new_target(testname, arch) for arch in setup] )
    8778                                elif len(found) == 1 and not found[0].arch:
    8879                                        # we found a single test, the user better be wanting to create a cross platform test
    8980                                        if options.arch:
    9081                                                print('ERROR: "%s", test has no specified architecture but --arch was specified, ignoring it' % testname, file=sys.stderr)
    91                                         elif options.ast:
    92                                                 print('ERROR: "%s", test has no specified ast version but --ast was specified, ignoring it' % testname, file=sys.stderr)
    9382                                        else:
    9483                                                tests.append( found[0] )
    9584                                else:
    9685                                        # this test is already cross platform, just add a test for each platform the user asked
    97                                         tests.extend( [Test.new_target(testname, arch, ast) for arch, ast in setup] )
     86                                        tests.extend( [Test.new_target(testname, arch) for arch in setup] )
    9887
    9988                                        # print a warning if it users didn't ask for a specific architecture
     
    10291                                                print('WARNING: "%s", test has architecture specific expected files but --arch was not specified, regenerating only for current host' % testname, file=sys.stderr)
    10392
    104 
    105                                         # print a warning if it users didn't ask for a specific ast version
    106                                         found_astv = [f.astv for f in found if f.astv]
    107                                         if found_astv and not options.ast:
    108                                                 print('WARNING: "%s", test has ast version specific expected files but --ast was not specified, regenerating only for current ast' % testname, file=sys.stderr)
    109 
    11093                        else :
    11194                                print('ERROR: "%s", tests are not allowed to end with a C/C++/CFA extension, ignoring it' % testname, file=sys.stderr)
     
    127110        # create a parser with the arguments for the tests script
    128111        parser = argparse.ArgumentParser(description='Script which runs cforall tests')
    129         parser.add_argument('--ast', help='Test for specific ast', type=comma_separated(str), default=None)
    130112        parser.add_argument('--arch', help='Test for specific architecture', type=comma_separated(str), default=None)
    131113        parser.add_argument('--debug', help='Run all tests in debug or release', type=comma_separated(yes_no), default='yes')
     
    422404        # for each build configurations, run the test
    423405        with Timed() as total_dur:
    424                 for ast, arch, debug, install in itertools.product(settings.all_ast, settings.all_arch, settings.all_debug, settings.all_install):
    425                         settings.ast     = ast
     406                for arch, debug, install in itertools.product(settings.all_arch, settings.all_debug, settings.all_install):
    426407                        settings.arch    = arch
    427408                        settings.debug   = debug
     
    430411                        # filter out the tests for a different architecture
    431412                        # tests are the same across debug/install
    432                         local_tests = settings.ast.filter( tests )
    433                         local_tests = settings.arch.filter( local_tests )
     413                        local_tests = settings.arch.filter( tests )
    434414
    435415                        # check the build configuration works
     
    438418
    439419                        # print configuration
    440                         print('%s %i tests on %i cores (%s:%s - %s)' % (
     420                        print('%s %i tests on %i cores (%s - %s)' % (
    441421                                'Regenerating' if settings.generating else 'Running',
    442422                                len(local_tests),
    443423                                jobs,
    444                                 settings.ast.string,
    445424                                settings.arch.string,
    446425                                settings.debug.string
Note: See TracChangeset for help on using the changeset viewer.