-
Notifications
You must be signed in to change notification settings - Fork 95
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
Customize command for running test binaries #366
Comments
Thanks @simonratner, that is an interesting idea. I'm wondering if the test package is the best place for the custom command to be specified. Ideally, a unit test would continue to work in 32-bit linux as before, and the custom command would only be used in other environments. If the custom command is specified in the test package, that would change how the test gets run in all environments.
|
I think command line is fine, something like By the way, WSL2 does run ELF32 binaries directly (since it is a real Linux kernel). I modified the description to reflect that. |
It is useful to specify a custom executor script for running tests as part of the
newt test
command. This could be specified as a key inpkg.yml
forunittest
packages, analogous tobsp.downloadscript
andbsp.debugscript
which exist forbsp
packages.This script will be executed by
newt test
with the (relative) path to the test binary as a parameter, in place of the binary itself. The default should be to exec the binary directly, as it is now.See: https://github.com/apache/mynewt-newt/blob/master/newt/builder/selftest.go#L151
Motivation
WSL on Win10, as well as macOS Catalina, are exclusively 64-bit and are not able to run the test ELFs. While both of these systems are capable of building the unit tests with crosstools, running the resulting binary requires a VM/container with a 32-bit-capable OS. May also be useful for non-WSL Windows environments.
Workaround
Run
newt test
to build the test package, which will fail with an ELF format error.Then manually execute the built binary in a supported environment:
The text was updated successfully, but these errors were encountered: