Comments (6)
Original comment by [email protected]
on 11 Nov 2008 at 6:47
- Added labels: OpSys-All, Priority-Low, Type-Enhancement
- Removed labels: Priority-Medium, Type-Defect
from googletest.
We considered the following approaches:
1. let RUN_ALL_TESTS() cleans up all gtest data structures before it returns.
2. provide a CleanGoogleTest() function the user can call after RUN_ALL_TESTS().
#1 is less work for new users, but will break many existing users who call
RUN_ALL_TESTS() more than once for various reasons.
#2 means the UnitTest object needs to be allocated on the heap. This might
break
some existing users who already use a leak checker that ignores static global
objects
but not heap-allocated objects.
We need to think more about this.
Original comment by [email protected]
on 2 Dec 2008 at 5:31
- Changed state: Accepted
from googletest.
Original comment by [email protected]
on 6 Mar 2010 at 6:05
- Changed state: WontFix
from googletest.
Reopening per user request.
I think a safe way to introduce the change is to keep the existing
behavior of RUN_ALL_TESTS() unchanged, and add a new function
testing::RunAllTestsAndBeDone() to run the tests *and* delete the
UnitTest singleton. People caring about space leak checking can call
this new function instead of RUN_ALL_TESTS().
Original comment by [email protected]
on 24 Mar 2010 at 9:55
- Changed state: Accepted
- Added labels: Priority-Medium
- Removed labels: Priority-Low
from googletest.
A problem you should be aware of.
I changed gtest.cc to delete the impl_ static object at end of job so I could
use a
leak finder. It worked great, except when a death test was used. The leak
finder was
called for every EXPECT_EXIT. And since the program terminated without the usual
exits to the functions, it showed leaks for all strings and other STL objects
that
had been used. It is usually not practical to go thru all the normal exits when
a
program is abnormally terminated. Also, there cannot be any outstanding
allocated
memory or global variables in the test program, or they will also be reported as
leaks at this point.
The only way I found around it was to bypass the EXPECT_EXIT tests with a
preprocessor directive when the leak detector was used. This way, when the
program
exited with the normal end of job, all leaks disappeared.
Even with this problem I think it is worth it to make this change. All required
changes to bypass the leak detector will be in the test program. Making
changes to
gtest itself is not necessary. Also the death tests are for exceptions that
should
rarely, if ever, occur in normal processing. They can be tested when running
without
the leak detector.
Original comment by [email protected]
on 9 Apr 2010 at 8:24
from googletest.
There is also global strings (in testing::flags) that cause hassle for leak
detectors.
They're allocated pre-main, and modified by GTestFlagSaver during the execution
of
tests.
This makes gtest impractical to use with standard Windows SDK crtdbg.h leak
tracking,
which is unfortunate.
Original comment by sgraham
on 3 May 2010 at 8:07
from googletest.
Related Issues (20)
- {ASSERT|EXPECT}_[NOT_]NULL(expr) HOT 2
- Need a polymorphic NULL pointer that can be used in function templates HOT 1
- Need to unify the way the GTEST_* macros are interpreted HOT 1
- 'make check' fails with undefined references. HOT 3
- --gtest_repeat should case failures to show up at the bottom
- Failed tests HOT 3
- --gtest_output flag doesn't produce output on platforms where argv[0] is empty HOT 3
- Include StackWalker for windows exception handling HOT 4
- ValuesIn(container<T>) needs to be convertible to ParamGenerator<T1> if T is assignable to T1. HOT 1
- make check fails on ubuntu 8.01 HOT 3
- Add EXPECT_HRESULT(hr) for Windows systems HOT 5
- Support for custom ResultPrinter HOT 8
- Enhance the Macros to enable the user to Specify Comments for TestCase and Test. HOT 3
- Support Multiple Levels of TestCase Specification HOT 1
- the XML report may contain invalid charactor HOT 3
- need to update the wiki with parameterized test docs HOT 1
- We need well defined test procedure and test runner scripts to test Google Test HOT 1
- Value-parameterized tests must warn about interspersing test definitions and test case instantiations for the same test case. HOT 2
- 'make check' fails on SunOS 5.10
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 googletest.