Changeset 0ad0c55 for src/tests/pybin
- Timestamp:
- Dec 4, 2017, 1:19:42 PM (6 years ago)
- 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
- Location:
- src/tests/pybin
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/pybin/tools.py
rb0e5593 r0ad0c55 46 46 os.rename(out_fname, fname) 47 47 48 # helper function to check if a files contains only a sp acific string48 # helper function to check if a files contains only a specific string 49 49 def fileContainsOnly(file, text) : 50 50 with open(file) as f: … … 95 95 # fetch return code and error from the diff command 96 96 return sh(diff_cmd % (lhs, rhs), dry_run, False) 97 98 # parses the Makefile to find the machine type (32-bit / 64-bit) 99 def 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.