summaryrefslogtreecommitdiffstats
path: root/test/headers
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-06-29 09:04:27 -0400
committerDavid Robillard <d@drobilla.net>2022-07-20 16:24:23 -0400
commit127ded1247765f9ee0db061bf81cf1d2f0088917 (patch)
tree2659f0c5e4aef02846545c8e4a950406fc62d14c /test/headers
parent8571ffc9f4ad9165dde3407641e73ec7737ae42c (diff)
downloadraul-127ded1247765f9ee0db061bf81cf1d2f0088917.tar.gz
raul-127ded1247765f9ee0db061bf81cf1d2f0088917.tar.bz2
raul-127ded1247765f9ee0db061bf81cf1d2f0088917.zip
Add header warning test
Diffstat (limited to 'test/headers')
-rw-r--r--test/headers/.clang-tidy33
-rw-r--r--test/headers/test_headers.cpp39
2 files changed, 72 insertions, 0 deletions
diff --git a/test/headers/.clang-tidy b/test/headers/.clang-tidy
new file mode 100644
index 0000000..374dbd7
--- /dev/null
+++ b/test/headers/.clang-tidy
@@ -0,0 +1,33 @@
+Checks: >
+ *,
+ -*-avoid-c-arrays,
+ -*-magic-numbers,
+ -*-no-malloc,
+ -abseil-string-find-str-contains,
+ -altera-*,
+ -android-cloexec-accept,
+ -bugprone-easily-swappable-parameters,
+ -cppcoreguidelines-owning-memory,
+ -cppcoreguidelines-pro-bounds-array-to-pointer-decay,
+ -cppcoreguidelines-pro-bounds-pointer-arithmetic,
+ -cppcoreguidelines-pro-type-const-cast,
+ -cppcoreguidelines-pro-type-reinterpret-cast,
+ -fuchsia-default-arguments*,
+ -fuchsia-overloaded-operator,
+ -google-runtime-int,
+ -hicpp-no-array-decay,
+ -llvmlibc-*,
+ -modernize-return-braced-init-list,
+ -modernize-use-nodiscard,
+ -modernize-use-trailing-return-type,
+ -readability-identifier-length,
+ -readability-implicit-bool-conversion,
+CheckOptions:
+ - key: modernize-use-override.AllowOverrideAndFinal
+ value: 'true'
+CheckOptions:
+ - key: cppcoreguidelines-explicit-virtual-functions.AllowOverrideAndFinal
+ value: 'true'
+WarningsAsErrors: '*'
+HeaderFilterRegex: '.*'
+FormatStyle: file
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;
+}