-
Notifications
You must be signed in to change notification settings - Fork 8.3k
sanitycheck: Execute binary in output directory #16149
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
sanitycheck: Execute binary in output directory #16149
Conversation
4cbfad5 to
4decff6
Compare
marc-hb
left a comment
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.
Looks good if you can confirm that:
- the case self.call_make_run = True has been tested at least once;
- '\n' is portable, and
- the verbose statement looks OK. Can you copy/paste a sample log output here?
Execute the test binary from the output directory instead of directory where sanitycheck was started. This will ensure that any artifact created with a relative path by the test binary will be placed in the output directory instead of creating the artifact in the directory where sanitycheck was executed and prevent any possible conflicts. Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
4decff6 to
79d5937
Compare
It has been tested by running the crc unit test (see output bellow)
No it is not, was a bit in a hurry and forgot to use os.linesep
Output for running native posix binary: Output running unit tetst: |
marc-hb
left a comment
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.
I just spent more than a split second looking at this particular EOL situation. As usual with EOLs it's a mess:
- The verbose() function here uses '\n' anyway
- it started re-inventing python's logging module
- Python's documentation says: "Do not use os.linesep as a line terminator when writing files opened in text mode (the default); use a single '\n' instead, on all platforms."
- verbose() uses sys.stdout.write(). Does Python open sys.stdout in text mode? I don't know.
Let's not care. Let's leave those questions as a (search and replace) exercise for whoever will tackle the much bigger task of porting sanitycheck to Windows (#2664).
Execute the test binary from the output directory instead of directory
where sanitycheck was started.
This will ensure that any artifact created with a relative path by the
test binary will be placed in the output directory instead of creating
the artifact in the directory where sanitycheck was executed and prevent
any possible conflicts.
One of the use case is the flash support for native posix (PR #12503) which
will create a binary file that stores the flash contents.