Skip to content

Commit

Permalink
fix empty name
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed Aug 29, 2020
1 parent 6263608 commit de419cd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
1 change: 1 addition & 0 deletions include/internal/iutest_internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
#define IUTEST_TEST_(testsuite_, testname_, parent_class_, type_id_) \
IUTEST_STATIC_ASSERT_MSG(sizeof(IUTEST_PP_TOSTRING(testsuite_)) > 1, "testsuite_ must not be empty"); \
IUTEST_STATIC_ASSERT_MSG(sizeof(IUTEST_PP_TOSTRING(testname_)) > 1, "testname_ must not be empty"); \
IUTEST_STATIC_ASSERT_MSG(sizeof(IUTEST_PP_TOSTRING(IIUT_TO_NAME_(testsuite_))) > 1, "testsuite alias name must not be empty"); \
class IUTEST_TEST_CLASS_NAME_(testsuite_, testname_) : public parent_class_ { \
IUTEST_PP_DISALLOW_COPY_AND_ASSIGN(IUTEST_TEST_CLASS_NAME_(testsuite_, testname_)); \
public: IUTEST_TEST_CLASS_NAME_(testsuite_, testname_)() {} \
Expand Down
4 changes: 3 additions & 1 deletion test/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,10 @@ ifeq ($(CI),true)
IUTEST_COMPILE_ERROR_TEST_OPTION+= --verbose
endif

CXX_ERROR_TEST_FLAGS:=-ferror-limit=100

$(ERR_TARGETS) : $(OUTDIR)/% : %.cpp $(IUTEST_HEADERS) $(MAKEFILE)
$(CXX) $(IUTEST_INCLUDE) $(CXXFLAGS) -o $@ $< $(LDFLAGS) 2>&1 | python $(PY_COMPILEERROR_TEST_TOOL) $(IUTEST_COMPILE_ERROR_TEST_OPTION)
$(CXX) $(IUTEST_INCLUDE) $(CXXFLAGS) $(CXX_ERROR_TEST_FLAGS) -o $@ $< $(LDFLAGS) 2>&1 | python $(PY_COMPILEERROR_TEST_TOOL) $(IUTEST_COMPILE_ERROR_TEST_OPTION)

else

Expand Down
12 changes: 12 additions & 0 deletions test/empty_testname_failure_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ IUTEST_F(, Test)

}

#if IUTEST_HAS_TESTFIXTURE_ALIAS_BY_TUPLE
namespace fixture_alias
{

IUTEST_TEST_STATICASSERT("testsuite alias name must not be empty")
IUTEST_F((, BaseFixture), Test)
{
}

}
#endif

#if IUTEST_HAS_TYPED_TEST

namespace emptyname
Expand Down
15 changes: 0 additions & 15 deletions test/empty_testname_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,6 @@

// well-formed test definitions..

class BaseFixture : public ::iutest::Test
{
};

#if IUTEST_HAS_TESTFIXTURE_ALIAS_BY_TUPLE
namespace fixture_alias
{

IUTEST_F((, BaseFixture), Test)
{
}

}
#endif

#if IUTEST_HAS_PARAM_TEST

class ParamTest : public ::iutest::TestWithParam<int> {};
Expand Down

0 comments on commit de419cd

Please sign in to comment.