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

tools,test: show signal code when test crashes #7859

Merged
merged 1 commit into from
Jul 31, 2016

Conversation

santigimeno
Copy link
Member

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

tools, test

Description of change

@santigimeno santigimeno added test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. labels Jul 24, 2016
@@ -196,7 +196,7 @@ def Done(self):
print failed.output.stdout.strip()
print "Command: %s" % EscapeCommand(failed.command)
if failed.HasCrashed():
print "--- CRASHED ---"
print "--- CRASHED (%d) ---" % -failed.output.exit_code
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps it might be helpful to add a prefix before the number here and below, like "Exit code ".

Copy link
Member Author

Choose a reason for hiding this comment

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

Would --- CRASHED (Signal: %d) --- work for you?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's better, yes.

@santigimeno
Copy link
Member Author

PR updated. Thanks!

@bnoordhuis
Copy link
Member

LGTM but does it print the right thing on Windows?

@santigimeno
Copy link
Member Author

does it print the right thing on Windows?

@bnoordhuis I don't know. Is there a simple way to force a crash on Windows?

@santigimeno
Copy link
Member Author

PR update adding CRASHED info to the tap output

@gibfahn
Copy link
Member

gibfahn commented Jul 29, 2016

@santigimeno I normally use --expect-fail (in test.py#L1325) to get tests to fail.

@santigimeno
Copy link
Member Author

@gibfahn I didn't know about --expect-fail and it looks very useful but I don't think it's what I'm looking for. I want to create a test that crashes on Windows (HasCrashed(self) returns true) to check whether this change makes any sense on Windows at all. Thanks!

@santigimeno
Copy link
Member Author

PR updated printing the Signal Code on every platform but Windows.

@@ -196,7 +196,7 @@ def Done(self):
print failed.output.stdout.strip()
print "Command: %s" % EscapeCommand(failed.command)
if failed.HasCrashed():
print "--- CRASHED ---"
print "--- %s ---" % PrintCrashed(-failed.output.exit_code)
Copy link
Member

Choose a reason for hiding this comment

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

I'd negate in PrintCrashed() itself.

@bnoordhuis
Copy link
Member

LGTM with a suggestion and a style nit.

@santigimeno
Copy link
Member Author

PR updated with @bnoordhuis comments. Thanks!

On every platform but `Windows`. Also, print the crash information when
using the tap reporter.

PR-URL: nodejs#7859
Reviewed-By: Ben Noordhuis <[email protected]>
@santigimeno
Copy link
Member Author

Landed in df4ef63. Thanks!

@cjihrig cjihrig mentioned this pull request Aug 8, 2016
cjihrig pushed a commit that referenced this pull request Aug 10, 2016
On every platform but `Windows`. Also, print the crash information when
using the tap reporter.

PR-URL: #7859
Reviewed-By: Ben Noordhuis <[email protected]>
@cjihrig cjihrig mentioned this pull request Aug 11, 2016
MylesBorins pushed a commit that referenced this pull request Sep 30, 2016
On every platform but `Windows`. Also, print the crash information when
using the tap reporter.

PR-URL: #7859
Reviewed-By: Ben Noordhuis <[email protected]>
rvagg pushed a commit that referenced this pull request Oct 18, 2016
On every platform but `Windows`. Also, print the crash information when
using the tap reporter.

PR-URL: #7859
Reviewed-By: Ben Noordhuis <[email protected]>
MylesBorins pushed a commit that referenced this pull request Oct 26, 2016
On every platform but `Windows`. Also, print the crash information when
using the tap reporter.

PR-URL: #7859
Reviewed-By: Ben Noordhuis <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Oct 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants