Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
d629744e
Commit
d629744e
authored
Jan 15, 2018
by
Gennadiy Civil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More code merges
parent
6c865988
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
18 deletions
+15
-18
gtest.h
googletest/include/gtest/gtest.h
+15
-18
No files found.
googletest/include/gtest/gtest.h
View file @
d629744e
...
...
@@ -563,9 +563,8 @@ class GTEST_API_ TestResult {
// Returns the elapsed time, in milliseconds.
TimeInMillis
elapsed_time
()
const
{
return
elapsed_time_
;
}
// Returns the i-th test part result among all the results. i can range
// from 0 to test_property_count() - 1. If i is not in that range, aborts
// the program.
// Returns the i-th test part result among all the results. i can range from 0
// to total_part_count() - 1. If i is not in that range, aborts the program.
const
TestPartResult
&
GetTestPartResult
(
int
i
)
const
;
// Returns the i-th test property. i can range from 0 to
...
...
@@ -688,6 +687,9 @@ class GTEST_API_ TestInfo {
// Returns the line where this test is defined.
int
line
()
const
{
return
location_
.
line
;
}
// Return true if this test should not be run because it's in another shard.
bool
is_in_another_shard
()
const
{
return
is_in_another_shard_
;
}
// Returns true if this test should run, that is if the test is not
// disabled (or it is disabled but the also_run_disabled_tests flag has
// been specified) and its full name matches the user-specified filter.
...
...
@@ -708,10 +710,9 @@ class GTEST_API_ TestInfo {
// Returns true iff this test will appear in the XML report.
bool
is_reportable
()
const
{
// For now, the XML report includes all tests matching the filter.
// In the future, we may trim tests that are excluded because of
// sharding.
return
matches_filter_
;
// The XML report includes tests matching the filter, excluding those
// run in other shards.
return
matches_filter_
&&
!
is_in_another_shard_
;
}
// Returns the result of the test.
...
...
@@ -775,6 +776,7 @@ class GTEST_API_ TestInfo {
bool
is_disabled_
;
// True iff this test is disabled
bool
matches_filter_
;
// True if this test matches the
// user-specified filter.
bool
is_in_another_shard_
;
// Will be run in another shard.
internal
::
TestFactoryBase
*
const
factory_
;
// The factory that creates
// the test object
...
...
@@ -1791,7 +1793,6 @@ template <typename T>
class
TestWithParam
:
public
Test
,
public
WithParamInterface
<
T
>
{
};
// Macros for indicating success/failure in test code.
// ADD_FAILURE unconditionally adds a failure to the current test.
...
...
@@ -1864,22 +1865,18 @@ class TestWithParam : public Test, public WithParamInterface<T> {
// AssertionResult. For more information on how to use AssertionResult with
// these macros see comments on that class.
#define EXPECT_TRUE(condition) \
GTEST_TEST_BOOLEAN_(
(condition)
, #condition, false, true, \
GTEST_TEST_BOOLEAN_(
condition
, #condition, false, true, \
GTEST_NONFATAL_FAILURE_)
#define EXPECT_FALSE(condition) \
GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
GTEST_NONFATAL_FAILURE_)
#define ASSERT_TRUE(condition) \
GTEST_TEST_BOOLEAN_(
(condition)
, #condition, false, true, \
GTEST_TEST_BOOLEAN_(
condition
, #condition, false, true, \
GTEST_FATAL_FAILURE_)
#define ASSERT_FALSE(condition) \
GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
GTEST_FATAL_FAILURE_)
// Includes the auto-generated header that implements a family of
// generic predicate assertion macros.
#include "gtest/gtest_pred_impl.h"
// Macros for testing equalities and inequalities.
//
// * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2
...
...
@@ -1921,8 +1918,8 @@ class TestWithParam : public Test, public WithParamInterface<T> {
//
// Examples:
//
// EXPECT_NE(
5, Foo()
);
// EXPECT_EQ(
NULL, a_pointer
);
// EXPECT_NE(
Foo(), 5
);
// EXPECT_EQ(
a_pointer, NULL
);
// ASSERT_LT(i, array_size);
// ASSERT_GT(records.size(), 0) << "There is no record left.";
...
...
@@ -2221,8 +2218,8 @@ bool StaticAssertTypeEq() {
// }
//
// TEST_F(FooTest, ReturnsElementCountCorrectly) {
// EXPECT_EQ(
0, a_.size()
);
// EXPECT_EQ(
1, b_.size()
);
// EXPECT_EQ(
a_.size(), 0
);
// EXPECT_EQ(
b_.size(), 1
);
// }
#define TEST_F(test_fixture, test_name)\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment