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

mtest: print command line when invoked with -v #5025

Closed
wants to merge 1 commit into from

Conversation

bonzini
Copy link
Contributor

@bonzini bonzini commented Mar 6, 2019

For easier reproducibility, when "meson test" is invoked with -v it will print the
command line that was invoked. This makes it a bit easier to cut and paste
from a failing test log into a terminal, and when using --gdb it will also provide
a hint for how gdb was invoked.

This was requested by a developer on a project that I am converting.

Copy link
Member

@dcbaker dcbaker left a comment

Choose a reason for hiding this comment

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

One small nit, and then please add a documentation snippet for the 0.51 release with this change.

mesonbuild/mtest.py Outdated Show resolved Hide resolved
@bonzini
Copy link
Contributor Author

bonzini commented Mar 7, 2019

0.51 release

There are no release notes for 0.51 yet. I'll wait for 0.50 to be released before updating.

dcbaker
dcbaker approved these changes Mar 7, 2019
@dcbaker
Copy link
Member

dcbaker commented Mar 7, 2019

Just put a snippet in docs/markdown/snippets, when the release is made everything in that folder get combined into the release notes for the current version.

@bonzini
Copy link
Contributor Author

bonzini commented Mar 15, 2019

Rebased to rerun CI and to squash review fixes into a single patch.

@nirbheek
Copy link
Member

Tests are failing around Boost. Maybe because Azure has added Boost to the VS 2017 image? Not sure.

For easier reproducibility, when "meson test" is invoked with -v it will print the
command line that was invoked.  This makes it a bit easier to cut and paste
from a failing test log into a terminal, and when using --gdb it will also provide
a hint for how gdb was invoked.

This was requested by a developer on a project that I am converting.
@bonzini
Copy link
Contributor Author

bonzini commented Mar 26, 2019

@jpakkane Is this going to be applied?

@jpakkane
Copy link
Member

The output looks a bit messy:

MALLOC_PERTURB_=175 /home/jpakkane/bmes/build/linkedexe
MALLOC_PERTURB_=4 /home/jpakkane/bmes/build/staticlinkedexe
MALLOC_PERTURB_=198 /home/jpakkane/bmes/build/utf
MALLOC_PERTURB_=21 /home/jpakkane/bmes/build/nomod
MALLOC_PERTURB_=97 /home/jpakkane/bmes/build/extralibexe
MALLOC_PERTURB_=93 /home/jpakkane/bmes/build/partial_dep/external_dep
Everything is fine in the world.
1/6 Boost linktest                          OK       0.01 s 
Running 1 test case...

*** No errors detected
2/6 Boost statictest                        OK       0.01 s 
3/6 Boost UTF test                          OK       0.01 s 
4
4/6 Boost nomod                             OK       0.01 s 
2019-03-26 20:11:03.568293 [trace] - SOMETHING
5/6 Boost extralib test                     OK       0.02 s 
6/6 External Dependency                     OK       0.01 s 

The description says about using this for failure cases, but we already print the command in that case:

The output from the failed tests:

4/6 Boost nomod                             FAIL     0.01 s (exit status 1)

--- command ---
/home/jpakkane/bmes/build/nomod
--- stdout ---
Everything is fine in the world.
-------

The only thing it does not have is the envvar setup. Could we enhance that output instead?

@bonzini
Copy link
Contributor Author

bonzini commented Mar 26, 2019

I would do both... Even for passes, sometimes the command line is not obvious and having it before the output can be useful to understand why one test is failing and the other isn't. Verbose output is naturally somewhat messy. But we certainly should include the environment in the non-verbose case.

How would you feel about preceding the command with a Unicode arrow such as in the verbose case, so that it stands out a bit more?

@bonzini
Copy link
Contributor Author

bonzini commented Mar 27, 2019

Another issue is that the command line can be hidden completely from --print-errorlogs if the stdout/stderr is long enough. This can be fixed separately by restricting the output to the last 100 lines of stdout/stderr instead of the last 100 lines of the log.

I'm closing this PR and will come back with something more complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants