summaryrefslogtreecommitdiffstats
path: root/googletest/include/gtest/gtest.h
diff options
context:
space:
mode:
Diffstat (limited to 'googletest/include/gtest/gtest.h')
-rw-r--r--googletest/include/gtest/gtest.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/googletest/include/gtest/gtest.h b/googletest/include/gtest/gtest.h
index 4a8f6e0..93b755f 100644
--- a/googletest/include/gtest/gtest.h
+++ b/googletest/include/gtest/gtest.h
@@ -687,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.
@@ -707,10 +710,9 @@ class GTEST_API_ TestInfo {
// Returns true iff this test will appear in the XML report.
bool is_reportable() const {
- // The XML report includes 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.
@@ -774,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