Changeset 0fc91db1


Ignore:
Timestamp:
Sep 15, 2022, 3:43:02 PM (19 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

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    r79ee5b3 r0fc91db1  
    2424#Trasforming cc1 will break compilation
    2525M4CFA_PROGRAM_NAME
    26 
    27 #==============================================================================
    28 # New AST toggling support
    29 AH_TEMPLATE([CFA_USE_NEW_AST],[Sets whether or not to use the new-ast, this is adefault value and can be overrided by --old-ast and --new-ast])
    30 DEFAULT_NEW_AST="True"
    31 AC_ARG_ENABLE(new-ast,
    32         [  --enable-new-ast     whether or not to use new ast as the default AST algorithm],
    33         [case "${enableval}" in
    34                 yes) newast=true ; DEFAULT_NEW_AST="True"  ;;
    35                 no)  newast=false; DEFAULT_NEW_AST="False" ;;
    36                 *) AC_MSG_ERROR([bad value ${enableval} for --enable-new-ast]) ;;
    37         esac],[newast=true])
    38 AC_DEFINE_UNQUOTED([CFA_USE_NEW_AST], $newast)
    39 AC_SUBST(DEFAULT_NEW_AST)
    4026
    4127#==============================================================================
     
    139125                \'--enable-gprofiler=*) ;;
    140126                \'--disable-gprofiler) ;;
    141 
    142                 # skip the target hosts
    143                 \'--enable-new-ast=*) ;;
    144                 \'--disable-new-ast) ;;
    145127
    146128                # skip this, it only causes problems
  • src/CompilationState.cc

    r79ee5b3 r0fc91db1  
    3131        genproto = false,
    3232        deterministic_output = false,
    33         useNewAST = CFA_USE_NEW_AST,
     33        useNewAST = true,
    3434        nomainp = false,
    3535        parsep = false,
  • src/config.h.in

    r79ee5b3 r0fc91db1  
    2727/* Location of cfa install. */
    2828#undef CFA_PREFIX
    29 
    30 /* Sets whether or not to use the new-ast, this is adefault value and can be
    31    overrided by --old-ast and --new-ast */
    32 #undef CFA_USE_NEW_AST
    3329
    3430/* Major.Minor */
  • tests/config.py.in

    r79ee5b3 r0fc91db1  
    99HOSTARCH = "@host_cpu@"
    1010DISTRIBUTE = @HAS_DISTCC@
    11 NEWAST = @DEFAULT_NEW_AST@
  • tests/pybin/settings.py

    r79ee5b3 r0fc91db1  
    9797                self.path   = "debug" if value else "nodebug"
    9898
    99 class AST:
    100         def __init__(self, ast):
    101                 if ast == "new":
    102                         self.target = ast
    103                         self.string = "New AST"
    104                         self.flags  = """"""
    105                 elif ast == "old":
    106                         self.target = ast
    107                         self.string = "Old AST"
    108                         self.flags  = """"""
    109                 elif ast == None:
    110                         self.target = "new" if config.NEWAST else "old"
    111                         self.string = "Default AST (%s)" % self.target
    112                         self.flags  = """"""
    113                 else:
    114                         print("""ERROR: Invalid ast configuration, must be "old", "new" or left unspecified, was %s""" % (value), file=sys.stderr)
    115                         sys.exit(1)
    116 
    117         def filter(self, tests):
    118 
    119                 return [test for test in tests if not test.astv or self.target == test.astv]
    120 
    12199class Install:
    122100        def __init__(self, value):
     
    141119
    142120def init( options ):
    143         global all_ast
    144121        global all_arch
    145122        global all_debug
    146123        global all_install
    147         global ast
    148124        global arch
    149125        global debug
     
    160136        global timeout2gdb
    161137
    162         all_ast      = [AST(o)          for o in list(dict.fromkeys(options.ast    ))] if options.ast  else [AST(None)]
    163138        all_arch     = [Architecture(o) for o in list(dict.fromkeys(options.arch   ))] if options.arch else [Architecture(None)]
    164139        all_debug    = [Debug(o)        for o in list(dict.fromkeys(options.debug  ))]
  • tests/pybin/test_run.py

    r79ee5b3 r0fc91db1  
    1111                self.path = ''
    1212                self.arch = ''
    13                 self.astv = ''
    1413
    1514        def toString(self):
    16                 return "{:25s} ({:5s} arch, {:s} ast: {:s})".format( self.name, self.arch if self.arch else "Any", self.astv if self.astv else "Any", self.target() )
     15                return "{:25s} ({:5s} arch: {:s})".format( self.name, self.arch if self.arch else "Any", self.target() )
    1716
    1817        def prepare(self):
     
    2221        def expect(self):
    2322                arch = '' if not self.arch else ".%s" % self.arch
    24                 astv = '' if not self.astv else ".nast" if self.astv == "new" else ".oast"
    25                 return os.path.normpath( os.path.join(settings.SRCDIR  , self.path, ".expect", "%s%s%s.txt" % (self.name,astv,arch)) )
     23                return os.path.normpath( os.path.join(settings.SRCDIR  , self.path, ".expect", "%s%s.txt" % (self.name,arch)) )
    2624
    2725        def error_log(self):
     
    5856
    5957        @staticmethod
    60         def new_target(target, arch, astv):
     58        def new_target(target, arch):
    6159                test = Test()
    6260                test.name = os.path.basename(target)
    6361                test.path = os.path.relpath (os.path.dirname(target), settings.SRCDIR)
    6462                test.arch = arch.target if arch else ''
    65                 test.astv = astv.target if astv else ''
    6663                return test
    6764
  • tests/pybin/tools.py

    r79ee5b3 r0fc91db1  
    182182                '-s' if silent else None,
    183183                test_param,
    184                 settings.ast.flags,
    185184                settings.arch.flags,
    186185                settings.debug.flags,
  • 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.