diff --git a/include/impl/iutest_env.ipp b/include/impl/iutest_env.ipp index 29d3630831..3664661017 100644 --- a/include/impl/iutest_env.ipp +++ b/include/impl/iutest_env.ipp @@ -459,8 +459,8 @@ IUTEST_IPP_INLINE bool TestEnv::ParseFilterOption(const char* option) ::std::string filter = fp->ReadAll(); detail::IFileSystem::Free(fp); - detail::StringReplaceToLF(filter); + filter = detail::StringRemoveComment(filter); detail::StringReplace(filter, '\n', ":"); set_test_filter(filter.c_str()); return true; diff --git a/include/internal/iutest_string.hpp b/include/internal/iutest_string.hpp index b18b581d1a..a106722ed6 100644 --- a/include/internal/iutest_string.hpp +++ b/include/internal/iutest_string.hpp @@ -147,6 +147,25 @@ inline void StringReplaceToLF(::std::string& str) } StringReplace(str, '\r', "\n"); } +inline ::std::string StringRemoveComment(const ::std::string& str) +{ + ::std::string r; + ::std::string::size_type prev = 0; + ::std::string::size_type pos = str.find('\n', 0); + while( pos != ::std::string::npos ) + { + ++pos; + if( str[prev] != '#' ) { + r += str.substr(prev, pos-prev); + } + prev = pos; + pos = str.find('\n', pos); + } + if( str[prev] != '#' ) { + r += str.substr(prev); + } + return r; +} inline IUTEST_CXX_CONSTEXPR char ToHex(unsigned int n) { return (n&0xF) >= 0xA ? 'A'+((n&0xF)-0xA) : '0'+(n&0xF); } diff --git a/include/iutest_env.hpp b/include/iutest_env.hpp index 2fc9e30895..ecab6b3464 100644 --- a/include/iutest_env.hpp +++ b/include/iutest_env.hpp @@ -42,6 +42,7 @@ * output (string)\n * repeat (int)\n * list_tests (bool)\n + * verbose (bool)\n * file_location_style_msvc (bool)\n * default_package_name (string)\n * ostream_formatter (ostream)\n @@ -246,6 +247,7 @@ class TestEnv typedef TestFlag::Fragment catch_exceptions_global; typedef TestFlag::Fragment file_location_style_msvc; + typedef TestFlag::Fragment verbose; /** * @} diff --git a/include/iutest_ver.hpp b/include/iutest_ver.hpp index d06bab4655..e252b0a218 100644 --- a/include/iutest_ver.hpp +++ b/include/iutest_ver.hpp @@ -17,11 +17,11 @@ //====================================================================== // define -#define IUTEST_VER 0x01119900u //!< iutest version 1.11.99.0 +#define IUTEST_VER 0x01119901u //!< iutest version 1.11.99.1 #define IUTEST_MAJORVER 0x01u //!< Major Version #define IUTEST_MINORVER 0x11u //!< Minor Version #define IUTEST_BUILD 0x99u //!< Build -#define IUTEST_REVISION 0x00u //!< Revision +#define IUTEST_REVISION 0x01u //!< Revision /** * @mainpage diff --git a/test/testdata/filter.txt b/test/testdata/filter.txt index f1d6b2bf5e..f01869072b 100644 --- a/test/testdata/filter.txt +++ b/test/testdata/filter.txt @@ -1,2 +1,4 @@ +# iutest_filter_file_tests testdata *Run* +# comment *OK* \ No newline at end of file