You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a fixture has a setUpWorld method defined, and that method returns false, then the test runner will run no tests, and the program will terminate with exit status 0. The documentation doesn't actually say what happens when setUpWorld returns false, but I wouldn't expect a successful exit status.
Consider the following code:
#include<iostream>
#include<cxxtest/TestSuite.h>
#include<cxxtest/GlobalFixture.h>classFixture1: publicCxxTest::GlobalFixture
{
public:boolsetUpWorld() {
std::clog << "Fixture1::setUpWorld about to return false" << std::endl;
returnfalse;
}
};
static Fixture1 fixture1;
classSuite: publicCxxTest::TestSuite
{
public:voidtestShouldFail() {
TS_FAIL("This should never run.");
}
};
Running cxxtest tests (1 test)Fixture1::setUpWorld about to return false
In <no suite>::<no test>:
/usr/local/include/cxxtest/RealDescriptions.cpp:5: Warning: Error setting up world
OK!
Furthermore, echo $? prints 0. The exit status and the OK! at the end of the output mean that any script running this test program will consider it successful even though it failed on setup.
The text was updated successfully, but these errors were encountered:
If a fixture has a
setUpWorld
method defined, and that method returnsfalse
, then the test runner will run no tests, and the program will terminate with exit status 0. The documentation doesn't actually say what happens whensetUpWorld
returnsfalse
, but I wouldn't expect a successful exit status.Consider the following code:
I compiled and ran it as follows:
Output is this:
Furthermore,
echo $?
prints0
. The exit status and theOK!
at the end of the output mean that any script running this test program will consider it successful even though it failed on setup.The text was updated successfully, but these errors were encountered: