Disable certain warnings at the file-level rather than build-level

Work #136
Close #137 - Remove IWYU pragma from headers
This commit is contained in:
S David 2023-08-01 23:15:10 -04:00
parent 86dab33657
commit 146b1f2b7f
4 changed files with 17 additions and 11 deletions

View File

@ -14,8 +14,6 @@ r* Copyright © 2018-2021 Saul D. Beniquez
#include <sys/types.h> // Unknown why this isn't included in cstdint.
#endif
// IWYU pragma: begin_exports
#include "types/cstring.hpp" // IWYU pragma: keep
#include "types/errors.hpp" // IWYU pragma: keep
#include "types/numbers.hpp" // IWYU pragma: keep
// IWYU pragma: end_exports
#include "types/cstring.hpp"
#include "types/errors.hpp"
#include "types/numbers.hpp"

View File

@ -8,7 +8,8 @@
*/
#pragma once
#include "framework/core/types.hpp" // IFYU: keep
#include "framework/core/types.hpp"
#include <utility>
namespace QW::Core::Types {

View File

@ -11,9 +11,8 @@ tests: $(check_PROGRAMS)
thirdparty_library_includes=-I ${srcdir}/third_party/FakeIt/include
thirdparty_library_includes+=-I ${srcdir}/third_party/FakeIt/config/catch
# Ignore errors that are usually coming from the testing frameworks themselves
test_disabled_warnings=-Wno-deprecated-declarations -Wno-defaulted-function-deleted\
-Wno-zero-length-array
#test_disabled_warnings=-Wno-deprecated-declarations -Wno-defaulted-function-deleted\
# -Wno-zero-length-array
tests_addl_cflags=
tests_addl_cflags+= -I ${srcdir}/src/tests -DUNIT_TEST=1
@ -24,7 +23,8 @@ game_tests_CPPFLAGS= $(AM_CPPFLAGS) $(PROJECT_INCLUDE_FLAGS)
game_tests_CPPFLAGS+= $(tests_addl_cflags)
game_tests_CPPFLAGS+= $(SDL2_CFLAGS) -DUNIT_TEST=1
game_tests_CXXFLAGS= ${AM_CXXFLAGS} ${test_disabled_warnings}
game_tests_CXXFLAGS= ${AM_CXXFLAGS}
#game_tests_CXXFLAGS+=${test_disabled_warnings}
game_tests_LDADD= libframework-core-test.la
game_tests_LDADD+= $(CATCH2_LIBS) $(SDL2_LIBS) $(NLOHMANN_JSON_LIBS)

View File

@ -9,14 +9,21 @@
#pragma once
// IWYU pragma: begin_exports
// Ignore warnings coming from the testing frameworks themselves
// #pragma GCC diagnostic push
// #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
// #pragma GCC diagnostic ignored "-Wzero-length-array"
#include <catch2/catch_test_macros.hpp>
#include <fakeit.hpp>
// #pragma GCC diagnostic pop
#pragma GCC diagnostic ignored "-Wunused-variable"
#define BEGIN_TEST_SUITE(name) \
static const char* TEST_SUITE_NAME = "[" name "]"; \
namespace
#define SUITE_TEST(testname) TEST_CASE(#testname, TEST_SUITE_NAME)
#define FIXTURE_CASE(FixtureName, testname) \
TEST_CASE_METHOD(FixtureName, #testname, TEST_SUITE_NAME)