diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b788444..45ba1ba 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -10,8 +10,23 @@ add_executable(${PROJECT_NAME} variant_test.cpp ) -if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU|Clang") +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") + target_compile_options(${PROJECT_NAME} + PRIVATE + -std=gnu++17 + ) +else() target_compile_options(${PROJECT_NAME} + PRIVATE + -std=c++17 + ) +endif() + +if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + add_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror -ansi -pedantic ) diff --git a/tests/function_test.cpp b/tests/function_test.cpp index 4078766..9d46f2d 100644 --- a/tests/function_test.cpp +++ b/tests/function_test.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tests/main.cpp b/tests/main.cpp index f481b16..2bd3007 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -1,3 +1,5 @@ #define CATCH_CONFIG_MAIN -#include +#include + +int main() { return 0; } diff --git a/tests/optional_test.cpp b/tests/optional_test.cpp index 54dff11..5ccd5dd 100644 --- a/tests/optional_test.cpp +++ b/tests/optional_test.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tests/sequence_container_test.cpp b/tests/sequence_container_test.cpp index 3c173f3..c0ac823 100644 --- a/tests/sequence_container_test.cpp +++ b/tests/sequence_container_test.cpp @@ -1,4 +1,4 @@ -#include +#include #include "utils.h" #include diff --git a/tests/variant_test.cpp b/tests/variant_test.cpp index 9c9ee18..4e7e626 100644 --- a/tests/variant_test.cpp +++ b/tests/variant_test.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include