diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/TestClient.hpp | 10 | ||||
-rw-r--r-- | tests/ingen_bench.cpp | 18 | ||||
-rw-r--r-- | tests/ingen_test.cpp | 40 | ||||
-rw-r--r-- | tests/lint/meson.build | 24 | ||||
-rw-r--r-- | tests/meson.build | 8 | ||||
-rw-r--r-- | tests/test_utils.hpp | 4 |
6 files changed, 67 insertions, 37 deletions
diff --git a/tests/TestClient.hpp b/tests/TestClient.hpp index b864928e..72265b14 100644 --- a/tests/TestClient.hpp +++ b/tests/TestClient.hpp @@ -17,11 +17,11 @@ #ifndef INGEN_TESTCLIENT_HPP #define INGEN_TESTCLIENT_HPP -#include "ingen/Interface.hpp" -#include "ingen/Log.hpp" -#include "ingen/Message.hpp" -#include "ingen/Status.hpp" -#include "ingen/URI.hpp" +#include <ingen/Interface.hpp> +#include <ingen/Log.hpp> +#include <ingen/Message.hpp> +#include <ingen/Status.hpp> +#include <ingen/URI.hpp> #include <variant> diff --git a/tests/ingen_bench.cpp b/tests/ingen_bench.cpp index c20e2782..ee890401 100644 --- a/tests/ingen_bench.cpp +++ b/tests/ingen_bench.cpp @@ -14,14 +14,14 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#include "ingen/Atom.hpp" -#include "ingen/Clock.hpp" -#include "ingen/Configuration.hpp" -#include "ingen/EngineBase.hpp" -#include "ingen/Forge.hpp" -#include "ingen/Parser.hpp" -#include "ingen/World.hpp" -#include "ingen/runtime_paths.hpp" +#include <ingen/Atom.hpp> +#include <ingen/Clock.hpp> +#include <ingen/Configuration.hpp> +#include <ingen/EngineBase.hpp> +#include <ingen/Forge.hpp> +#include <ingen/Parser.hpp> +#include <ingen/World.hpp> +#include <ingen/runtime_paths.hpp> #include <chrono> #include <cstdint> @@ -130,7 +130,7 @@ run(int argc, char** argv) if (ftell(log.get()) == 0) { fprintf(log.get(), "# n_threads\trun_time\treal_time\n"); } - fprintf(log.get(), "%u\t%f\t%f\n", + fprintf(log.get(), "%d\t%f\t%f\n", world->conf().option("threads").get<int32_t>(), static_cast<double>(t_end - t_start) / 1000000.0, (n_test_frames / 48000.0)); diff --git a/tests/ingen_test.cpp b/tests/ingen_test.cpp index 1e0fcfec..215d20a1 100644 --- a/tests/ingen_test.cpp +++ b/tests/ingen_test.cpp @@ -16,26 +16,26 @@ #include "TestClient.hpp" -#include "ingen/Atom.hpp" -#include "ingen/AtomForge.hpp" -#include "ingen/AtomReader.hpp" -#include "ingen/Configuration.hpp" -#include "ingen/EngineBase.hpp" -#include "ingen/FilePath.hpp" -#include "ingen/Interface.hpp" -#include "ingen/Parser.hpp" -#include "ingen/Serialiser.hpp" -#include "ingen/Store.hpp" -#include "ingen/URI.hpp" -#include "ingen/URIMap.hpp" -#include "ingen/World.hpp" -#include "ingen/fmt.hpp" -#include "ingen/memory.hpp" -#include "ingen/runtime_paths.hpp" -#include "raul/Path.hpp" -#include "serd/serd.h" -#include "sord/sordmm.hpp" -#include "sratom/sratom.h" +#include <ingen/Atom.hpp> +#include <ingen/AtomForge.hpp> +#include <ingen/AtomReader.hpp> +#include <ingen/Configuration.hpp> +#include <ingen/EngineBase.hpp> +#include <ingen/FilePath.hpp> +#include <ingen/Interface.hpp> +#include <ingen/Parser.hpp> +#include <ingen/Serialiser.hpp> +#include <ingen/Store.hpp> +#include <ingen/URI.hpp> +#include <ingen/URIMap.hpp> +#include <ingen/World.hpp> +#include <ingen/fmt.hpp> +#include <ingen/memory.hpp> +#include <ingen/runtime_paths.hpp> +#include <raul/Path.hpp> +#include <serd/serd.h> +#include <sord/sordmm.hpp> +#include <sratom/sratom.h> #include <chrono> #include <cstdint> diff --git a/tests/lint/meson.build b/tests/lint/meson.build new file mode 100644 index 00000000..c641cbaa --- /dev/null +++ b/tests/lint/meson.build @@ -0,0 +1,24 @@ +# Copyright 2019-2024 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: 0BSD OR GPL-3.0-or-later + +if not meson.is_subproject() + # Check code with cppcheck + cppcheck = find_program('cppcheck', required: false) + if cppcheck.found() + compdb_path = join_paths(ingen_build_root, 'compile_commands.json') + suppress_path = join_paths(ingen_src_root, '.suppress.cppcheck') + test( + 'cppcheck', + cppcheck, + args: [ + '--cppcheck-build-dir=' + meson.current_build_dir(), + '--enable=warning,style,performance,portability', + '--error-exitcode=1', + '--project=' + compdb_path, + '--suppressions-list=' + suppress_path, + '-q', + ], + suite: 'code', + ) + endif +endif diff --git a/tests/meson.build b/tests/meson.build index 2c7f799f..1637230b 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -90,3 +90,11 @@ foreach test : integration_tests ], ) endforeach + +######## +# Lint # +######## + +if get_option('lint') + subdir('lint') +endif diff --git a/tests/test_utils.hpp b/tests/test_utils.hpp index e595b7c8..4c358739 100644 --- a/tests/test_utils.hpp +++ b/tests/test_utils.hpp @@ -14,13 +14,11 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#include "ingen/fmt.hpp" +#include <ingen/fmt.hpp> #include <iostream> #include <string> -// IWYU pragma: no_include "ingen/FilePath.hpp" - #define EXPECT_TRUE(value) \ do { \ if (!(value)) { \ |