The use of SUCCEED macro predates the introduction of GTEST_SKIP macro
to GTest 1.10. Having skipped tests reported as passed is misleading!
Before:
[ RUN ] TestMockOperationSnapshotRemoveRequest.FlattenedCloneRemovesChild
SKIPPING
[ OK ] TestMockOperationSnapshotRemoveRequest.FlattenedCloneRemovesChild (9 ms)
...
[ RUN ] TestMockOperationSnapshotRemoveRequest.RemoveChildError
SKIPPING
[ OK ] TestMockOperationSnapshotRemoveRequest.RemoveChildError (112 ms)
...
[ PASSED ] 16 tests.
After:
[ RUN ] TestMockOperationSnapshotRemoveRequest.FlattenedCloneRemovesChild
../src/test/librbd/operation/test_mock_SnapshotRemoveRequest.cc:381: Skipped
Skipping due to unmet REQUIRE
[ SKIPPED ] TestMockOperationSnapshotRemoveRequest.FlattenedCloneRemovesChild (9 ms)
...
[ RUN ] TestMockOperationSnapshotRemoveRequest.RemoveChildError
../src/test/librbd/operation/test_mock_SnapshotRemoveRequest.cc:727: Skipped
Skipping due to enabled deep-flatten
[ SKIPPED ] TestMockOperationSnapshotRemoveRequest.RemoveChildError (111 ms)
...
[ PASSED ] 14 tests.
[ SKIPPED ] 2 tests, listed below:
[ SKIPPED ] TestMockOperationSnapshotRemoveRequest.FlattenedCloneRemovesChild
[ SKIPPED ] TestMockOperationSnapshotRemoveRequest.RemoveChildError
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
librbd::ImageCtx *ictx;
ASSERT_EQ(0, open_image(clone_name, &ictx));
if (ictx->test_features(RBD_FEATURE_DEEP_FLATTEN)) {
- std::cout << "SKIPPING" << std::endl;
- return SUCCEED();
+ GTEST_SKIP() << "Skipping due to enabled deep-flatten";
}
ASSERT_EQ(0, snap_create(*ictx, "snap1"));
std::string config_value;
ASSERT_EQ(0, _rados.conf_get("rbd_clone_copy_on_read", config_value));
if (config_value == "false") {
- std::cout << "SKIPPING due to disabled rbd_copy_on_read" << std::endl;
- return;
+ GTEST_SKIP() << "Skipping due to disabled copy-on-read";
}
m_image_name = get_temp_image_name();
std::string config_value;
ASSERT_EQ(0, _rados.conf_get("rbd_cache", config_value));
if (config_value == "false") {
- std::cout << "SKIPPING due to disabled cache" << std::endl;
- return;
+ GTEST_SKIP() << "Skipping due to disabled cache";
}
rados_ioctx_t ioctx;
#define REQUIRE(x) { \
if (!(x)) { \
- std::cout << "SKIPPING" << std::endl; \
- return SUCCEED(); \
+ GTEST_SKIP() << "Skipping due to unmet REQUIRE"; \
} \
}