@@ -105,25 +105,27 @@ def test_filter_by_all_libraries(self):
105
105
Assert something
106
106
"""
107
107
res = Resources (MockNotifier ())
108
- res ._add_labels ('TARGET' , ['K64F' ])
109
- res ._add_labels ('TARGET' , ['FRDM' ])
108
+ res ._add_labels ('TARGET' , ['K64F' , 'FRDM' ])
110
109
for name , loc in SRC_PATHS .items ():
111
110
res .add_directory (loc , into_path = name )
112
111
res .filter_by_libraries (res .get_file_refs (FileType .JSON ))
113
112
assert ("main.cpp" in res .get_file_names (FileType .CPP_SRC ))
114
113
115
114
def test_filter_by_bm_lib (self ):
116
115
res = Resources (MockNotifier ())
117
- res ._add_labels ('TARGET' , ['K64F' ])
118
- res ._add_labels ('TARGET' , ['FRDM' ])
116
+ res ._add_labels ('TARGET' , ['K64F' , 'FRDM' ])
119
117
for name , loc in SRC_PATHS .items ():
120
118
res .add_directory (loc , into_path = name )
121
- res .win_to_unix ()
122
- res .filter_by_libraries (
119
+ filter_by = [
123
120
ref for ref in res .get_file_refs (FileType .JSON )
124
- if "/bm/" in ref .name
125
- )
121
+ if join ("platform" , "bm" , "mbed_lib.json" ) in ref .name
122
+ ]
123
+ res .filter_by_libraries (filter_by )
126
124
assert ("main.cpp" not in res .get_file_names (FileType .CPP_SRC ))
125
+ assert (
126
+ join ("mbed-os" , "platform" , "bm" , "bm.cpp" )
127
+ in res .get_file_names (FileType .CPP_SRC )
128
+ )
127
129
128
130
129
131
if __name__ == '__main__' :
0 commit comments