Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(21)

Issue 2611: Add Test::DisableThisTest() member function

Can't Edit
Can't Publish+Mail
Start Review
Created:
17 years, 5 months ago by DO NOT USE
Modified:
16 years, 5 months ago
Reviewers:
wan
Base URL:
http://googletest.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Add the functionality to disable a test at runtime. unit test included.

Patch Set 1 #

Patch Set 2 : Slightly improved the unit test #

Patch Set 3 : Third revision #

Patch Set 4 : Fourth version #

Unified diffs Side-by-side diffs Delta from patch set Stats (+206 lines, -7 lines) Patch
include/gtest/gtest.h View 1 2 3 3 chunks +33 lines, -0 lines 0 comments Download
src/gtest.cc View 1 2 5 chunks +40 lines, -6 lines 0 comments Download
src/gtest-internal-inl.h View 2 chunks +9 lines, -1 line 0 comments Download
test/gtest_output_test_.cc View 1 chunk +18 lines, -0 lines 0 comments Download
test/gtest_output_test_golden_lin.txt View 1 chunk +3 lines, -0 lines 0 comments Download
test/gtest_output_test_golden_win.txt View 1 chunk +3 lines, -0 lines 0 comments Download
test/gtest_unittest.cc View 1 2 1 chunk +100 lines, -0 lines 0 comments Download

Messages

Total messages: 3
DO NOT USE
17 years, 5 months ago (2008-07-23 18:49:17 UTC) #1
Zhanyong
Hi, M-A, Please see my comments below. Thanks! http://codereview.appspot.com/2611/diff/5/7 File include/gtest/gtest.h (right): http://codereview.appspot.com/2611/diff/5/7#newcode229 Line 229: ...
17 years, 5 months ago (2008-07-25 04:48:48 UTC) #2
DO NOT USE
17 years, 5 months ago (2008-07-25 15:49:27 UTC) #3
Will send a new patch with the changes done. Some unit tests are still missing
but the rest has been fixed.

http://codereview.appspot.com/2611/diff/5/6
File test/gtest_unittest.cc (right):

http://codereview.appspot.com/2611/diff/5/6#newcode108
Line 108: TEST_F(TestDisabledInConstructor, DoesntRun) {
On 2008/07/25 04:48:48, Zhanyong wrote:
> We should make sure the test's failures (if any) are ignored if the test is
> disabled.
> 
> Therefore this won't tell us that the test body isn't run.

I clarified the expectations in DisableThisTest(), so testing this is
unnecessary, i.e. the test will fail if the test body is run.

http://codereview.appspot.com/2611/diff/5/6#newcode126
Line 126: }
On 2008/07/25 04:48:48, Zhanyong wrote:
> Need to test:
> 
> - calling DisableThisTest() and IsDisabled() from a function that's not a
member
> of the test fixture (nor the TEST itself).

Not done. I need to find out how to do that.

> - calling DisableThisTest() in the test ctor prevents SetUp(), the test body,
> and TearDown() to be run.

Done.

> - calling DisableThisTest() in SetUp() prevents the test body to be run, but
> TearDown() should still be run.

Done.

> - both statically disabled tests and dynamically disabled tests are included
in
> the count printed at the end of the test program.

Not done. I need to find out how to do that.

> - test failures before calling DisableThisTest() are ignored.

N/A

> - test failures after calling DisableThisTest() are ignored.

N/A

> - Google Test should print the names of the dynamically disabled tests in the
> end.

Not done. I don't think this is in the scope of this change.

> - calling DisableThisTest() and IsDisabled() from multiple threads
concurrently
> is OK.  For this you need to modify gtest_stress_test.cc.

Not done. There is no vcproj that includes this source file.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b