Skip to content

Commit

Permalink
Merge c41c815 into 11ad1cb
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed Oct 8, 2019
2 parents 11ad1cb + c41c815 commit 0881bb6
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Expand Up @@ -25,7 +25,7 @@ jobs:
run: |
make -C test clean
make -C test showcxxversion
make -C test check_stdlib DEFS=-DIUTEST_HAS_CXX_HDR_FILESYSTEM=0
make -C test check_stdlib
make -C test -j8
make -C test test
arm-none-eabi:
Expand Down
2 changes: 1 addition & 1 deletion docs/Doxyfile
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = iutest
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 1.16.99.29
PROJECT_NUMBER = 1.16.99.30

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
1 change: 1 addition & 0 deletions include/internal/iutest_option_message.hpp
Expand Up @@ -196,6 +196,7 @@ inline void iuOptionMessage::ShowSpec()
IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_STRING_VIEW);
IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_TYPE_TARITS);
IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_VARIANT);
IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_VERSION);
IIUT_SHOW_MACRO(IUTEST_HAS_CXX11);
IIUT_SHOW_MACRO(IUTEST_HAS_CXX14);
IIUT_SHOW_MACRO(IUTEST_HAS_CXX1Z);
Expand Down
23 changes: 21 additions & 2 deletions include/internal/iutest_stdlib.hpp
Expand Up @@ -33,6 +33,21 @@
#include <cstdlib>
#include <limits>

// <version> header
#if defined(__has_include)
# if __has_include(<version>)
# define IUTEST_HAS_CXX_HDR_VERSION 1
# endif
#endif

#if !defined(IUTEST_HAS_CXX_HDR_VERSION)
# define IUTEST_HAS_CXX_HDR_VERSION 0
#endif

#if IUTEST_HAS_CXX_HDR_VERSION
#include <version>
#endif

//======================================================================
// define
#if defined(__GLIBCPP__) || defined(__GLIBCXX__)
Expand Down Expand Up @@ -142,7 +157,7 @@
# endif
#endif

#if defined(__GNUC__)
#if defined(__GNUC__) && !defined(__clang__)
// GCC 8.x requires linking with -lstdc++fs. (iutest not support)
# if (__GNUC__ < 9)
# define IUTEST_HAS_CXX_HDR_FILESYSTEM 0
Expand Down Expand Up @@ -329,6 +344,10 @@
# endif
#endif

#if defined(IUTEST_HAS_CXX_HDR_CODECVT) && IUTEST_HAS_CXX_HDR_CODECVT
IUTEST_PRAGMA_MESSAGE("iutest use codecvt, but codecvt was deprecated. If you do not want to use this, define IUTEST_HAS_CXX_HDR_CODECVT 0")
#endif

#endif

#if defined(__has_include)
Expand Down Expand Up @@ -416,7 +435,7 @@
//======================================================================
// define
#if !defined(IUTEST_HAS_STD_FILESYSTEM)
# if defined(__cpp_lib_filesystem) && __cpp_lib_filesystem >= 201703
# if IUTEST_HAS_CXX_HDR_FILESYSTEM && defined(__cpp_lib_filesystem) && __cpp_lib_filesystem >= 201703
# if !defined(__cpp_lib_experimental_filesystem)
# define IUTEST_HAS_STD_FILESYSTEM 1
# endif
Expand Down
5 changes: 3 additions & 2 deletions include/iutest_ver.hpp
Expand Up @@ -17,11 +17,11 @@

//======================================================================
// define
#define IUTEST_VER 0x01169929u //!< iutest version 1.16.99.29
#define IUTEST_VER 0x01169930u //!< iutest version 1.16.99.30
#define IUTEST_MAJORVER 0x01u //!< Major Version
#define IUTEST_MINORVER 0x16u //!< Minor Version
#define IUTEST_MICROVER 0x99u //!< Micro Version
#define IUTEST_REVISION 0x29u //!< Revision
#define IUTEST_REVISION 0x30u //!< Revision

