Skip to content

New feature: --ignore argument in test.py #666

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andrewleech
Copy link

Simply passes the parameter through when building with test.py

Supports and requires ARMmbed/mbed-os#6833

Simply passes the parameter through when building with test.py

For more details see ARMmbed/mbed-os#6833
@screamerbg
Copy link
Contributor

@andrewleech Thanks for this. Looking good to me.

@theotherjimmy @cmonr Any concerns?

@theotherjimmy
Copy link
Contributor

@screamerbg @andrewleech We should have the same feature in compile and export, for consistency.

@screamerbg screamerbg requested a review from sg- May 9, 2018 16:52
@screamerbg
Copy link
Contributor

Would like to poke @sg- for his take on this.

@screamerbg
Copy link
Contributor

@andrewleech Note that this won't work prior to Mbed OS 5.9 (after ARMmbed/mbed-os#6833 patch is merged), therefore the option help should explicitly mention this.

@screamerbg screamerbg changed the title Add support for --ignore argument in test.py New feature: --ignore argument in test.py May 9, 2018
Update help text with minimum mbed-os version (5.9)
@sg-
Copy link
Contributor

sg- commented May 16, 2018

Is there a use case for this other than ignoring main when running tests? This certainly is a simple solution but would worry about the annoyance of not remembering what file contains the main function.

@bridadan Do you recall the previous thinking around solutions to multiple main functions?

@andrewleech
Copy link
Author

andrewleech commented May 16, 2018

I've also used it since to build tests with rtos (--exclude main) and then compile app without rtos (--exclude mbed-os/rtos)

I guess if you're working completely on the command line this just means more typing. I'm using vscode so the command line is saved in its tools settings.

Copy link
Contributor

@cmonr cmonr left a comment

Choose a reason for hiding this comment

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

I like the addition.

@bridadan
Copy link
Contributor

@bridadan Do you recall the previous thinking around solutions to multiple main functions?

I believe the option we suggested at the time was to provide a different entry point for tests. Something like test_main or something instead of main. This could be enabled by specifying an additional define when compiling with mbed test.

One thing to keep in mind with that approach though is that any global static defines in your app's main file would still be brought in for each test (you would pay a RAM/ROM penalty). Short of knowing where that file is and excluding it from the build I don't think there's a way we can prevent that.

@sg- sg- removed their request for review January 27, 2019 09:27
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.

7 participants