Skip to content

Preventing app_config from clobbering CLI macros #3518

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 1 commit into from
Jan 9, 2017

Conversation

bridadan
Copy link
Contributor

@bridadan bridadan commented Jan 3, 2017

Description

This fixes #3516. If an mbed_app.json file is used when compiling tests, the tools were incorrectly ignoring macros that were supplied on the command line. This PR fixes this so the macros propagate correctly.

Status

READY

Migrations

If this PR changes any APIs or behaviors, give a short description of what API users should do when this PR is merged.

NO

Todos

  • Tests

Steps to test or reproduce

Edit any test with the following code:

#ifdef MY_SILLY_MACRO
printf("MY_SILLY_MACRO is set!\r\n");
#else
printf("MY_SILLY_MACRO is NOT set!\r\n");
#endif

If run the following commands, you should see MY_SILLY_MACRO is set! printed in the test report:

mbed test -DMY_SILLY_MACRO --compile --clean
mbed test --run -v

However, if you add an mbed_app.json file with the following contents:

{
    "macros": ["MY_DUMMY_MACRO"]
}

Then do a clean compile and run step again, you will see MY_SILLY_MACRO is NOT set! printed in the test report.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the issue !

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 4, 2017

/morph test

@mbed-bot
Copy link

mbed-bot commented Jan 4, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1350

All builds and test passed!

@jenia81
Copy link

jenia81 commented Jan 5, 2017

@bridadan I've checked and it's working

@bridadan
Copy link
Contributor Author

bridadan commented Jan 5, 2017

Great, thanks @jenia81!

@bridadan bridadan removed the request for review from jenia81 January 5, 2017 20:49
@sg- sg- merged commit 2c6fe1f into ARMmbed:master Jan 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Macros aren't passed to TESTS folder during "mbed test" command
6 participants