-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests of the CMake package and pkgconfig
- Loading branch information
Showing
4 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
cmake_minimum_required(VERSION 3.10...3.26) | ||
|
||
project(CLI11-find-package-test) | ||
|
||
include(CTest) | ||
|
||
# Test the CLI11 CMake package config | ||
find_package(CLI11 2.0 REQUIRED) | ||
|
||
# Test the target | ||
add_executable(package-test ../../examples/positional_validation.cpp) | ||
target_link_libraries(package-test CLI11::CLI11) | ||
|
||
add_test(NAME package-test1 COMMAND package-test one) | ||
set_property(TEST package-test1 PROPERTY PASS_REGULAR_EXPRESSION "File 1 = one") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
cmake_minimum_required(VERSION 3.10...3.26) | ||
|
||
project(CLI11-package-config-test) | ||
|
||
include(CTest) | ||
|
||
# Test the CLI11 CMake package config | ||
find_package(CLI11 2.0 REQUIRED) | ||
|
||
find_package(PkgConfig) | ||
|
||
pkg_check_modules(CLI11 REQUIRED IMPORTED_TARGET cli11) | ||
|
||
# Test the target | ||
add_executable(package-config-test ../../examples/positional_validation.cpp) | ||
target_link_libraries(package-config-test PkgConfig::CLI11) | ||
|
||
add_test(NAME package-config-test1 COMMAND package-config-test one) | ||
set_property(TEST package-config-test1 PROPERTY PASS_REGULAR_EXPRESSION "File 1 = one") |