Changeset 552f5cb


Ignore:
Timestamp:
Jul 23, 2018, 4:56:25 PM (6 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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
cbdf565
Parents:
f85bc15
Message:

Tests now get default architecture from GNU build system instead of creating a dummy executable

Location:
src/tests
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/tests/Makefile.am

    rf85bc15 r552f5cb  
    7070        @+${TEST_PY} --debug=${debug} -Iconcurrent
    7171
    72 .dummy : .dummy.c @CFA_BINDIR@/@CFA_NAME@
    73         ${CC} ${BUILD_FLAGS} -XCFA -n ${<} -o ${@}                              #don't use CFLAGS, this rule is not a real test
    74 
    75 
    7672% : ${srcdir}/%.c @CFA_BINDIR@/@CFA_NAME@
    7773        ${CC} ${AM_CFLAGS} ${CFLAGS} $(abspath ${<}) -o ${@}
  • src/tests/Makefile.in

    rf85bc15 r552f5cb  
    768768        @+${TEST_PY} --debug=${debug} -Iconcurrent
    769769
    770 .dummy : .dummy.c @CFA_BINDIR@/@CFA_NAME@
    771         ${CC} ${BUILD_FLAGS} -XCFA -n ${<} -o ${@}                              #don't use CFLAGS, this rule is not a real test
    772 
    773770% : ${srcdir}/%.c @CFA_BINDIR@/@CFA_NAME@
    774771        ${CC} ${AM_CFLAGS} ${CFLAGS} $(abspath ${<}) -o ${@}
  • src/tests/config.py.in

    rf85bc15 r552f5cb  
    77SRCDIR   = "@srcdir@"
    88BUILDDIR = "@builddir@"
     9HOSTARCH = "@host_cpu@"
  • src/tests/pybin/settings.py

    rf85bc15 r552f5cb  
    66try :
    77        sys.path.append(os.getcwd())
    8         from config import *
     8        import config
    99
    10         SRCDIR = os.path.abspath(SRCDIR)
    11         BUILDDIR = os.path.abspath(BUILDDIR)
     10        SRCDIR = os.path.abspath(config.SRCDIR)
     11        BUILDDIR = os.path.abspath(config.BUILDDIR)
    1212except:
    1313        print('ERROR: missing config.py, re-run configure script.', file=sys.stderr)
     
    1818                'x64'                   : 'x64',
    1919                'x86-64'                : 'x64',
     20                'x86_64'                : 'x64',
    2021                'x86'                   : 'x86',
    2122                'i386'          : 'x86',
     
    3839                        self.cross_compile = False
    3940                        try:
    40                                 arch = machine_default()
     41                                arch = config.HOSTARCH
    4142                                self.target = Architecture.makeCanonical( arch )
    4243                        except KeyError:
     
    8485
    8586        make = "make" if not force else ("make -j%i" % jobs)
    86 
    87 
    88 def set_machine_default( func ):
    89         global machine_default
    90 
    91         machine_default = func
  • src/tests/pybin/tools.py

    rf85bc15 r552f5cb  
    170170#               system
    171171################################################################################
    172 
    173 # parses the Makefile to find the machine type (32-bit / 64-bit)
    174 def getMachineType():
    175         sh('echo "void ?{}(int&a,int b){}int main(){return 0;}" > .dummy.c')
    176         ret, out = make('.dummy', silent = True)
    177 
    178         if ret != 0:
    179                 print("Failed to identify architecture:")
    180                 print(out)
    181                 print("Stopping")
    182                 rm( (".dummy.c",".dummy") )
    183                 sys.exit(1)
    184 
    185         _, out = sh("file .dummy", print2stdout=False)
    186         rm( (".dummy.c",".dummy") )
    187 
    188         if settings.dry_run :
    189                 return 'x64'
    190 
    191         return re.search(r"[^,]+,([^,]+),", out).group(1).strip()
    192 
    193172# count number of jobs to create
    194173def jobCount( options, tests ):
     
    254233        else:
    255234                print(text)
    256 
    257 settings.set_machine_default( getMachineType )
Note: See TracChangeset for help on using the changeset viewer.