Changeset 0ad0c55 for src/tests/pybin


Ignore:
Timestamp:
Dec 4, 2017, 1:19:42 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, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
bacc36c
Parents:
b0e5593
Message:

Updated tests script to handle folders

Location:
src/tests/pybin
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/pybin/tools.py

    rb0e5593 r0ad0c55  
    4646        os.rename(out_fname, fname)
    4747
    48 # helper function to check if a files contains only a spacific string
     48# helper function to check if a files contains only a specific string
    4949def fileContainsOnly(file, text) :
    5050        with open(file) as f:
     
    9595        # fetch return code and error from the diff command
    9696        return sh(diff_cmd % (lhs, rhs), dry_run, False)
     97
     98# parses the Makefile to find the machine type (32-bit / 64-bit)
     99def getMachineType():
     100        return 'x64'
     101        sh('echo "void ?{}(int&a,int b){}int main(){return 0;}" > .dummy.c')
     102        ret, out = sh("make .dummy -s", print2stdout=True)
     103
     104        if ret != 0:
     105                print("Failed to identify architecture:")
     106                print(out)
     107                print("Stopping")
     108                rm( (".dummy.c",".dummy") )
     109                sys.exit(1)
     110
     111        _, out = sh("file .dummy", print2stdout=False)
     112        rm( (".dummy.c",".dummy") )
     113
     114        return out
     115        return re.search("ELF\s([0-9]+)-bit", out).group(1)
Note: See TracChangeset for help on using the changeset viewer.