From 94b9b9f9e558ed6687dfc8fe760c088aa98b6876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Siedlaczek?= Date: Wed, 1 Nov 2023 18:43:09 -0400 Subject: [PATCH] Add missing includes and upgrade Catch2 (#4) --- CMakeLists.txt | 2 +- external/CMakeLists.txt | 5 ----- external/Catch2 | 2 +- include/wapopp/wapopp.hpp | 14 ++++++-------- test/CMakeLists.txt | 2 ++ test/test_detail.cpp | 5 +++-- test/test_wapopp.cpp | 4 ++-- 7 files changed, 15 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a74cbeb..5a9f573 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.5) project(wapopp VERSION 1.0 LANGUAGES CXX) if (CMAKE_BUILD_TYPE) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 6f60993..c1f6f0c 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -1,8 +1,3 @@ -EXECUTE_PROCESS(COMMAND git submodule update --init - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/.. - OUTPUT_QUIET - ) - # Add JSON for Modern C++ if(NOT TARGET nlohmann_json) set(JSON_BuildTests OFF CACHE INTERNAL "") diff --git a/external/Catch2 b/external/Catch2 index 92ad9ee..6e79e68 160000 --- a/external/Catch2 +++ b/external/Catch2 @@ -1 +1 @@ -Subproject commit 92ad9ee355945a4f2b494d1934faaa4bb412ae40 +Subproject commit 6e79e682b726f524310d55dec8ddac4e9c52fb5f diff --git a/include/wapopp/wapopp.hpp b/include/wapopp/wapopp.hpp index 5be4bb7..fe2de70 100644 --- a/include/wapopp/wapopp.hpp +++ b/include/wapopp/wapopp.hpp @@ -1,9 +1,11 @@ #pragma once +#include #include #include #include #include +#include namespace wapopp { @@ -18,14 +20,10 @@ struct SimpleContent { std::string content; std::string mime; }; -struct Kicker : public SimpleContent { -}; -struct Title : public SimpleContent { -}; -struct Byline : public SimpleContent { -}; -struct Text : public SimpleContent { -}; +struct Kicker : public SimpleContent {}; +struct Title : public SimpleContent {}; +struct Byline : public SimpleContent {}; +struct Text : public SimpleContent {}; struct Date { std::uint64_t timestamp; }; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e884ba1..5c9506d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,6 +2,7 @@ add_executable(test_detail test_detail.cpp) target_include_directories(test_detail PRIVATE "${PROJECT_SOURCE_DIR}/include/") target_link_libraries(test_detail nlohmann_json + Catch2Main Catch2 ) add_test(test_detail test_detail) @@ -10,6 +11,7 @@ add_executable(test_wapopp test_wapopp.cpp) target_link_libraries(test_wapopp wapopp nlohmann_json + Catch2Main Catch2 ) add_test(test_wapopp test_wapopp) diff --git a/test/test_detail.cpp b/test/test_detail.cpp index 126beea..a76fde0 100644 --- a/test/test_detail.cpp +++ b/test/test_detail.cpp @@ -1,5 +1,6 @@ -#define CATCH_CONFIG_MAIN -#include +#include + +#include #include "wapopp/detail.hpp" diff --git a/test/test_wapopp.cpp b/test/test_wapopp.cpp index 9183e84..502b90a 100644 --- a/test/test_wapopp.cpp +++ b/test/test_wapopp.cpp @@ -1,6 +1,6 @@ -#define CATCH_CONFIG_MAIN -#include +#include +#include #include #include "wapopp/wapopp.hpp"