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.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/googletest/include/gtest/gtest.h b/googletest/include/gtest/gtest.h
index 5df4b0a..8921418 100644
--- a/googletest/include/gtest/gtest.h
+++ b/googletest/include/gtest/gtest.h
@@ -440,6 +440,9 @@ class GTEST_API_ Test {
// Returns true iff the current test has a non-fatal failure.
static bool HasNonfatalFailure();
+ // Returns true iff the current test was skipped.
+ static bool IsSkipped();
+
// Returns true iff the current test has a (either fatal or
// non-fatal) failure.
static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
@@ -574,7 +577,10 @@ class GTEST_API_ TestResult {
int test_property_count() const;
// Returns true iff the test passed (i.e. no test part failed).
- bool Passed() const { return !Failed(); }
+ bool Passed() const { return !Skipped() && !Failed(); }
+
+ // Returns true iff the test was skipped.
+ bool Skipped() const;
// Returns true iff the test failed.
bool Failed() const;
@@ -854,6 +860,9 @@ class GTEST_API_ TestCase {
// Gets the number of successful tests in this test case.
int successful_test_count() const;
+ // Gets the number of skipped tests in this test case.
+ int skipped_test_count() const;
+
// Gets the number of failed tests in this test case.
int failed_test_count() const;
@@ -936,6 +945,11 @@ class GTEST_API_ TestCase {
return test_info->should_run() && test_info->result()->Passed();
}
+ // Returns true iff test skipped.
+ static bool TestSkipped(const TestInfo* test_info) {
+ return test_info->should_run() && test_info->result()->Skipped();
+ }
+
// Returns true iff test failed.
static bool TestFailed(const TestInfo* test_info) {
return test_info->should_run() && test_info->result()->Failed();
@@ -1258,6 +1272,9 @@ class GTEST_API_ UnitTest {
// Gets the number of successful tests.
int successful_test_count() const;
+ // Gets the number of skipped tests.
+ int skipped_test_count() const;
+
// Gets the number of failed tests.
int failed_test_count() const;
@@ -1835,6 +1852,11 @@ class TestWithParam : public Test, public WithParamInterface<T> {
// Macros for indicating success/failure in test code.
+// Skips test in runtime.
+// Skipping test aborts current function.
+// Skipped tests are neither successful nor failed.
+#define GTEST_SKIP() GTEST_SKIP_("Skipped")
+
// ADD_FAILURE unconditionally adds a failure to the current test.
// SUCCEED generates a success - it doesn't automatically make the
// current test successful, as a test is only successful when it has