summaryrefslogtreecommitdiffhomepage
path: root/tests/helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/helper.h')
-rw-r--r--tests/helper.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/helper.h b/tests/helper.h
new file mode 100644
index 0000000..eba74cd
--- /dev/null
+++ b/tests/helper.h
@@ -0,0 +1,56 @@
+#pragma once
+
+#include <boost/test/data/dataset.hpp>
+#include <boost/test/data/monomorphic.hpp>
+#include <boost/test/data/test_case.hpp>
+
+#include <boost/algorithm/string.hpp>
+#include <boost/beast/core.hpp>
+#include <boost/beast/http.hpp>
+#include <boost/beast/websocket.hpp>
+#include <boost/beast/websocket/ssl.hpp>
+#include <boost/beast/ssl.hpp>
+#include <boost/beast/version.hpp>
+#include <boost/asio/buffer.hpp>
+#include <boost/asio/buffers_iterator.hpp>
+#include <boost/asio/connect.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/ssl/error.hpp>
+#include <boost/asio/ssl/stream.hpp>
+#include <boost/property_tree/ptree.hpp>
+#include <boost/property_tree/xml_parser.hpp>
+
+#include <fmt/core.h>
+
+#include <chrono>
+#include <exception>
+#include <filesystem>
+#include <iostream>
+#include <memory>
+#include <mutex>
+#include <sstream>
+#include <stdexcept>
+#include <string>
+#include <thread>
+
+#include <ext/stdio_filebuf.h>
+#include <signal.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/types.h>
+
+#include <libreichwein/file.h>
+#include <libreichwein/process.h>
+
+extern const std::filesystem::path testConfigFilename;
+extern const std::filesystem::path testCertFilename;
+extern const std::filesystem::path testKeyFilename;
+
+bool tcp_is_pid_listening_on(const std::string& tcp, pid_t pid, int port);
+bool is_pid_listening_on(pid_t pid, int port);
+void wait_for_pid_listening_on(pid_t pid, int port);
+int port_from_config(const std::string& config);
+void load_root_certificates(boost::asio::ssl::context& ctx);
+std::pair<std::string,std::string> HTTP(const std::string& target, bool ipv6 = true, bool HTTP11 = true, boost::beast::http::verb method = boost::beast::http::verb::get);
+std::pair<std::string,std::string> HTTPS(const std::string& target, bool ipv6 = true, bool HTTP11 = true, boost::beast::http::verb method = boost::beast::http::verb::get);