Skip to content

Commit eb6a972

Browse files
committed
Check that recursive libs work correctly
1 parent 54d6e86 commit eb6a972

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

tools/test/resources/mbed-os.lib/platform/bm/bm.cpp

Whitespace-only changes.

tools/test/resources/resource_test.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,25 +105,27 @@ def test_filter_by_all_libraries(self):
105105
Assert something
106106
"""
107107
res = Resources(MockNotifier())
108-
res._add_labels('TARGET', ['K64F'])
109-
res._add_labels('TARGET', ['FRDM'])
108+
res._add_labels('TARGET', ['K64F', 'FRDM'])
110109
for name, loc in SRC_PATHS.items():
111110
res.add_directory(loc, into_path=name)
112111
res.filter_by_libraries(res.get_file_refs(FileType.JSON))
113112
assert("main.cpp" in res.get_file_names(FileType.CPP_SRC))
114113

115114
def test_filter_by_bm_lib(self):
116115
res = Resources(MockNotifier())
117-
res._add_labels('TARGET', ['K64F'])
118-
res._add_labels('TARGET', ['FRDM'])
116+
res._add_labels('TARGET', ['K64F', 'FRDM'])
119117
for name, loc in SRC_PATHS.items():
120118
res.add_directory(loc, into_path=name)
121-
res.win_to_unix()
122-
res.filter_by_libraries(
119+
filter_by = [
123120
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)
126124
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+
)
127129

128130

129131
if __name__ == '__main__':

0 commit comments

Comments
 (0)