def _itemized(tests): bugs = [nt.macro_name for nt in tests if td.is_bug(nt)] demos = ['Demo%d' % nt.id for nt in tests if td.is_demo(nt)] sas = [nt.macro_name for nt in tests if td.is_sa(nt)] sts = [nt.macro_name for nt in tests if td.is_simtool(nt)] all_tests = itertools.chain.from_iterable([demos, bugs, sas, sts]) return strings.itemized(list(all_tests))
def _test_files(test_cases): bugs = [nt for nt in test_cases if tests_definition.is_bug(nt)] demos = [nt for nt in test_cases if tests_definition.is_demo(nt)] sas = [nt for nt in test_cases if tests_definition.is_sa(nt)] files = ['test/test_demo%02d.py' % nt.id for nt in demos] if len(bugs) > 0: files.append('test/test_bugs.py') if len(sas) > 0: files.append('test/test_simulation_assistants.py') assert len(files) > 0, 'No test file retrieved' return ' '.join(files)
def run_tests(options): print_overview(options) print(strings.line()) overall_time = timer.ExecutionTime(key='All Tests') print(strings.line() + '\n') # Bug and SimAssistant files are not copied at this time. demos = [nt for nt in options.test_cases if td.is_demo(nt)] demo_files_2d = [_demo_files(options, nt) for nt in demos] files = list(itertools.chain.from_iterable(demo_files_2d)) set_up.environment(options.data_home, options.demo_home, options.jar_file, options.star_home, options.test_home, files) run_step1(options, options.test_cases) run_step2(options, options.test_cases) overall_time.finalize(extra_info='All Tests')
def run_tests(options): print_overview(options) print(strings.line()) overall_time = timer.ExecutionTime(key='All Tests') print(strings.line() + '\n') # Bug and SimAssistant files are not copied at this time. demos = [nt for nt in options.test_cases if tests_definition.is_demo(nt)] demo_files_2d = [_demo_files(options, nt) for nt in demos] files = list(itertools.chain.from_iterable(demo_files_2d)) set_up.environment(options.datahome, options.demohome, options.jarfile, options.starhome, options.testhome, files) run_step1(options, options.test_cases) run_step2(options, options.test_cases) overall_time.finalize(extra_info='All Tests')
def _commands_from_test(options, test_case): if td.is_demo(test_case): return _commands_from_demo(options, test_case) else: # Bugs are not run in step1 return None
def _commands_from_test(options, test_case): if tests_definition.is_demo(test_case): return _commands_from_demo(options, test_case) else: # Bugs are not run in step1 return None
def _itemized(tests): bugs = [nt.macro_name for nt in tests if tests_definition.is_bug(nt)] demos = ['Demo%d' % nt.id for nt in tests if tests_definition.is_demo(nt)] sas = [nt.macro_name for nt in tests if tests_definition.is_sa(nt)] all_tests = itertools.chain.from_iterable([demos, bugs, sas]) return strings.itemized(list(all_tests))