Skip to content

Commit

Permalink
Add missing includes and upgrade Catch2 (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
elshize authored Nov 1, 2023
1 parent 25ff64e commit 94b9b9f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
5 changes: 0 additions & 5 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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 "")
Expand Down
2 changes: 1 addition & 1 deletion external/Catch2
Submodule Catch2 updated 743 files
14 changes: 6 additions & 8 deletions include/wapopp/wapopp.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#pragma once

#include <cstdint>
#include <istream>
#include <ostream>
#include <string>
#include <variant>
#include <vector>

namespace wapopp {

Expand All @@ -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;
};
Expand Down
2 changes: 2 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
5 changes: 3 additions & 2 deletions test/test_detail.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <iostream>

#include <catch2/catch_test_macros.hpp>

#include "wapopp/detail.hpp"

Expand Down
4 changes: 2 additions & 2 deletions test/test_wapopp.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <sstream>

#include <catch2/catch_test_macros.hpp>
#include <nlohmann/json.hpp>

#include "wapopp/wapopp.hpp"
Expand Down

0 comments on commit 94b9b9f

Please sign in to comment.