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

test: Log error message for spectests expecting a failure #672

Merged
merged 1 commit into from
Dec 11, 2020

Conversation

gumb0
Copy link
Collaborator

@gumb0 gumb0 commented Dec 11, 2020

This can be helpful, when you'd like to check whether the invalid case fails for the right reason.
(It is displayed only with --show-passed option)

@codecov
Copy link

codecov bot commented Dec 11, 2020

Codecov Report

Merging #672 (45a0c29) into master (d7caaf5) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #672   +/-   ##
=======================================
  Coverage   99.29%   99.29%           
=======================================
  Files          71       71           
  Lines        9805     9805           
=======================================
  Hits         9736     9736           
  Misses         69       69           
Flag Coverage Δ
spectests 91.46% <85.71%> (ø)
unittests 99.29% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
test/spectests/spectests.cpp 98.41% <100.00%> (ø)

@gumb0 gumb0 requested review from chfast and axic December 11, 2020 14:17
@@ -293,15 +293,15 @@ class test_runner
catch (fizzy::parser_error const& ex)
{
if (type == "assert_malformed")
pass();
pass(ex.what());
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be better to also include the expected error kind, e.g.

Suggested change
pass(ex.what());
pass("malformed: " + ex.what());

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Each line already includes the kind of assertion it tests:

Line 29: assert_invalid PASSED invalid index of an exported function
Line 6: assert_malformed PASSED invalid wasm module prefix

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah ok. This is not visible in the added CTest test.

set_tests_properties(
fizzy/smoketests/spectests/showpassed-error-message
PROPERTIES
PASS_REGULAR_EXPRESSION "PASSED invalid wasm module prefix"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
PASS_REGULAR_EXPRESSION "PASSED invalid wasm module prefix"
PASS_REGULAR_EXPRESSION "assert_invalid PASSED invalid wasm module prefix"

@gumb0 gumb0 merged commit 267deb3 into master Dec 11, 2020
@gumb0 gumb0 deleted the spectest-pass-error branch December 11, 2020 17:54
@gumb0 gumb0 mentioned this pull request Dec 15, 2020
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.

2 participants