Lines Matching refs:testinstance
21 from twisterlib.testinstance import TestInstance
71 testinstance = TestInstance(testsuite, platform, class_testplan.env.outdir)
81 run = testinstance.check_runnable(env.options)
87 run = testinstance.check_runnable(env.options)
92 run = testinstance.check_runnable(env.options)
150 testinstance = TestInstance(testcase, platform, class_testplan.env.outdir)
152 …assert testinstance.create_overlay(platform, enable_asan, enable_ubsan, enable_coverage, coverage_…
161 testinstance = TestInstance(testcase, platform, class_testplan.env.outdir)
164 assert testinstance.calculate_sizes() == "Missing/multiple output ELF binary"
213 testinstance = TestInstance(testsuite, platform, class_testplan.env.outdir)
214 return testinstance
231 testinstance = TestInstance(testsuite, platform, class_testplan.env.outdir)
234 …assert testinstance.build_dir == os.path.join(class_testplan.env.outdir, platform.normalized_name,…
236 …assert testinstance.build_dir == os.path.join(class_testplan.env.outdir, platform.normalized_name,…
240 def test_testinstance_record(testinstance): argument
241 testinstance.testcases = [mock.Mock()]
257 testinstance.record(recording)
262 os.path.join(testinstance.build_dir, 'recording.csv'),
271 def test_testinstance_add_filter(testinstance): argument
275 testinstance.add_filter(reason, filter_type)
277 assert {'type': filter_type, 'reason': reason} in testinstance.filters
278 assert testinstance.status == TwisterStatus.FILTER
279 assert testinstance.reason == reason
280 assert testinstance.filter_type == filter_type
290 testinstance = TestInstance(testsuite, platform, class_testplan.env.outdir)
292 testinstance.init_cases()
299 for tcc in testinstance.testsuite.testcases
307 def test_testinstance_get_run_id(testinstance): argument
308 res = testinstance._get_run_id()
320 def test_testinstance_add_missing_case_status(testinstance, reason, expected_reason): argument
321 testinstance.reason = 'dummy reason'
325 assert len(testinstance.testcases) > 1, 'Selected testsuite does not have enough testcases.'
327 testinstance.testcases[0].status = TwisterStatus.STARTED
328 testinstance.testcases[-1].status = TwisterStatus.NONE
330 testinstance.add_missing_case_status(status, reason)
332 assert testinstance.testcases[0].status == TwisterStatus.FAIL
333 assert testinstance.testcases[-1].status == TwisterStatus.PASS
334 assert testinstance.testcases[-1].reason == expected_reason
344 testinstance = TestInstance(testsuite, platform, class_testplan.env.outdir)
347 d = testinstance.__getstate__()
353 testinstance.__setstate__(d)
355 assert testinstance < testinstance_copy
359 assert not testinstance < testinstance_copy
360 assert not testinstance_copy < testinstance
362 assert testinstance.__repr__() == f'<TestSuite {testsuite_path} on demo_board_2/unit_testing>'
366 def test_testinstance_set_case_status_by_name(testinstance): argument
371 tc = testinstance.set_case_status_by_name(name, status, reason)
377 tc = testinstance.set_case_status_by_name(name, status, None)
383 def test_testinstance_add_testcase(testinstance): argument
387 tc = testinstance.add_testcase(name, freeform)
389 assert tc in testinstance.testcases
393 def test_testinstance_get_case_by_name(testinstance): argument
396 tc = testinstance.get_case_by_name(name)
402 tc = testinstance.get_case_by_name(name)
408 def test_testinstance_get_case_or_create(caplog, testinstance): argument
411 tc = testinstance.get_case_or_create(name)
417 tc = testinstance.get_case_or_create(name)
474 testinstance,
483 testinstance.handler = mock.Mock() if preexisting_handler else None
484 …testinstance.platform.simulators = [Simulator({"name": platform_sim, "exec": 'dummy exec'})] if pl…
485 testinstance.testsuite.type = testsuite_type
496 testinstance.setup_handler(env)
499 assert testinstance.handler.type_str == expected_handler_type
500 assert testinstance.handler.ready == expected_handler_ready
501 assert all([arg in testinstance.handler.args for arg in expected_handler_args])
537 testinstance,
551 … testinstance.platform.simulators = [Simulator({"name": platform_sim, "exec": platform_sim_exec})]
552 testinstance.testsuite.build_only = testsuite_build_only
553 testinstance.testsuite.slow = testsuite_slow
554 testinstance.testsuite.harness = testsuite_harness
567 res = testinstance.check_runnable(env.options, hardware_map)
579 def test_testinstance_calculate_sizes(testinstance, from_buildlog, expected_buildlog_filepath): argument
583 testinstance.get_elf_file = mock.Mock(return_value='dummy.elf')
584 testinstance.get_buildlog_file = mock.Mock(return_value='build.log')
590 res = testinstance.calculate_sizes(from_buildlog, expected_warning)
608 def test_testinstance_get_elf_file(caplog, tmp_path, testinstance, sysbuild, expected_error): argument
618 testinstance.sysbuild = sysbuild
619 testinstance.domains = mock.Mock(
628 testinstance.get_elf_file()
641 def test_testinstance_get_buildlog_file(tmp_path, testinstance, create_build_log, expected_error): argument
647 testinstance.build_dir = build_dir
650 res = testinstance.get_buildlog_file()