-
Notifications
You must be signed in to change notification settings - Fork 51
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
Boost.UT tests spuriously pass, by returning 0 exit status even after failure #87
Comments
@kris-jusiak Hello, please could you advise on how to track this down? It's means that all our uses of Boost.ut spuriously pass in test, which is rather worrying. It occurred with 20bf64b in this project, which contains 8004290d195b08eda531eb015ddcda2e11d41ce9 of Boost.UT. The source code of the test in this version is: I thought maybe it would detect a failure on the last test case, so I changed the content of the file |
In #87 I found that unexpected exceptions do not contribute to the exit status of Boost.UT test programs. However, failed expect() statements do, so this test will at least mean that if any of builds of this project fall foul of the Ninja path problem, at least ctest will report the problem.
@kris-jusiak 💡 I think I understand the problem. In the above two commits, I added some tests that use Approval Tests report failures by throwing exceptions, which they then assume will result in a non-zero exit status. It looks to me like if the only errors are unexpected exceptions, this doesn't get reported in Boost.UT's exit status.... Is this enough information? Thanks in advance for any help that you can offer... |
This problem matters when I run Boost.UT v1.1.6 on Mac... It looks like all ApprovalTests Boost.UT verifications pass, when running the tests with If ctest is run with
I think this may have slightly contributed to the challenges understanding the Ninja problems in #74:
Various combinations of Boost.ut version, compilers, and running either via ctest or directly, resulted in some confusion. @jwillikers and @lp55 please note:
|
@claremacrae Noted. Thank you for the update Clare! |
I’ve got a fix for this. I’ll submit a PR to Boost.UT later this week. |
When I hack the approval files in
tests/UT_Tests/ApprovalTestTests.cpp
to make the test fail, and then run the test via this:ctest .
I expect to see test saying the test failed.
However, it gives
then Test reports the tests pass, even though a diff tool popped up to say an error occurred.
ctest . --verbose
then I do see the console output, but the test still reports it passes.
I presume that this is because Boost.UT is returning a 0 exit status even after an error has occurred.
This is most serious in the case where the user's build is not set up correctly to work with Approval Tests, e.g. when using Ninja with an in-source build...
Approval Tests will throw one exception per test case, which 'ctest .' will swallow - and then ctest will report that all the tests succeeded. When in fact they all failed...
The text was updated successfully, but these errors were encountered: