File tree Expand file tree Collapse file tree 2 files changed +31
-3
lines changed
tests/beman/inplace_vector Expand file tree Collapse file tree 2 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 11# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
22
3+ cmake_minimum_required (VERSION 3.25...3.31)
4+
5+ project (beman_inplace_vector_example LANGUAGES CXX)
6+
7+ if (PROJECT_IS_TOP_LEVEL)
8+ find_package (beman_inplace_vector 1.0.0 EXACT REQUIRED)
9+ enable_testing ()
10+ endif ()
11+
312set (ALL_EXAMPLES fibonacci)
413
5- message ("Examples to be built: ${ALL_EXAMPLES} " )
14+ message (STATUS "Examples to be built: ${ALL_EXAMPLES} " )
615
716foreach (example ${ALL_EXAMPLES} )
817 add_executable (beman.inplace_vector.examples.${example} )
@@ -12,6 +21,7 @@ foreach(example ${ALL_EXAMPLES})
1221 )
1322 target_link_libraries (
1423 beman.inplace_vector.examples.${example}
15- beman. inplace_vector
24+ beman:: inplace_vector
1625 )
26+ add_test (NAME ${example} COMMAND beman.inplace_vector.examples.${example} )
1727endforeach ()
Original file line number Diff line number Diff line change 66# Tests
77add_executable(beman.inplace_vector.test inplace_vector.test.cpp)
88
9- target_link_libraries(beman.inplace_vector.test PRIVATE beman. inplace_vector)
9+ target_link_libraries(beman.inplace_vector.test PRIVATE beman :: inplace_vector)
1010
1111add_test(NAME beman.inplace_vector.test COMMAND beman.inplace_vector.test)
12+
13+ # test if the targets are findable from the build directory
14+ # NOTE: For an INTERFACE library and multi config generators, we may always use
15+ # the -C Debug config type instead of $<CONFIG> to prevent problems! CK
16+ if(CMAKE_BUILD_TYPE STREQUAL Debug)
17+ add_test(
18+ NAME find-package-test
19+ COMMAND
20+ ${CMAKE_CTEST_COMMAND} --verbose --output-on-failure -C Debug
21+ --build-and-test "${PROJECT_SOURCE_DIR}/examples"
22+ "${CMAKE_CURRENT_BINARY_DIR}/find-package-test" --build-generator
23+ ${CMAKE_GENERATOR} --build-makeprogram ${CMAKE_MAKE_PROGRAM}
24+ --build-options "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
25+ "-DCMAKE_CXX_STANDARD =${CMAKE_CXX_STANDARD}"
26+ "-DCMAKE_BUILD_TYPE =Debug"
27+ "-DCMAKE_PREFIX_PATH =${CMAKE_PREFIX_PATH}"
28+ )
29+ endif()
You can’t perform that action at this time.
0 commit comments