Skip to content

[tools] Fix precedence issue in cumulative attribute set-arithmetic #2281

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

Merged
merged 2 commits into from
Jul 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ def strict_cumulative_overrides(self, overrides):

def update_target(self, target):
setattr(target, self.name, list(
set(getattr(target, self.name, [])) | self.additions - self.removals))
(set(getattr(target, self.name, [])) | self.additions) - self.removals))



# 'Config' implements the mbed configuration mechanism
Expand Down
8 changes: 8 additions & 0 deletions tools/test/config_test/test27/lib1/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "lib1",
"target_overrides": {
"*": {
"target.features_remove": ["IPV4"]
}
}
}
11 changes: 11 additions & 0 deletions tools/test/config_test/test27/mbed_app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"custom_targets": {
"test_target": {
"core": "Cortex-M0",
"extra_labels": [],
"features": ["IPV4"],
"default_build": "standard"
}
}
}

8 changes: 8 additions & 0 deletions tools/test/config_test/test27/test_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Testing when adding two features

expected_results = {
"test_target": {
"desc": "test removing features",
"expected_features": []
}
}