Skip to content

Commit

Permalink
Merge pull request ceph#830 from ceph/port/gtest-death-tests
Browse files Browse the repository at this point in the history
test: Only build death tests on platforms that support them
  • Loading branch information
Sage Weil committed Nov 7, 2013
2 parents 0c3c025 + 1d030d1 commit 35eaa66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/test/ceph_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ void do_simple_crypto() {
exit(0);
}

#if GTEST_HAS_DEATH_TEST
TEST_F(ForkDeathTest, MD5) {
ASSERT_EXIT(do_simple_crypto(), ::testing::ExitedWithCode(0), "^$");
}
#endif //GTEST_HAS_DEATH_TEST
2 changes: 2 additions & 0 deletions src/test/os/TestFlatIndex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ TEST(FlatIndex, FlatIndex) {
EXPECT_EQ(0, index.cleanup());
}

#ifdef GTEST_HAS_DEATH_TEST
TEST(FlatIndex, collection) {
coll_t collection("ABC");
const std::string base_path("PATH");
Expand All @@ -53,6 +54,7 @@ TEST(FlatIndex, collection) {
vector<ghobject_t> ls;
ASSERT_DEATH(index.collection_list_partial(hoid, 0, 0, 0, &ls, &hoid), "0");
}
#endif //GTEST_HAS_DEATH_TEST

TEST(FlatIndex, created_unlink) {
coll_t collection("ABC");
Expand Down

0 comments on commit 35eaa66

Please sign in to comment.