We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
cxxtestgen --no-static-init
I have a dynamically instantiated test suite that contains a createSuite() method. I call cxxtestgen with --no-static-init.
createSuite()
cxxtestgen
--no-static-init
The resulting code misbehaves during execution as follows:
setUp()
tearDown()
Save this as bug.h:
bug.h
#include <cxxtest/TestSuite.h> class BuggyTestSuite : public CxxTest::TestSuite { public: void setUp() override { std::cerr << "Calling setUp() on " << this << std::endl; } void tearDown() override { std::cerr << "Calling tearDown() on " << this << std::endl; } void testBreakage() { std::cerr << "Calling testBreakage() on " << this << " <- !!" << std::endl; } static BuggyTestSuite *createSuite() { BuggyTestSuite *suite = new BuggyTestSuite(); std::cerr << "Created " << suite << std::endl; return suite; } static void destroySuite(BuggyTestSuite *suite) { std::cerr << "Destroying " << suite << std::endl; delete suite; } };
cxxtestgen --error-printer --no-static-init -o bug.cpp bug.h c++ -o bug bug.cpp ./bug
Created 0x557bfb48be70 Running cxxtest tests (1 test)Created 0x557bfb48c2c0 Calling setUp() on 0x557bfb48c2c0 Calling testBreakage() on 0x557bfb48be70 <- !! Calling tearDown() on 0x557bfb48c2c0 .Destroying 0x557bfb48c2c0 OK!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Overview
I have a dynamically instantiated test suite that contains a
createSuite()
method.I call
cxxtestgen
with--no-static-init
.The resulting code misbehaves during execution as follows:
setUp()
is called on B.tearDown()
is called on B.Minimal example
Save this as
bug.h
:Steps to reproduce
Example output
The text was updated successfully, but these errors were encountered: