Changes in src/tests/test.py [cb2e8ce:38736854]
- File:
-
- 1 edited
-
src/tests/test.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/tests/test.py
rcb2e8ce r38736854 23 23 # parses the Makefile to find the machine type (32-bit / 64-bit) 24 24 def 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) 29 31 30 32 # reads the directory ./.expect and indentifies the tests … … 97 99 return False 98 100 99 # find the test data for a given test name100 def filterTests(testname) :101 found = [test for test in allTests if test.name == testname]102 return (found[0] if len(found) == 1 else Test(testname, testname) )103 104 101 ################################################################################ 105 102 # running test functions … … 139 136 if not dry_run and fileContainsOnly(out_file, "make: *** No rule to make target `%s'. Stop." % test.name) : 140 137 retcode = 1; 141 error = "\t\tNo make target for test %s!" % test 138 error = "\t\tNo make target for test %s!" % test.name 142 139 sh("rm %s" % out_file, False) 143 140 … … 250 247 # already existing tests and create new info for the new tests 251 248 if options.regenerate_expected : 252 tests = map(filterTests, options.tests) 249 for testname in options.tests : 250 if testname.endswith(".c") or testname.endswith(".cc") or testname.endswith(".cpp") : 251 print('ERROR: "%s", tests are not allowed to end with a C/C++/CFA extension, ignoring it' % testname, file=sys.stderr) 252 else : 253 found = [test for test in allTests if test.name == testname] 254 tests.append( found[0] if len(found) == 1 else Test(testname, testname) ) 253 255 254 256 else :
Note:
See TracChangeset
for help on using the changeset viewer.