Skip to content

Commit 711d9af

Browse files
committed
Added missing import and disable network logging tests
1 parent 743600a commit 711d9af

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

include/session/logging.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include <functional>
4+
#include <string>
45
#include <string_view>
56

67
#include "log_level.h"

tests/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ target_link_libraries(testAll PRIVATE
5454

5555
if (ENABLE_ONIONREQ)
5656
target_link_libraries(testAll PRIVATE libsession::onionreq)
57+
else()
58+
target_compile_definitions(testAll PRIVATE DISABLE_ONIONREQ)
5759
endif()
5860

5961
if(NOT TARGET check)

tests/test_logging.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
#include <catch2/catch_test_macros.hpp>
44
#include <oxen/log.hpp>
55
#include <oxen/log/format.hpp>
6-
#include <oxen/quic/network.hpp>
76
#include <regex>
87
#include <session/logging.hpp>
98

9+
#ifndef DISABLE_ONIONREQ
10+
#include <oxen/quic/network.hpp>
11+
#endif
12+
1013
using namespace session;
1114
using namespace oxen;
1215
using namespace oxen::log::literals;
@@ -94,6 +97,7 @@ TEST_CASE("Logging callbacks", "[logging]") {
9497
#endif
9598
}
9699

100+
#ifndef DISABLE_ONIONREQ
97101
TEST_CASE("Logging callbacks with quic::Network", "[logging][network]") {
98102
oxen::log::clear_sinks();
99103
simple_logs.clear();
@@ -114,3 +118,4 @@ TEST_CASE("Logging callbacks with quic::Network", "[logging][network]") {
114118
#endif
115119
CHECK(simple_logs.back().find("Loop shutdown complete") != std::string::npos);
116120
}
121+
#endif

0 commit comments

Comments
 (0)