Skip to content

Commit

Permalink
update r828
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed Apr 23, 2015
1 parent b3dd422 commit 1fba58b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/impl/iutest_env.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 19 additions & 0 deletions include/internal/iutest_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); }

Expand Down
2 changes: 2 additions & 0 deletions include/iutest_env.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -246,6 +247,7 @@ class TestEnv
typedef TestFlag::Fragment<TestFlag::CATCH_EXCEPTION_GLOBAL> catch_exceptions_global;

typedef TestFlag::Fragment<TestFlag::FILELOCATION_STYLE_MSVC> file_location_style_msvc;
typedef TestFlag::Fragment<TestFlag::VERBOSE> verbose;

/**
* @}
Expand Down
4 changes: 2 additions & 2 deletions include/iutest_ver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/filter.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# iutest_filter_file_tests testdata
*Run*
# comment
*OK*

0 comments on commit 1fba58b

Please sign in to comment.