summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.clant.json1
-rw-r--r--meson.build1
-rw-r--r--test/headers/.clang-tidy (renamed from include/.clang-tidy)2
-rw-r--r--test/headers/test_headers.cpp39
-rw-r--r--test/meson.build37
5 files changed, 77 insertions, 3 deletions
diff --git a/.clant.json b/.clant.json
index 712d9d2..76cae6d 100644
--- a/.clant.json
+++ b/.clant.json
@@ -1,5 +1,4 @@
{
"version": "1.0.0",
- "include_dirs": ["include"],
"mapping_files": [".includes.imp"]
}
diff --git a/meson.build b/meson.build
index a412e06..23bbe04 100644
--- a/meson.build
+++ b/meson.build
@@ -12,6 +12,7 @@ project('raul', ['cpp'],
])
raul_src_root = meson.current_source_dir()
+raul_build_root = meson.current_build_dir()
versioned_name = 'raul-@0@'.format(meson.project_version().split('.')[0])
#######################
diff --git a/include/.clang-tidy b/test/headers/.clang-tidy
index 890edd2..374dbd7 100644
--- a/include/.clang-tidy
+++ b/test/headers/.clang-tidy
@@ -3,12 +3,10 @@ Checks: >
-*-avoid-c-arrays,
-*-magic-numbers,
-*-no-malloc,
- -*-uppercase-literal-suffix,
-abseil-string-find-str-contains,
-altera-*,
-android-cloexec-accept,
-bugprone-easily-swappable-parameters,
- -clang-diagnostic-unused-macros,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
diff --git a/test/headers/test_headers.cpp b/test/headers/test_headers.cpp
new file mode 100644
index 0000000..6149f43
--- /dev/null
+++ b/test/headers/test_headers.cpp
@@ -0,0 +1,39 @@
+/*
+ Copyright 2022 David Robillard <d@drobilla.net>
+
+ Raul is free software: you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation, either version 3 of the License, or any later version.
+
+ Raul is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Raul. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "raul/Array.hpp" // IWYU pragma: keep
+#include "raul/Deletable.hpp" // IWYU pragma: keep
+#include "raul/DoubleBuffer.hpp" // IWYU pragma: keep
+#include "raul/Exception.hpp" // IWYU pragma: keep
+#include "raul/Maid.hpp" // IWYU pragma: keep
+#include "raul/Noncopyable.hpp" // IWYU pragma: keep
+#include "raul/Path.hpp" // IWYU pragma: keep
+#include "raul/RingBuffer.hpp" // IWYU pragma: keep
+#include "raul/Semaphore.hpp" // IWYU pragma: keep
+#include "raul/Symbol.hpp" // IWYU pragma: keep
+
+#ifndef _WIN32
+# include "raul/Process.hpp" // IWYU pragma: keep
+# include "raul/Socket.hpp" // IWYU pragma: keep
+#endif
+
+#if defined(__GNUC__)
+__attribute__((const))
+#endif
+int
+main()
+{
+ return 0;
+}
diff --git a/test/meson.build b/test/meson.build
index 2321712..8411377 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -13,6 +13,43 @@ if not get_option('tests').disabled() and not meson.is_subproject()
endif
endif
+###################
+# Header Warnings #
+###################
+
+header_args = []
+if cpp.get_id() == 'clang'
+ header_args += [
+ '-Wno-c++17-extensions',
+ '-Wno-padded',
+ '-Wno-weak-vtables',
+ ]
+elif cpp.get_id() == 'gcc'
+ header_args += [
+ '-Wno-abi-tag',
+ '-Wno-multiple-inheritance',
+ '-Wno-padded',
+ '-Wno-switch-default',
+ '-Wno-useless-cast',
+ ]
+elif cpp.get_id() == 'msvc'
+ header_args += [
+ '/wd4626', # assignment operator implicitly deleted
+ '/wd5027', # move assignment operator implicitly deleted
+ ]
+endif
+
+# Test that headers have (almost) no warnings (ignoring usual suppressions)
+test(
+ 'test_headers',
+ executable(
+ 'test_headers',
+ files('headers/test_headers.cpp'),
+ cpp_args: header_args,
+ dependencies: raul_dep,
+ ),
+)
+
##############
# Unit Tests #
##############