From 78467b69273e2b70a7dea5983b5c5306097c0b04 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Thu, 12 Mar 2020 12:36:47 +1100 Subject: [PATCH] tests: Add -Wall, -Wextra, -pedantic, -Werror --- tests/test_compile_headers_as_c11/CMakeLists.txt | 6 ++++++ tests/test_compile_headers_as_c11/main.c | 1 + tests/test_compile_headers_as_c99/CMakeLists.txt | 6 ++++++ tests/test_compile_headers_as_c99/main.c | 1 + tests/test_compile_headers_as_cpp/CMakeLists.txt | 6 ++++++ tests/test_compile_headers_as_cpp/main.cpp | 1 + 6 files changed, 21 insertions(+) diff --git a/tests/test_compile_headers_as_c11/CMakeLists.txt b/tests/test_compile_headers_as_c11/CMakeLists.txt index 5db994c..dcd8acc 100644 --- a/tests/test_compile_headers_as_c11/CMakeLists.txt +++ b/tests/test_compile_headers_as_c11/CMakeLists.txt @@ -7,4 +7,10 @@ set(CMAKE_C_STANDARD 11) add_executable(test_compile_headers_as_c11 main.c) +target_compile_options(test_compile_headers_as_c11 PRIVATE + -Wall + -Wextra + -pedantic + -Werror) + wut_create_rpx(test_compile_headers_as_c11) diff --git a/tests/test_compile_headers_as_c11/main.c b/tests/test_compile_headers_as_c11/main.c index 73a9159..70b21cc 100644 --- a/tests/test_compile_headers_as_c11/main.c +++ b/tests/test_compile_headers_as_c11/main.c @@ -2,5 +2,6 @@ int main(int argc, char **argv) { + (void)argc, (void)argv; return 0; } diff --git a/tests/test_compile_headers_as_c99/CMakeLists.txt b/tests/test_compile_headers_as_c99/CMakeLists.txt index e5225a0..25cf08b 100644 --- a/tests/test_compile_headers_as_c99/CMakeLists.txt +++ b/tests/test_compile_headers_as_c99/CMakeLists.txt @@ -7,4 +7,10 @@ set(CMAKE_C_STANDARD 99) add_executable(test_compile_headers_as_c99 main.c) +target_compile_options(test_compile_headers_as_c99 PRIVATE + -Wall + -Wextra + -pedantic + -Werror) + wut_create_rpx(test_compile_headers_as_c99) diff --git a/tests/test_compile_headers_as_c99/main.c b/tests/test_compile_headers_as_c99/main.c index 73a9159..70b21cc 100644 --- a/tests/test_compile_headers_as_c99/main.c +++ b/tests/test_compile_headers_as_c99/main.c @@ -2,5 +2,6 @@ int main(int argc, char **argv) { + (void)argc, (void)argv; return 0; } diff --git a/tests/test_compile_headers_as_cpp/CMakeLists.txt b/tests/test_compile_headers_as_cpp/CMakeLists.txt index 0b44a10..9131c84 100644 --- a/tests/test_compile_headers_as_cpp/CMakeLists.txt +++ b/tests/test_compile_headers_as_cpp/CMakeLists.txt @@ -5,4 +5,10 @@ include("${DEVKITPRO}/wut/share/wut.cmake" REQUIRED) add_executable(test_compile_headers_as_cpp main.cpp) +target_compile_options(test_compile_headers_as_cpp PRIVATE + -Wall + -Wextra + -pedantic + -Werror) + wut_create_rpx(test_compile_headers_as_cpp) diff --git a/tests/test_compile_headers_as_cpp/main.cpp b/tests/test_compile_headers_as_cpp/main.cpp index 73a9159..70b21cc 100644 --- a/tests/test_compile_headers_as_cpp/main.cpp +++ b/tests/test_compile_headers_as_cpp/main.cpp @@ -2,5 +2,6 @@ int main(int argc, char **argv) { + (void)argc, (void)argv; return 0; }