Changeset cdbab55 for tests/test.py
- Timestamp:
- Aug 21, 2018, 2:24:29 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 2a6292d
- Parents:
- 2b79a70 (diff), efa8b6a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 moved
-
tests/test.py (moved) (moved from src/tests/test.py ) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/test.py
r2b79a70 rcdbab55 85 85 # create a parser with the arguments for the tests script 86 86 parser = argparse.ArgumentParser(description='Script which runs cforall tests') 87 parser.add_argument('--debug', help='Run all tests in debug or release', type=yes_no, default='no') 87 parser.add_argument('--debug', help='Run all tests in debug or release', type=yes_no, default='yes') 88 parser.add_argument('--install', help='Run all tests based on installed binaries or tree binaries', type=yes_no, default='no') 88 89 parser.add_argument('--arch', help='Test for specific architecture', type=str, default='') 90 parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=60) 91 parser.add_argument('--global-timeout', help='Maximum cumulative duration in seconds after the ALL tests are considered to have timed out', type=int, default=7200) 89 92 parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true') 90 93 parser.add_argument('--list', help='List all test available', action='store_true') … … 97 100 parser.add_argument('tests', metavar='test', type=str, nargs='*', help='a list of tests to run') 98 101 99 options = parser.parse_args() 102 try: 103 options = parser.parse_args() 104 except: 105 print('ERROR: invalid arguments', file=sys.stderr) 106 parser.print_help(sys.stderr) 107 sys.exit(1) 100 108 101 109 # script must have at least some tests to run or be listing … … 154 162 if settings.dry_run or fileIsExecutable(exe_file) : 155 163 # run test 156 retcode, _ = sh("timeout 60 %s > %s 2>&1" % (exe_file, out_file), input = in_file)164 retcode, _ = sh("timeout %d %s > %s 2>&1" % (settings.timeout.single, exe_file, out_file), input = in_file) 157 165 else : 158 166 # simply cat the result into the output … … 166 174 167 175 if retcode == 0: 176 # fixoutput(out_file) 168 177 if settings.generating : 169 178 # if we are ounly generating the output we still need to check that the test actually exists … … 176 185 else : 177 186 # fetch return code and error from the diff command 178 fixoutput(out_file)179 187 retcode, error = diff(cmp_file, out_file) 180 188 … … 228 236 tests, 229 237 chunksize = 1 230 ).get( 7200)238 ).get(settings.timeout.total) 231 239 except KeyboardInterrupt: 232 240 pool.terminate() … … 277 285 # users may want to simply list the tests 278 286 if options.list_comp : 279 print("-h --help --debug --dry-run --list --arch --all --regenerate-expected - j --jobs ", end='')287 print("-h --help --debug --dry-run --list --arch --all --regenerate-expected --install --timeout --global-timeout -j --jobs ", end='') 280 288 print(" ".join(map(lambda t: "%s" % (t.target()), tests))) 281 289 … … 285 293 286 294 else : 295 # check the build configuration works 296 settings.validate() 297 287 298 options.jobs, forceJobs = jobCount( options, tests ) 288 299 settings.updateMakeCmd(forceJobs, options.jobs)
Note:
See TracChangeset
for help on using the changeset viewer.