From 3d6c2f43932bf8930ea0b1a53f6ebe048c7803bc Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 25 Aug 2025 15:18:41 +0100 Subject: Move common test code to its own library --- test/test-util.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/test-util.hpp (limited to 'test/test-util.hpp') diff --git a/test/test-util.hpp b/test/test-util.hpp new file mode 100644 index 0000000..20020f8 --- /dev/null +++ b/test/test-util.hpp @@ -0,0 +1,24 @@ +#pragma once + +#include "pq-mock.h" +#include + +namespace WebStat { +#define XSTR(s) STR(s) +#define STR(s) #s + inline const std::filesystem::path SRC_DIR(XSTR(SRC)); +#undef XSTR +#undef STR + + template + using DeleteWith = decltype([](auto obj) { + return Deleter(obj); + }); + using FilePtr = std::unique_ptr>; + + struct MockDB : public DB::PluginMock { + MockDB(); + }; + + template using ParseData = std::tuple; +} -- cgit v1.2.3