Skip to content
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

makefiles/buildtests.inc.mk: allow overwriting make output redirection #9741

Merged

Conversation

cladmi
Copy link
Contributor

@cladmi cladmi commented Aug 8, 2018

Contribution description

When running tests, I often needed to modify buildtests.inc.mk to see the
actual errors/standard output.
This allows overwriting the default redirection of both to /dev/null.
It is low level and directly given to the command execution.

As it is interpreted by make, it can even be overwritten using build system
variables:

'BUILDTEST_MAKE_REDIRECT=>/tmp/buildtest.$${board}.out 2>&1'

Issues/PRs references

I needed something like this when running buildtest for the release tests.

When running tests, I often needed to modify `buildtests.inc.mk` to see the
actual errors/standard output.
This allows overwriting the default redirection of both to `/dev/null`.
It is low level and directly given to the command execution.

As it is interpreted by make, it can even be overwritten using build system
variables:

    'BUILDTEST_MAKE_REDIRECT=>/tmp/buildtest.$${board}.out 2>&1'
@cladmi cladmi added Area: build system Area: Build system Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation labels Aug 8, 2018
@cladmi cladmi requested review from jnohlgard and jia200x August 8, 2018 12:40
Copy link
Member

@smlng smlng left a comment

Choose a reason for hiding this comment

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

I tested in macOS and it did not work as expected.

My command run from RIOT root

BUILDTEST_MAKE_REDIRECT=>/tmp/buildtest.$${board}.out 2>&1 make -C tests/minimal/ buildtest

but there was only one file in /tmp with name buildtest.53771{board}.out, because the $$ gives you the pid. I guess some escaping is needed?

@smlng
Copy link
Member

smlng commented Aug 10, 2018

ah when I do

BUILDTEST_MAKE_REDIRECT='>/tmp/buildtest.$${board}.out 2>&1' make -C tests/minimal/ buildtest

it works

@smlng smlng added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 10, 2018
@cladmi cladmi merged commit feb3912 into RIOT-OS:master Aug 10, 2018
@cladmi
Copy link
Contributor Author

cladmi commented Aug 10, 2018

Thanks for testing.

@cladmi cladmi added this to the Release 2018.10 milestone Aug 11, 2018
@cladmi cladmi deleted the pr/make/buildtest/override_redirection branch August 16, 2018 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants