Skip to content

Commit 19b7016

Browse files
committed
Merge branch 'develop' into feature/connect-fsm
2 parents 7a136b0 + 1812be8 commit 19b7016

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

example/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ endmacro()
1717

1818
macro(make_testable_example EXAMPLE_NAME STANDARD)
1919
make_example(${EXAMPLE_NAME} ${STANDARD})
20-
if (BOOST_REDIS_INTEGRATION_TESTS)
21-
add_test(${EXAMPLE_NAME} ${EXAMPLE_NAME})
22-
endif()
20+
add_test(${EXAMPLE_NAME} ${EXAMPLE_NAME} $ENV{BOOST_REDIS_TEST_SERVER} 6379)
2321
endmacro()
2422

2523
make_testable_example(cpp17_intro 17)
@@ -28,13 +26,13 @@ make_testable_example(cpp17_intro_sync 17)
2826
make_testable_example(cpp20_intro 20)
2927
make_testable_example(cpp20_containers 20)
3028
make_testable_example(cpp20_json 20)
31-
make_testable_example(cpp20_intro_tls 20)
3229
make_testable_example(cpp20_unix_sockets 20)
3330

3431
make_example(cpp20_subscriber 20)
3532
make_example(cpp20_streams 20)
3633
make_example(cpp20_echo_server 20)
3734
make_example(cpp20_resolve_with_sentinel 20)
35+
make_example(cpp20_intro_tls 20)
3836

3937
# We test the protobuf example only on gcc.
4038
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")

example/cpp17_spdlog.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,8 @@ static void do_log(redis::logger::level level, std::string_view msg)
4747
spdlog::log(to_spdlog_level(level), "(Boost.Redis) {}", msg);
4848
}
4949

50-
auto main(int argc, char* argv[]) -> int
50+
auto main(int argc, char** argv) -> int
5151
{
52-
if (argc != 3) {
53-
std::cerr << "Usage: " << argv[0] << " <server-host> <server-port>\n";
54-
exit(1);
55-
}
56-
5752
try {
5853
// Create an execution context, required to create any I/O objects
5954
asio::io_context ioc;
@@ -67,10 +62,12 @@ auto main(int argc, char* argv[]) -> int
6762
redis::logger{redis::logger::level::info, do_log}
6863
};
6964

70-
// Configuration to connect to the server
65+
// Configuration to connect to the server. Adjust as required
7166
redis::config cfg;
72-
cfg.addr.host = argv[1];
73-
cfg.addr.port = argv[2];
67+
if (argc == 3) {
68+
cfg.addr.host = argv[1];
69+
cfg.addr.port = argv[2];
70+
}
7471

7572
// Run the connection with the specified configuration.
7673
// This will establish the connection and keep it healthy

0 commit comments

Comments
 (0)