#define IUTEST_BUILD IUTEST_MICROVER //!< @deprecated

Expand Down Expand Up @@ -135,6 +135,7 @@ modification, are permitted provided that the following conditions are met: \n
<li>CSV パラメータ生成でファイルオープン失敗した場合の警告レベルを FATAL から WARNING に変更/li>
<li>CSV パラメータ生成で要素がなかった場合に WARNING 出力</li>
<li>deprecated: IUTEST_USE_OWN_LIST</li>
<li>deprecated: codecvt</li>
</ul>
</li>
<li>v1.16.7.0
Expand Down
3 changes: 2 additions & 1 deletion projects/vscode/iutest.code-workspace
Expand Up @@ -82,7 +82,8 @@
"xstddef": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp"
"xutility": "cpp",
"concepts": "cpp"
}
},
"launch": {
Expand Down
3 changes: 3 additions & 0 deletions test/GNUmakefile
Expand Up @@ -73,6 +73,9 @@ ifdef CI_NODEBUG
CXXFLAGS += -g0 -O0
endif

# debug options
# CXXFLAGS += -ftemplate-backtrace-limit=0

#
#
# compiler
Expand Down
1 change: 1 addition & 0 deletions test/check_stdlib.cpp
Expand Up @@ -40,6 +40,7 @@ int main(int , char* [])
SHOW_MACRO(IUTEST_HAS_CXX_HDR_STRING_VIEW);
SHOW_MACRO(IUTEST_HAS_CXX_HDR_TYPE_TARITS);
SHOW_MACRO(IUTEST_HAS_CXX_HDR_VARIANT);
SHOW_MACRO(IUTEST_HAS_CXX_HDR_VERSION);
SHOW_MACRO(IUTEST_HAS_HDR_CXXABI);
SHOW_MACRO(IUTEST_HAS_HDR_SYSTIME);
#ifdef IUTEST_LIBSTDCXX_VERSION
Expand Down
26 changes: 25 additions & 1 deletion test/matcher_tests.cpp
Expand Up @@ -6,7 +6,7 @@
*
* @author t.shirayanagi
* @par copyright
* Copyright (C) 2014-2018, Takazumi Shirayanagi\n
* Copyright (C) 2014-2019, Takazumi Shirayanagi\n
* This software is released under the new BSD License,
* see LICENSE
*/
Expand Down Expand Up @@ -771,6 +771,30 @@ IUTEST(MatcherFailure, ContainsRegex)
#endif


#if IUTEST_HAS_MATCHER_OPTIONAL

IUTEST(Matcher, Optional)
{
IUTEST_EXPECT_THAT("hoge", ElementsAre('h', 'o', 'g', 'e', '\0'));
#if !defined(IUTEST_USE_GMOCK)
IUTEST_EXPECT_THAT(va, ElementsAre(Ge(0), Gt(0)));
#endif
}

IUTEST(MatcherFailure, ElementsAre)
{
CHECK_FAILURE( IUTEST_ASSERT_THAT("hoge"
, ElementsAre( 'h', 'o', 'G', 'e', '\0')), "ElementsAre(2): G");
CHECK_FAILURE( IUTEST_ASSERT_THAT(va
, ElementsAre(Ge(0), Gt(0), Lt(1))), "ElementsAre(2): Lt: 1");
CHECK_FAILURE( IUTEST_ASSERT_THAT(gn, Each(
ElementsAre(Lt(3), Lt(3)))), "Each: ElementsAre: {Lt: 3, Lt: 3}");
CHECK_FAILURE( IUTEST_ASSERT_THAT(gc
, ElementsAre( Ge(0), Gt(0), Ne(0), Eq(0) ) ), "ElementsAre: argument[3] is less than 4");
}

#endif

#if IUTEST_HAS_MATCHER_ALLOF_AND_ANYOF

IUTEST(Matcher, AllOf)
Expand Down

0 comments on commit 0881bb6

Please sign in to comment.