Lines Matching refs:testinstance
21 from twisterlib.testinstance import TestInstance
66 testinstance = TestInstance(testsuite, platform, 'zephyr', class_testplan.env.outdir)
76 run = testinstance.check_runnable(env.options)
82 run = testinstance.check_runnable(env.options)
87 run = testinstance.check_runnable(env.options)
145 testinstance = TestInstance(testcase, platform, 'zephyr', class_testplan.env.outdir)
147 …assert testinstance.create_overlay(platform, enable_asan, enable_ubsan, enable_coverage, coverage_…
156 testinstance = TestInstance(testcase, platform, 'zephyr', class_testplan.env.outdir)
159 assert testinstance.calculate_sizes() == "Missing/multiple output ELF binary"
208 testinstance = TestInstance(testsuite, platform, 'zephyr', class_testplan.env.outdir)
209 return testinstance
226 testinstance = TestInstance(testsuite, platform, 'zephyr', class_testplan.env.outdir)
229 …assert testinstance.build_dir == os.path.join(class_testplan.env.outdir, platform.normalized_name,…
231 …assert testinstance.build_dir == os.path.join(class_testplan.env.outdir, platform.normalized_name,…
235 def test_testinstance_record(testinstance): argument
236 testinstance.testcases = [mock.Mock()]
252 testinstance.record(recording)
257 os.path.join(testinstance.build_dir, 'recording.csv'),
266 def test_testinstance_add_filter(testinstance): argument
270 testinstance.add_filter(reason, filter_type)
272 assert {'type': filter_type, 'reason': reason} in testinstance.filters
273 assert testinstance.status == TwisterStatus.FILTER
274 assert testinstance.reason == reason
275 assert testinstance.filter_type == filter_type
285 testinstance = TestInstance(testsuite, platform, 'zephyr', class_testplan.env.outdir)
287 testinstance.init_cases()
294 for tcc in testinstance.testsuite.testcases
302 def test_testinstance_get_run_id(testinstance): argument
303 res = testinstance._get_run_id()
315 def test_testinstance_add_missing_case_status(testinstance, reason, expected_reason): argument
316 testinstance.reason = 'dummy reason'
320 assert len(testinstance.testcases) > 1, 'Selected testsuite does not have enough testcases.'
322 testinstance.testcases[0].status = TwisterStatus.STARTED
323 testinstance.testcases[-1].status = TwisterStatus.NONE
325 testinstance.add_missing_case_status(status, reason)
327 assert testinstance.testcases[0].status == TwisterStatus.FAIL
328 assert testinstance.testcases[-1].status == TwisterStatus.PASS
329 assert testinstance.testcases[-1].reason == expected_reason
339 testinstance = TestInstance(testsuite, platform, 'zephyr', class_testplan.env.outdir)
342 d = testinstance.__getstate__()
348 testinstance.__setstate__(d)
350 assert testinstance < testinstance_copy
354 assert not testinstance < testinstance_copy
355 assert not testinstance_copy < testinstance
357 assert testinstance.__repr__() == f'<TestSuite {testsuite_path} on demo_board_2/unit_testing>'
361 def test_testinstance_set_case_status_by_name(testinstance): argument
366 tc = testinstance.set_case_status_by_name(name, status, reason)
372 tc = testinstance.set_case_status_by_name(name, status, None)
378 def test_testinstance_add_testcase(testinstance): argument
382 tc = testinstance.add_testcase(name, freeform)
384 assert tc in testinstance.testcases
388 def test_testinstance_get_case_by_name(testinstance): argument
391 tc = testinstance.get_case_by_name(name)
397 tc = testinstance.get_case_by_name(name)
403 def test_testinstance_get_case_or_create(caplog, testinstance): argument
406 tc = testinstance.get_case_or_create(name)
412 tc = testinstance.get_case_or_create(name)
469 testinstance,
478 testinstance.handler = mock.Mock() if preexisting_handler else None
479 …testinstance.platform.simulators = [Simulator({"name": platform_sim, "exec": 'dummy exec'})] if pl…
480 testinstance.testsuite.type = testsuite_type
491 testinstance.setup_handler(env)
494 assert testinstance.handler.type_str == expected_handler_type
495 assert testinstance.handler.ready == expected_handler_ready
496 assert all([arg in testinstance.handler.args for arg in expected_handler_args])
532 testinstance,
546 … testinstance.platform.simulators = [Simulator({"name": platform_sim, "exec": platform_sim_exec})]
547 testinstance.testsuite.build_only = testsuite_build_only
548 testinstance.testsuite.slow = testsuite_slow
549 testinstance.testsuite.harness = testsuite_harness
562 res = testinstance.check_runnable(env.options, hardware_map)
574 def test_testinstance_calculate_sizes(testinstance, from_buildlog, expected_buildlog_filepath): argument
578 testinstance.get_elf_file = mock.Mock(return_value='dummy.elf')
579 testinstance.get_buildlog_file = mock.Mock(return_value='build.log')
585 res = testinstance.calculate_sizes(from_buildlog, expected_warning)
603 def test_testinstance_get_elf_file(caplog, tmp_path, testinstance, sysbuild, expected_error): argument
613 testinstance.sysbuild = sysbuild
614 testinstance.domains = mock.Mock(
623 testinstance.get_elf_file()
636 def test_testinstance_get_buildlog_file(tmp_path, testinstance, create_build_log, expected_error): argument
642 testinstance.build_dir = build_dir
645 res = testinstance.get_buildlog_file()
682 testinstance = TestInstance(testsuite, platform,'zephyr', class_testplan.env.outdir)
683 assert testinstance.create_overlay(platform) == expected_content