Changeset be65cca for src/tests/test.py
- Timestamp:
- Mar 1, 2017, 3:13:04 PM (8 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:
- a62cbb3
- Parents:
- 60401b76
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/test.py
r60401b76 rbe65cca 32 32 return re.search("ELF\s([0-9]+)-bit", out).group(1) 33 33 34 # reads the directory ./.expect and indentifies the tests 35 def listTests(): 36 machineType = getMachineType() 34 def listTestsFolder(folder) : 35 path = ('./.expect/%s' % folder) if folder else './expect' 37 36 38 37 # tests directly in the .expect folder will always be processed 39 generic_list = map(lambda fname: Test(fname, fname),40 [splitext(f)[0] for f in listdir( './.expect')38 return map(lambda fname: Test(fname, '%s/%s' % (path, fname)), 39 [splitext(f)[0] for f in listdir( path ) 41 40 if not f.startswith('.') and f.endswith('.txt') 42 41 ]) 43 42 43 # reads the directory ./.expect and indentifies the tests 44 def listTests( concurrent ): 45 machineType = getMachineType() 46 47 # tests directly in the .expect folder will always be processed 48 generic_list = listTestsFolder( "." ) 49 44 50 # tests in the machineType folder will be ran only for the corresponding compiler 45 typed_list = map(lambda fname: Test( fname, "%s/%s" % (machineType, fname) ),46 [splitext(f)[0] for f in listdir("./.expect/%s" % machineType) 47 if not f.startswith('.') and f.endswith('.txt')48 ])51 typed_list = listTestsFolder( machineType ) 52 53 # tests in the concurrent folder will be ran only if concurrency is enabled 54 concurrent_list = listTestsFolder( "concurrent" ) if concurrent else [] 49 55 50 56 # append both lists to get 51 return generic_list + typed_list 57 return generic_list + typed_list + concurrent_list; 52 58 53 59 # helper functions to run terminal commands … … 194 200 sys.stderr.flush() 195 201 return test_failed 196 202 197 203 except KeyboardInterrupt: 198 204 test_failed = True … … 243 249 parser = argparse.ArgumentParser(description='Script which runs cforall tests') 244 250 parser.add_argument('--debug', help='Run all tests in debug or release', type=yes_no, default='no') 251 parser.add_argument('--concurrent', help='Run concurrent tests', type=yes_no, default='no') 245 252 parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true') 246 253 parser.add_argument('--list', help='List all test available', action='store_true') … … 260 267 sys.exit(1) 261 268 269 print( options.concurrent ) 270 262 271 # fetch the liest of all valid tests 263 allTests = listTests( )272 allTests = listTests( options.concurrent ) 264 273 265 274 # if user wants all tests than no other treatement of the test list is required
Note: See TracChangeset
for help on using the changeset viewer.