fixing builds
- silencing gcc/clang warnings
- seems that some compiler versions handle the type lists differently (different order) so I extracted the templated test case with a stringified user type to a separate test case template with just 1 type in it's list
diff --git a/examples/all_features/CMakeLists.txt b/examples/all_features/CMakeLists.txt
index 47a7035..989f857 100644
--- a/examples/all_features/CMakeLists.txt
+++ b/examples/all_features/CMakeLists.txt
@@ -63,6 +63,7 @@
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(disabled PRIVATE -Wno-unneeded-internal-declaration)
target_compile_options(disabled PRIVATE -Wno-unused-variable)
+ target_compile_options(disabled PRIVATE -Wno-unused-local-typedef)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(disabled PRIVATE -Wno-unused-local-typedefs)
endif()
diff --git a/examples/all_features/header.h b/examples/all_features/header.h
index 83ff6c4..e407558 100644
--- a/examples/all_features/header.h
+++ b/examples/all_features/header.h
@@ -39,10 +39,10 @@
TEST_CASE_TEMPLATE_INSTANTIATE(header_test, doctest::Types<doctest::String>);
-// to silence GCC warnings when inheriting from the class SomeFixture which has no virtual destructor
-//#if defined(__GNUC__) && !defined(__clang__)
-//#pragma GCC diagnostic ignored "-Weffc++"
-//#endif // __GNUC__
+// to silence GCC warnings when inheriting from some class which has no virtual destructor - happens only on gcc 4.7/4.8
+#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6 && __GNUC_MINOR__ < 9
+#pragma GCC diagnostic ignored "-Weffc++"
+#endif // __GNUC__
struct SomeFixture
{
diff --git a/examples/all_features/stringification.cpp b/examples/all_features/stringification.cpp
index a70cd47..58691df 100644
--- a/examples/all_features/stringification.cpp
+++ b/examples/all_features/stringification.cpp
@@ -43,11 +43,6 @@
};
}
-// to silence GCC warnings when inheriting from the class MyType which has no virtual destructor
-//#if defined(__GNUC__) && !defined(__clang__)
-//#pragma GCC diagnostic ignored "-Weffc++"
-//#endif // __GNUC__
-
template <typename T, typename K>
struct MyType
{
diff --git a/examples/all_features/templated_test_cases.cpp b/examples/all_features/templated_test_cases.cpp
index c20a4ea..59a52e8 100644
--- a/examples/all_features/templated_test_cases.cpp
+++ b/examples/all_features/templated_test_cases.cpp
@@ -4,7 +4,7 @@
// typedefs are required if variadic macro support is not available (otherwise the commas are a problem)
typedef doctest::Types<char, short, int> int_types;
-typedef doctest::Types<float, double> float_types;
+typedef doctest::Types<float, double, float> float_types; // note that types won't be filtered for uniqueness
// =================================================================================================
// NORMAL TEMPLATED TEST CASES
@@ -53,12 +53,6 @@
TypePair<bool, int>
> pairs;
-
-// if variadic macros are supported then "TypePair<bool, int>" can be passed directly to the macro (otherwise the commas are a problem)
-// currently result will be "bool_int_pair" instead of "TypePair<bool, int>" because of the way the type stringification works
-typedef TypePair<bool, int> bool_int_pair;
-TYPE_TO_STRING(bool_int_pair);
-
TEST_CASE_TEMPLATE("multiple types", T, pairs) {
typedef typename T::A T1;
typedef typename T::B T2;
@@ -66,3 +60,16 @@
CHECK(T1() == T1());
CHECK(T2() != T2());
}
+
+// if variadic macros are supported then "TypePair<int, int>" can be passed directly to the macro (otherwise the commas are a problem)
+// currently the string result will be "int_pair" instead of "TypePair<int, int>" because of the way the type stringification works
+typedef TypePair<int, int> int_pair;
+TYPE_TO_STRING(int_pair);
+
+TEST_CASE_TEMPLATE("bad stringification of type pair", T, doctest::Types<int_pair>) {
+ typedef typename T::A T1;
+ typedef typename T::B T2;
+ // use T1 and T2 types
+ CHECK(T1() == T1());
+ CHECK(T2() != T2());
+}
diff --git a/examples/all_features/test_output/templated_test_cases.cpp.txt b/examples/all_features/test_output/templated_test_cases.cpp.txt
index b22ef4a..0373943 100644
--- a/examples/all_features/test_output/templated_test_cases.cpp.txt
+++ b/examples/all_features/test_output/templated_test_cases.cpp.txt
@@ -10,7 +10,16 @@
== TEST CASE ==================================================================
templated_test_cases.cpp(0)
-multiple types<bool_int_pair>
+multiple types<>
+
+templated_test_cases.cpp(0) ERROR!
+ CHECK( T2() != T2() )
+with expansion:
+ CHECK( 0 != 0 )
+
+== TEST CASE ==================================================================
+templated_test_cases.cpp(0)
+multiple types<>
templated_test_cases.cpp(0) ERROR!
CHECK( T2() != T2() )
@@ -28,7 +37,7 @@
== TEST CASE ==================================================================
templated_test_cases.cpp(0)
-multiple types<>
+bad stringification of type pair<int_pair>
templated_test_cases.cpp(0) ERROR!
CHECK( T2() != T2() )
@@ -36,6 +45,6 @@
CHECK( 0 != 0 )
===============================================================================
-[doctest] test cases: 12 | 8 passed | 4 failed |
-[doctest] assertions: 15 | 11 passed | 4 failed |
+[doctest] test cases: 14 | 9 passed | 5 failed |
+[doctest] assertions: 18 | 13 passed | 5 failed |
Program code.
diff --git a/scripts/random_dev_notes.md b/scripts/random_dev_notes.md
index bde1560..8b113cc 100644
--- a/scripts/random_dev_notes.md
+++ b/scripts/random_dev_notes.md
@@ -1,5 +1,8 @@
+asserts, logging macros
+all macros!!!
+
look at boost test again:
http://www.boost.org/doc/libs/1_63_0/libs/test/doc/html/index.html