diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 733f220b96..0d3e8dee02 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: diff --git a/docs/Doxyfile b/docs/Doxyfile index eff042a15f..240c3f7427 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -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 diff --git a/include/internal/iutest_option_message.hpp b/include/internal/iutest_option_message.hpp index a0342385bb..3ac095032e 100644 --- a/include/internal/iutest_option_message.hpp +++ b/include/internal/iutest_option_message.hpp @@ -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); diff --git a/include/internal/iutest_stdlib.hpp b/include/internal/iutest_stdlib.hpp index 7d3399dd42..050f982069 100644 --- a/include/internal/iutest_stdlib.hpp +++ b/include/internal/iutest_stdlib.hpp @@ -33,6 +33,21 @@ #include #include +// header +#if defined(__has_include) +# if __has_include() +# 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 +#endif + //====================================================================== // define #if defined(__GLIBCPP__) || defined(__GLIBCXX__) @@ -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 @@ -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) @@ -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 diff --git a/include/iutest_ver.hpp b/include/iutest_ver.hpp index 00872c7ef9..47cdb0d85b 100644 --- a/include/iutest_ver.hpp +++ b/include/iutest_ver.hpp @@ -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 @@ -135,6 +135,7 @@ modification, are permitted provided that the following conditions are met: \n
  • CSV パラメータ生成でファイルオープン失敗した場合の警告レベルを FATAL から WARNING に変更/li>
  • CSV パラメータ生成で要素がなかった場合に WARNING 出力
  • deprecated: IUTEST_USE_OWN_LIST
  • +
  • deprecated: codecvt
  • v1.16.7.0 diff --git a/projects/vscode/iutest.code-workspace b/projects/vscode/iutest.code-workspace index 9e6956e973..3c5f704587 100644 --- a/projects/vscode/iutest.code-workspace +++ b/projects/vscode/iutest.code-workspace @@ -82,7 +82,8 @@ "xstddef": "cpp", "xtr1common": "cpp", "xtree": "cpp", - "xutility": "cpp" + "xutility": "cpp", + "concepts": "cpp" } }, "launch": { diff --git a/test/GNUmakefile b/test/GNUmakefile index 9e2509aa3b..7db4de1b01 100644 --- a/test/GNUmakefile +++ b/test/GNUmakefile @@ -73,6 +73,9 @@ ifdef CI_NODEBUG CXXFLAGS += -g0 -O0 endif +# debug options +# CXXFLAGS += -ftemplate-backtrace-limit=0 + # # # compiler diff --git a/test/check_stdlib.cpp b/test/check_stdlib.cpp index f2fa56f3c9..4a5b237cb9 100644 --- a/test/check_stdlib.cpp +++ b/test/check_stdlib.cpp @@ -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 diff --git a/test/matcher_tests.cpp b/test/matcher_tests.cpp index 8295ab8677..45715b590d 100644 --- a/test/matcher_tests.cpp +++ b/test/matcher_tests.cpp @@ -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 */ @@ -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)