Skip to content

Commit

Permalink
update gtest skip comapt
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed Nov 18, 2019
1 parent b3a03df commit a4262c6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
18 changes: 12 additions & 6 deletions include/gtest/switch/iutest_switch_skip.hpp
Expand Up @@ -6,7 +6,7 @@
*
* @author t.shirayanagi
* @par copyright
* Copyright (C) 2012-2016, Takazumi Shirayanagi\n
* Copyright (C) 2012-2019, Takazumi Shirayanagi\n
* This software is released under the new BSD License,
* see LICENSE
*/
Expand All @@ -19,22 +19,28 @@

//======================================================================
// define
#define GTEST_SKIP IUTEST_SKIP

#else // !defined(IUTEST_USE_GTEST)

//======================================================================
// undef
#if defined(INCG_IRIS_IUTEST_HPP_)

#if defined(IUTEST_SKIP)
#undef IUTEST_SKIP

#endif

//======================================================================
// define
#define IUTEST_SKIP() GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
if( ::testing::internal::AlwaysTrue() ) return GTEST_MESSAGE_("Skipped. ", ::testing::TestPartResult::kSuccess)

#if defined(GTEST_SKIP)

#define IUTEST_SKIP GTEST_SKIP
#else

#define IUTEST_SKIP() GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
if( ::testing::internal::AlwaysTrue() ) return GTEST_MESSAGE_("Skipped. ", ::testing::TestPartResult::kSuccess)

#endif

#endif // !defined(IUTEST_USE_GTEST)

Expand Down
6 changes: 6 additions & 0 deletions test/syntax_gtest_tests.cpp
Expand Up @@ -352,6 +352,12 @@ TEST(GTestSyntaxTest, HResultFailed)

#endif

TEST(GTestSyntaxTest, Skip)
{
if( int x = 1 )
GTEST_SKIP() << x;
}

#if IUTEST_HAS_EXCEPTIONS

namespace syntax_tests
Expand Down
6 changes: 6 additions & 0 deletions test/syntax_tests.cpp
Expand Up @@ -450,6 +450,12 @@ IUTEST(SyntaxTest, VariadicHResultFailed)

#endif

TEST(SyntaxTest, Skip)
{
if( int x = 1 )
IUTEST_SKIP() << x;
}

IUTEST(SyntaxTest, Pred1)
{
if( int x=1 )
Expand Down

0 comments on commit a4262c6

Please sign in to comment.