Comments (14)
Yikes! I see the problem - and know how I broke it.
Will have a fix soon. Thanks for pointing it out.
from catch2.
Hi Phil. I was wondering if you can provide an indication when you'll have a fix for this?
from catch2.
Hi wichert.
I have a little backlog of smaller issues to get through first - as this will require a bit more attention. I'm hoping to be on it this week, though.
from catch2.
I've checked in an initial improvement. It's not a complete fix but it might get you out of trouble for now.
I'm working on a complete fix now.
from catch2.
Sorry - I should have said what this fixes. It should work if there is a single subsection
from catch2.
I checked in a more complete fix now. It passes the skimpy tests I have in there but I need to add more before I can really say this is done. Would appreciate your feedback if you give it a try, though.
from catch2.
I will do some more testing in the next few days. I should be able to provide feedback before Monday.
from catch2.
Cool, thanks
from catch2.
One thing I noticed is that nested sections are not shown running the tests with -s. With the above example the output looks like this:
Running: MyClass [Start section: 'defaults'] .. [End of section: 'defaults' ..]
Notice how the MyClass::MyClass level is skipped in the output.
from catch2.
So far everything is looking correct: tests in nested sections are run correctly, and the XML report shows them as well.
I'll leave closing this until you have decided if the nested sections should be shown in the -s output, which they are not at the moment.
from catch2.
Found a possible problem. I have a test which looks like this:
TEST_CASE("MyClass", "MyClass basic tests") { SECTION("MyClass::MyClass", "MyClass constructor tests") { MyFixture fixture; SECTION("defaults", "Default values for member varirables") { // ... } SECTION("other", "Other tests") { // ... } } }
MyFixture is a simple class which prepares a test environment in its constructor and rests everything in its destructor. The test segfault in a way which suggests that the fixture is torn down before the "other" section is run.
Is there another way to setup test fixture? I couldn't find anything in the tests, and this pattern felt quite natural.
from catch2.
I found an error in my test fixture which caused the segfault. As far as I can see nested sections work correctly now.
from catch2.
Cool - glad you found the issue. I couldn't see any way that the scoping wouldn't have worked.
As for the -s reporting issue - thanks for pointing that out. It only occurred if a parent test had no assertions of its own (which would commonly be the case, but none of my meta tests were written that way! :-s ). Anyway, I've reproduced in the meta-tests and it's now all fixed. Would appreciate your verification, though.
from catch2.
Looks fine, thanks!
from catch2.
Related Issues (20)
- Latest macOS system header causes compilation failures on GCC HOT 4
- Compilation fails with `error: arithmetic on a pointer to an incomplete type` HOT 3
- Combine test filters with filenames HOT 2
- Section filter command line option only works for sections without whitespace in name HOT 1
- Separate headers for "extra" std types
- Catch2 does not appear to work with C++23
- version 3.5.4 does not compile
- JUnit and console reporter discrepency.
- Provide means to obtain current test case name and current section name HOT 2
- GENERATOR doesn't allow use constants HOT 1
- Memory leak when using exit()
- Compile Error While using Catch::Clara::Parser HOT 1
- Allow the Catch2 library to be compiled with address sanitizer enabled
- Fixture's destructor called before retrieving uncaught exception's message
- How does (can) auto-registration work?
- CTest (using catch_discover_tests) treats skipped tests as failed HOT 2
- Exit code of 127 when all tests pass (only on Windows Release build) HOT 1
- std::complex output precision
- How to test a custom math library with Catch2 (while catch2 relies on libm) ? HOT 1
- The json reporter does not print results of benchmarks HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from catch2.