Skip to content

Commit 4d30d1e

Browse files
committed
split cmake_test
1 parent 92be6d9 commit 4d30d1e

File tree

6 files changed

+110
-91
lines changed

6 files changed

+110
-91
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
cmake_minimum_required(VERSION 3.5...3.22)
2+
3+
project(cmake_install_test LANGUAGES CXX)
4+
5+
find_package(boost_redis REQUIRED)
6+
7+
add_executable(main main.cpp)
8+
target_link_libraries(main PRIVATE Boost::redis)
9+
10+
include(CTest)
11+
add_test(main main)
12+
13+
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
File renamed without changes.

test/cmake_subdir_test/CMakeLists.txt

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
cmake_minimum_required(VERSION 3.5...3.22)
2+
3+
project(cmake_subdir_test LANGUAGES CXX)
4+
5+
# Generated by boostdep --brief redis
6+
set(_DEPENDENCIES
7+
# Primary dependencies
8+
asio
9+
assert
10+
core
11+
mp11
12+
system
13+
throw_exception
14+
15+
# Secondary dependencies
16+
align
17+
array
18+
bind
19+
chrono
20+
config
21+
context
22+
coroutine
23+
date_time
24+
exception
25+
"function"
26+
regex
27+
smart_ptr
28+
type_traits
29+
utility
30+
static_assert
31+
variant2
32+
winapi
33+
integer
34+
move
35+
mpl
36+
predef
37+
ratio
38+
typeof
39+
pool
40+
algorithm
41+
io
42+
lexical_cast
43+
numeric/conversion
44+
range
45+
tokenizer
46+
tuple
47+
preprocessor
48+
concept_check
49+
container_hash
50+
iterator
51+
unordered
52+
describe
53+
container
54+
conversion
55+
detail
56+
optional
57+
rational
58+
intrusive
59+
function_types
60+
fusion
61+
functional
62+
)
63+
64+
# Build our dependencies, so the targets Boost::xxx are defined
65+
set(_BOOST_ROOT ../../../..)
66+
foreach(_DEPENDENCY IN LISTS _DEPENDENCIES)
67+
add_subdirectory(${_BOOST_ROOT}/libs/${_DEPENDENCY} boostorg/${_DEPENDENCY})
68+
endforeach()
69+
70+
# Build our project
71+
add_subdirectory(${_BOOST_ROOT}/libs/redis boostorg/redis)
72+
73+
add_executable(main main.cpp)
74+
target_link_libraries(main PRIVATE Boost::redis)
75+
76+
include(CTest)
77+
add_test(main main)
78+
79+
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

test/cmake_subdir_test/main.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* Copyright (c) 2018-2022 Marcelo Zimbres Silva ([email protected])
2+
*
3+
* Distributed under the Boost Software License, Version 1.0. (See
4+
* accompanying file LICENSE.txt)
5+
*/
6+
7+
8+
#include <boost/redis/connection.hpp>
9+
#include <boost/redis/src.hpp>
10+
11+
int main()
12+
{
13+
boost::redis::connection conn(boost::asio::system_executor{});
14+
return static_cast<int>(!conn.will_reconnect());
15+
}

test/cmake_test/CMakeLists.txt

Lines changed: 0 additions & 86 deletions
This file was deleted.

tools/ci.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,14 @@ def _run_cmake_add_subdirectory_tests(
214214
toolset: str,
215215
build_shared_libs: bool = False
216216
):
217-
test_folder = _boost_root.joinpath('libs', 'redis', 'test', 'cmake_test', '__build_cmake_subdir_test__')
217+
test_folder = _boost_root.joinpath('libs', 'redis', 'test', 'cmake_subdir_test', '__build')
218218
_mkdir_and_cd(test_folder)
219219
_run([
220220
'cmake',
221221
'-G',
222222
generator,
223223
'-DCMAKE_CXX_COMPILER={}'.format(_compiler_from_toolset(toolset)),
224224
'-DBUILD_TESTING=ON',
225-
'-DBOOST_CI_INSTALL_TEST=OFF',
226225
'-DCMAKE_BUILD_TYPE={}'.format(build_type),
227226
'-DBUILD_SHARED_LIBS={}'.format(_cmake_bool(build_shared_libs)),
228227
'-DCMAKE_CXX_STANDARD={}'.format(cxxstd),
@@ -240,14 +239,13 @@ def _run_cmake_find_package_tests(
240239
toolset: str,
241240
build_shared_libs: bool = False
242241
):
243-
_mkdir_and_cd(_boost_root.joinpath('libs', 'redis', 'test', 'cmake_test', '__build_cmake_install_test__'))
242+
_mkdir_and_cd(_boost_root.joinpath('libs', 'redis', 'test', 'cmake_install_test', '__build'))
244243
_run([
245244
'cmake',
246245
'-G',
247246
generator,
248247
'-DCMAKE_CXX_COMPILER={}'.format(_compiler_from_toolset(toolset)),
249248
'-DBUILD_TESTING=ON',
250-
'-DBOOST_CI_INSTALL_TEST=ON',
251249
'-DCMAKE_BUILD_TYPE={}'.format(build_type),
252250
'-DBUILD_SHARED_LIBS={}'.format(_cmake_bool(build_shared_libs)),
253251
'-DCMAKE_CXX_STANDARD={}'.format(cxxstd),
@@ -266,7 +264,7 @@ def _run_cmake_b2_find_package_tests(
266264
toolset: str,
267265
build_shared_libs: bool = False
268266
):
269-
_mkdir_and_cd(_boost_root.joinpath('libs', 'redis', 'test', 'cmake_b2_test', '__build_cmake_b2_test__'))
267+
_mkdir_and_cd(_boost_root.joinpath('libs', 'redis', 'test', 'cmake_b2_test', '__build'))
270268
_run([
271269
'cmake',
272270
'-G',

0 commit comments

Comments
 (0)