-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tools changes for bare metal #9561
Changes from 18 commits
e10adff
e2849e6
dea8ea9
243b079
9f6a096
79eccd1
4dd525d
7a360ef
c5a721c
0b64c9c
c225f2c
eaa4ee4
4fbbac9
5cf07df
e201fdb
06ea053
ee5fea4
54d6e86
eb6a972
250a1de
db30e71
f45b53f
5335faf
a832333
92475ae
0265b57
9b8a48f
c31fb47
94c1754
32463d6
724487d
5b96cbf
f331d9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "greentea-client" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "mbed-client-cli" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "mbed-coap" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "unity" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "mbedtls" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "nanostack-upper" | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "nfc" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "system-storage" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,13 @@ | |
"type": "string" | ||
} | ||
}, | ||
"requires_definition": { | ||
"descirption": "Required libraries", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. |
||
"type": "array", | ||
"items": { | ||
"$ref": "#/name_definition" | ||
} | ||
}, | ||
"macro_definition": { | ||
"description": "A list of extra macros that will be defined when compiling a project that includes this library.", | ||
"type": "array", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,6 +126,9 @@ def __init__(self, notify, collect_ignores=False): | |
# publicly accessible things | ||
self.ignored_dirs = [] | ||
|
||
# library requirements | ||
self._libs_filtered = None | ||
|
||
# Pre-mbed 2.0 ignore dirs | ||
self._legacy_ignore_dirs = (LEGACY_IGNORE_DIRS) | ||
|
||
|
@@ -257,7 +260,25 @@ def add_file_ref(self, file_type, file_name, file_path): | |
|
||
def get_file_refs(self, file_type): | ||
"""Return a list of FileRef for every file of the given type""" | ||
return list(self._file_refs[file_type]) | ||
if self._libs_filtered is None: | ||
return list(self._file_refs[file_type]) | ||
else: | ||
to_ret = [] | ||
for ref in self._file_refs[file_type]: | ||
_, path = ref | ||
if not any( | ||
path.startswith(dirname(e.path)) for e in self._excluded_libs | ||
): | ||
to_ret.append(ref) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Woah There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I switched editors recently, until it decided to never insert spaces when I type |
||
return to_ret | ||
|
||
def filter_by_libraries(self, library_refs): | ||
""" | ||
Call after completely done scanning to filter resources based on | ||
libraries | ||
""" | ||
self._libs_filtered = library_refs | ||
self._excluded_libs = set(self._file_refs[FileType.JSON]) - set(library_refs) | ||
|
||
def _get_from_refs(self, file_type, key): | ||
return sorted([key(f) for f in self.get_file_refs(file_type)]) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"test_target": { | ||
"expected_features": ["BOOTLOADER", "STORAGE"] | ||
"expected_features": ["BOOTLOADER", "STORAGE"], | ||
"included_source": ["FEATURE_BOOTLOADER/lib1/lib1.c", "FEATURE_STORAGE/lib2/lib2.c"] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "lib1", | ||
"requires": ["lib2"], | ||
"config": { | ||
"test": "BAD" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "lib2", | ||
"requires": ["lib3"], | ||
"config": { | ||
"test": { | ||
"value": "BAD" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"requires" : ["lib1"], | ||
"target_overrides": { | ||
"test_target": { | ||
"lib2.test": "GOOD", | ||
"lib1.test": "GOOD" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"test_target": { | ||
"supported_toolchains": ["GCC_ARM"], | ||
"core": "Cortex-M0", | ||
"extra_labels": [], | ||
"features": [], | ||
"default_lib": "std" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"test_target": { | ||
"exception_msg": "'lib2' requires 'lib3' which is not present" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "lib1", | ||
"requires": ["lib2"], | ||
"config": { | ||
"test": "BAD" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "lib2", | ||
"requires": ["lib3"], | ||
"config": { | ||
"test": { | ||
"value": "BAD" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "lib3", | ||
"config": { | ||
"test": "BAD" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"requires" : ["lib1"], | ||
"target_overrides": { | ||
"test_target": { | ||
"lib3.test": "GOOD", | ||
"lib2.test": "GOOD", | ||
"lib1.test": "GOOD" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"test_target": { | ||
"supported_toolchains": ["GCC_ARM"], | ||
"core": "Cortex-M0", | ||
"extra_labels": [], | ||
"features": [], | ||
"default_lib": "std" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"test_target": { | ||
"lib3.test": "GOOD", | ||
"lib2.test": "GOOD", | ||
"lib1.test": "GOOD", | ||
"included_source": ["lib3/lib3.cpp"] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "lib1", | ||
"config": { | ||
"test": "BAD" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "lib2", | ||
"config": { | ||
"test": { | ||
"value": "BAD" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"requires" : ["lib1"], | ||
"target_overrides": { | ||
"should_fail": { | ||
"lib2.test": "GOOD" | ||
}, | ||
"should_pass": { | ||
"lib1.test": "GOOD" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As explained here: #9628 (review)
We don't need the "nanostack-upper" module, as it remains empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you like me to take the commit from #9628 into this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes...maybe...