def run_test_case_on_index(i, tested_commit, with_resume): """Runs a test case on the given index for the given tested commit.""" global cmd_runner global db global lock global stop_testing global test_cases global tools_dir test_case = test_cases[i] # Should we stop testing? See install_stop_testing_handler() for more # details. if stop_testing: return NoTestResults(test_case.module_name, test_case.name) # Check whether the test case should run. We only need to consult the # database if resume is requested, i.e. when only running tests that have # not run yet. test_case_should_run = True if with_resume: with lock: test_case_should_run = not db.has_test_run_for_commit( test_case.module_name, test_case.name, tested_commit) if test_case_should_run: tool_runner = test_case.test_settings.get_tool_runner( cmd_runner, tools_dir) test_results = run_test_case(test_case, tool_runner) with lock: db.insert_test_results(test_results, tested_commit) print_test_results(test_results) else: test_results = NoTestResults(test_case.module_name, test_case.name) return test_results
def run_test_case_on_index(i): """Runs a test case on the given index.""" global cmd_runner global lock global test_cases global tools_dir test_case = test_cases[i] tool_runner = test_case.test_settings.get_tool_runner( cmd_runner, tools_dir) test_results = run_test_case(test_case, tool_runner) with lock: print_test_results(test_results) return test_results