diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-03-11 13:36:58 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-03-11 13:48:35 (GMT) |
commit | f74a8405b6caa8ac253ce0357642a244ab192410 (patch) | |
tree | 001e00bc762091dba5bd2d1f9d29f570000798f2 /Tests/RunCMake/find_dependency | |
parent | b801205dad50246b82ce2572a25581ed6e27345d (diff) | |
download | CMake-f74a8405b6caa8ac253ce0357642a244ab192410.zip CMake-f74a8405b6caa8ac253ce0357642a244ab192410.tar.gz CMake-f74a8405b6caa8ac253ce0357642a244ab192410.tar.bz2 |
Test error cases in find_dependency.
Diffstat (limited to 'Tests/RunCMake/find_dependency')
13 files changed, 53 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_dependency/CMakeLists.txt b/Tests/RunCMake/find_dependency/CMakeLists.txt new file mode 100644 index 0000000..04d09f2 --- /dev/null +++ b/Tests/RunCMake/find_dependency/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/find_dependency/EXACT-no-version-result.txt b/Tests/RunCMake/find_dependency/EXACT-no-version-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_dependency/EXACT-no-version-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_dependency/EXACT-no-version-stderr.txt b/Tests/RunCMake/find_dependency/EXACT-no-version-stderr.txt new file mode 100644 index 0000000..6f4fc04 --- /dev/null +++ b/Tests/RunCMake/find_dependency/EXACT-no-version-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:35 \(message\): + Invalid arguments to find_dependency. EXACT may only be specified if a + VERSION is specified +Call Stack \(most recent call first\): + EXACT-no-version.cmake:4 \(find_dependency\) + CMakeLists.txt:4 \(include\) diff --git a/Tests/RunCMake/find_dependency/EXACT-no-version.cmake b/Tests/RunCMake/find_dependency/EXACT-no-version.cmake new file mode 100644 index 0000000..b05665b7 --- /dev/null +++ b/Tests/RunCMake/find_dependency/EXACT-no-version.cmake @@ -0,0 +1,4 @@ + +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 EXACT) diff --git a/Tests/RunCMake/find_dependency/Pack1/Pack1Config.cmake b/Tests/RunCMake/find_dependency/Pack1/Pack1Config.cmake new file mode 100644 index 0000000..7d55ef6 --- /dev/null +++ b/Tests/RunCMake/find_dependency/Pack1/Pack1Config.cmake @@ -0,0 +1,2 @@ + +add_library(Pack1::Lib INTERFACE IMPORTED) diff --git a/Tests/RunCMake/find_dependency/Pack1/Pack1ConfigVersion.cmake b/Tests/RunCMake/find_dependency/Pack1/Pack1ConfigVersion.cmake new file mode 100644 index 0000000..dfb7b6c --- /dev/null +++ b/Tests/RunCMake/find_dependency/Pack1/Pack1ConfigVersion.cmake @@ -0,0 +1,11 @@ + +set(PACKAGE_VERSION "1.3") + +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() diff --git a/Tests/RunCMake/find_dependency/RunCMakeTest.cmake b/Tests/RunCMake/find_dependency/RunCMakeTest.cmake new file mode 100644 index 0000000..b85104a --- /dev/null +++ b/Tests/RunCMake/find_dependency/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(EXACT-no-version) +run_cmake(invalid-arg-3) +run_cmake(extra-args) diff --git a/Tests/RunCMake/find_dependency/extra-args-result.txt b/Tests/RunCMake/find_dependency/extra-args-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_dependency/extra-args-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_dependency/extra-args-stderr.txt b/Tests/RunCMake/find_dependency/extra-args-stderr.txt new file mode 100644 index 0000000..1b52380 --- /dev/null +++ b/Tests/RunCMake/find_dependency/extra-args-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:47 \(message\): + Invalid arguments to find_dependency +Call Stack \(most recent call first\): + extra-args.cmake:4 \(find_dependency\) + CMakeLists.txt:4 \(include\) diff --git a/Tests/RunCMake/find_dependency/extra-args.cmake b/Tests/RunCMake/find_dependency/extra-args.cmake new file mode 100644 index 0000000..209645a --- /dev/null +++ b/Tests/RunCMake/find_dependency/extra-args.cmake @@ -0,0 +1,4 @@ + +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 1.2 EXACT PATHS "${CMAKE_BINARY_DIR}") diff --git a/Tests/RunCMake/find_dependency/invalid-arg-3-result.txt b/Tests/RunCMake/find_dependency/invalid-arg-3-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_dependency/invalid-arg-3-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_dependency/invalid-arg-3-stderr.txt b/Tests/RunCMake/find_dependency/invalid-arg-3-stderr.txt new file mode 100644 index 0000000..c36148f --- /dev/null +++ b/Tests/RunCMake/find_dependency/invalid-arg-3-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:42 \(message\): + Invalid arguments to find_dependency +Call Stack \(most recent call first\): + invalid-arg-3.cmake:4 \(find_dependency\) + CMakeLists.txt:4 \(include\) diff --git a/Tests/RunCMake/find_dependency/invalid-arg-3.cmake b/Tests/RunCMake/find_dependency/invalid-arg-3.cmake new file mode 100644 index 0000000..40ede07 --- /dev/null +++ b/Tests/RunCMake/find_dependency/invalid-arg-3.cmake @@ -0,0 +1,4 @@ + +include(CMakeFindDependencyMacro) + +find_dependency(Pack1 1.2 EXACTYPO) |