@@ -68,32 +68,40 @@ def test_check_build_or_run(
6868 testsuite .slow = slow
6969
7070 testinstance = TestInstance (testsuite , platform , class_testplan .env .outdir )
71- run = testinstance .check_runnable (slow , device_testing , fixture )
71+ env = mock .Mock (
72+ options = mock .Mock (
73+ device_testing = False ,
74+ enable_slow = slow ,
75+ fixtures = fixture ,
76+ filter = ""
77+ )
78+ )
79+ run = testinstance .check_runnable (env .options )
7280 _ , r = expected
7381 assert run == r
7482
7583 with mock .patch ('os.name' , 'nt' ):
7684 # path to QEMU binary is not in QEMU_BIN_PATH environment variable
77- run = testinstance .check_runnable ()
85+ run = testinstance .check_runnable (env . options )
7886 assert not run
7987
8088 # mock path to QEMU binary in QEMU_BIN_PATH environment variable
8189 with mock .patch ('os.environ' , {'QEMU_BIN_PATH' : '' }):
82- run = testinstance .check_runnable ()
90+ run = testinstance .check_runnable (env . options )
8391 _ , r = expected
8492 assert run == r
8593
8694
8795TESTDATA_PART_2 = [
88- (True , True , True , ["demo_board_2" ], "native" ,
96+ (True , True , True , ["demo_board_2/unit_testing " ], "native" ,
8997 None , '\n CONFIG_COVERAGE=y\n CONFIG_COVERAGE_DUMP=y\n CONFIG_ASAN=y\n CONFIG_UBSAN=y' ),
90- (True , False , True , ["demo_board_2" ], "native" ,
98+ (True , False , True , ["demo_board_2/unit_testing " ], "native" ,
9199 None , '\n CONFIG_COVERAGE=y\n CONFIG_COVERAGE_DUMP=y\n CONFIG_ASAN=y' ),
92- (False , False , True , ["demo_board_2" ], 'native' ,
100+ (False , False , True , ["demo_board_2/unit_testing " ], 'native' ,
93101 None , '\n CONFIG_COVERAGE=y\n CONFIG_COVERAGE_DUMP=y' ),
94- (True , False , True , ["demo_board_2" ], 'mcu' ,
102+ (True , False , True , ["demo_board_2/unit_testing " ], 'mcu' ,
95103 None , '\n CONFIG_COVERAGE=y\n CONFIG_COVERAGE_DUMP=y' ),
96- (False , False , False , ["demo_board_2" ], 'native' , None , '' ),
104+ (False , False , False , ["demo_board_2/unit_testing " ], 'native' , None , '' ),
97105 (False , False , True , ['demo_board_1' ], 'native' , None , '' ),
98106 (True , False , False , ["demo_board_2" ], 'native' , None , '\n CONFIG_ASAN=y' ),
99107 (False , True , False , ["demo_board_2" ], 'native' , None , '\n CONFIG_UBSAN=y' ),
@@ -104,7 +112,7 @@ def test_check_build_or_run(
104112 (False , False , False , ["demo_board_2" ], 'native' ,
105113 ["arch:arm:CONFIG_LOG=y" ], '' ),
106114 (False , False , False , ["demo_board_2" ], 'native' ,
107- ["platform:demo_board_2:CONFIG_LOG=y" ], 'CONFIG_LOG=y' ),
115+ ["platform:demo_board_2/unit_testing :CONFIG_LOG=y" ], 'CONFIG_LOG=y' ),
108116 (False , False , False , ["demo_board_2" ], 'native' ,
109117 ["platform:demo_board_1:CONFIG_LOG=y" ], '' ),
110118]
@@ -216,15 +224,14 @@ def test_testinstance_init(all_testsuites_dict, class_testplan, platforms_list,
216224 testsuite = class_testplan .testsuites .get (testsuite_path )
217225 testsuite .detailed_test_id = detailed_test_id
218226 class_testplan .platforms = platforms_list
219- print (class_testplan .platforms )
220- platform = class_testplan .get_platform ("demo_board_2" )
227+ platform = class_testplan .get_platform ("demo_board_2/unit_testing" )
221228
222229 testinstance = TestInstance (testsuite , platform , class_testplan .env .outdir )
223230
224231 if detailed_test_id :
225- assert testinstance .build_dir == os .path .join (class_testplan .env .outdir , platform .name , testsuite_path )
232+ assert testinstance .build_dir == os .path .join (class_testplan .env .outdir , platform .normalized_name , testsuite_path )
226233 else :
227- assert testinstance .build_dir == os .path .join (class_testplan .env .outdir , platform .name , testsuite .source_dir_rel , testsuite .name )
234+ assert testinstance .build_dir == os .path .join (class_testplan .env .outdir , platform .normalized_name , testsuite .source_dir_rel , testsuite .name )
228235
229236
230237@pytest .mark .parametrize ('testinstance' , [{'testsuite_kind' : 'sample' }], indirect = True )
@@ -350,7 +357,7 @@ def test_testinstance_dunders(all_testsuites_dict, class_testplan, platforms_lis
350357 assert not testinstance < testinstance_copy
351358 assert not testinstance_copy < testinstance
352359
353- assert testinstance .__repr__ () == f'<TestSuite { testsuite_path } on demo_board_2>'
360+ assert testinstance .__repr__ () == f'<TestSuite { testsuite_path } on demo_board_2/unit_testing >'
354361
355362
356363@pytest .mark .parametrize ('testinstance' , [{'testsuite_kind' : 'tests' }], indirect = True )
@@ -545,9 +552,17 @@ def test_testinstance_check_runnable(
545552 testinstance .testsuite .slow = testsuite_slow
546553 testinstance .testsuite .harness = testsuite_harness
547554
555+ env = mock .Mock (
556+ options = mock .Mock (
557+ device_testing = False ,
558+ enable_slow = enable_slow ,
559+ fixtures = fixtures ,
560+ filter = filter
561+ )
562+ )
548563 with mock .patch ('os.name' , os_name ), \
549564 mock .patch ('shutil.which' , return_value = exec_exists ):
550- res = testinstance .check_runnable (enable_slow , filter , fixtures , hardware_map )
565+ res = testinstance .check_runnable (env . options , hardware_map )
551566
552567 assert res == expected
553568
0 commit comments