Changeset 20340c2


Ignore:
Timestamp:
Jul 16, 2016, 10:45:34 AM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
920725d
Parents:
873ffb7
Message:

test now uses compiler to know to run 32-bit or 64-bit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/test.py

    r873ffb7 r20340c2  
    2323# parses the Makefile to find the machine type (32-bit / 64-bit)
    2424def getMachineType():
    25         with open('Makefile') as file:
    26                 makefile = file.read()
    27                 m = re.search("CFA_FLAGS\s*=\s*-m(.*)", makefile)
    28                 return m.group(1) if m else '64'
     25        sh('echo "int main() { return 0; }" > .dummy.c')
     26        sh("make .dummy", print2stdout=False)
     27        _, out = sh("file .dummy", print2stdout=False)
     28        sh("rm -f .dummy.c > /dev/null 2>&1")
     29        sh("rm -f .dummy > /dev/null 2>&1")
     30        return re.search("ELF\s([0-9]+)-bit", out).group(1)
    2931
    3032# reads the directory ./.expect and indentifies the tests
    3133def listTests():
    3234        machineType = getMachineType()
     35
     36        print(machineType)
    3337
    3438        # tests directly in the .expect folder will always be processed
Note: See TracChangeset for help on using the changeset viewer.