summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMakePresets/Debug-stderr.txt3
-rw-r--r--Tests/RunCMake/find_package/FromPATHEnv-stderr.txt100
-rw-r--r--Tests/RunCMake/find_package/FromPATHEnv.cmake5
-rw-r--r--Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt101
-rw-r--r--Tests/RunCMake/find_package/FromPATHEnvDebugPkg.cmake5
-rw-r--r--Tests/RunCMake/find_package/ModuleModeDebugPkg-stderr.txt128
-rw-r--r--Tests/RunCMake/find_package/ModuleModeDebugPkg.cmake2
-rw-r--r--Tests/RunCMake/find_package/ModuleModeDebugPkg/FindBar.cmake2
-rw-r--r--Tests/RunCMake/find_package/ModuleModeDebugPkg/FindFoo.cmake6
-rw-r--r--Tests/RunCMake/find_package/RunCMakeTest.cmake6
10 files changed, 313 insertions, 45 deletions
diff --git a/Tests/RunCMake/CMakePresets/Debug-stderr.txt b/Tests/RunCMake/CMakePresets/Debug-stderr.txt
index 7fdb8b3..d30dc58 100644
--- a/Tests/RunCMake/CMakePresets/Debug-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/Debug-stderr.txt
@@ -1 +1,2 @@
- find_package considered the following locations for the Config module:
+ find_package considered the following locations for
+ ThisPackageHopefullyDoesNotExist's Config module:
diff --git a/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt b/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt
index b35f05e..691d7f0 100644
--- a/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt
+++ b/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt
@@ -1,20 +1,80 @@
-CMake Debug Log at FromPATHEnv.cmake:5 \(find_package\):
- find_package considered the following paths for Resolved.cmake.*
-.*/Modules/FindResolved.cmake.*
- The file was not found.*
- <PackageName>_ROOT CMake variable.*
- CMAKE_PREFIX_PATH variable.*
- CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables.*
- Env variable Resolved_DIR.*
- CMAKE_PREFIX_PATH env variable.*
- Paths specified by the find_package HINTS option.*
- Standard system environment variables.*
-.*Tests/RunCMake/find_package/PackageRoot.*
- CMake User Package Registry.*
- CMake variables defined in the Platform file.*
- CMake System Package Registry.*
- Paths specified by the find_package PATHS option.*
- find_package considered the following locations for the Config module:.*
-.*Tests/RunCMake/find_package/PackageRoot/ResolvedConfig\.cmake.*
- The file was found at.*
-.*Tests/RunCMake/find_package/PackageRoot/ResolvedConfig\.cmake
+^CMake Debug Log at FromPATHEnv.cmake:[0-9]+ \(find_package\):
+ find_package considered the following paths for FindResolved.cmake:
+
+ [^
+]*/Modules/FindResolved.cmake
+
+ The file was not found.
+
+ <PackageName>_ROOT CMake variable \[CMAKE_FIND_USE_PACKAGE_ROOT_PATH\].
+
+ none
+
+ CMAKE_PREFIX_PATH variable \[CMAKE_FIND_USE_CMAKE_PATH\].
+
+ none
+
+ CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables
+ \[CMAKE_FIND_USE_CMAKE_PATH\].
+
+ none
+
+ Env variable Resolved_DIR \[CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\].
+
+ none
+
+ CMAKE_PREFIX_PATH env variable \[CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\].
+(
+ [^
+]+)+
+
+ CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH env variables
+ \[CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\].
+(
+ [^
+]+)+
+
+ Paths specified by the find_package HINTS option.
+
+ none
+
+ Standard system environment variables
+ \[CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH\].
+
+ [^
+]*/Tests/RunCMake/find_package/PackageRoot
+
+ CMake User Package Registry \[CMAKE_FIND_USE_PACKAGE_REGISTRY\].
+(
+ [^
+]+)+
+
+ CMake variables defined in the Platform file
+ \[CMAKE_FIND_USE_CMAKE_SYSTEM_PATH\].
+(
+ [^
+]+)+
+
+ CMake System Package Registry
+ \[CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY\].
+(
+ [^
+]+)+
+
+ Paths specified by the find_package PATHS option.
+
+ none
+
+ find_package considered the following locations for Resolved's Config
+ module:
+
+ [^
+]*/Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake
+
+ The file was found at
+
+ [^
+]*/Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/find_package/FromPATHEnv.cmake b/Tests/RunCMake/find_package/FromPATHEnv.cmake
index ceb79b6..9158d4b 100644
--- a/Tests/RunCMake/find_package/FromPATHEnv.cmake
+++ b/Tests/RunCMake/find_package/FromPATHEnv.cmake
@@ -1,4 +1,7 @@
set(ENV_PATH "$ENV{PATH}")
+set(ENV_CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}")
+
+set(ENV{CMAKE_PREFIX_PATH} "")
set(CMAKE_FIND_DEBUG_MODE ON)
set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot")
@@ -30,4 +33,6 @@ foreach(path "/does_not_exist" "/PackageRoot" "")
find_package(Resolved NO_SYSTEM_ENVIRONMENT_PATH QUIET)
message(STATUS "Resolved_FOUND='${Resolved_FOUND}'")
endforeach()
+
+set(ENV{CMAKE_PREFIX_PATH} "${ENV_CMAKE_PREFIX_PATH}")
set(ENV{PATH} "${ENV_PATH}")
diff --git a/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt b/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt
index 94ed178..ef5ec33 100644
--- a/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt
+++ b/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt
@@ -1,21 +1,80 @@
-CMake Debug Log at FromPATHEnvDebugPkg.cmake:4 \(find_package\):
- find_package considered the following paths for Resolved.cmake.*
-.*/Modules/FindResolved.cmake.*
- The file was not found.*
- <PackageName>_ROOT CMake variable.*
- CMAKE_PREFIX_PATH variable.*
- CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables.*
- Env variable Resolved_DIR.*
- CMAKE_PREFIX_PATH env variable.*
- CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH env variables.*
- Paths specified by the find_package HINTS option.*
- Standard system environment variables.*
-.*Tests/RunCMake/find_package/PackageRoot.*
- CMake User Package Registry.*
- CMake variables defined in the Platform file.*
- CMake System Package Registry.*
- Paths specified by the find_package PATHS option.*
- find_package considered the following locations for the Config module:.*
-.*Tests/RunCMake/find_package/PackageRoot/ResolvedConfig\.cmake.*
- The file was found at.*
-.*Tests/RunCMake/find_package/PackageRoot/ResolvedConfig\.cmake
+^CMake Debug Log at FromPATHEnvDebugPkg.cmake:[0-9]+ \(find_package\):
+ find_package considered the following paths for FindResolved.cmake:
+
+ [^
+]*/Modules/FindResolved.cmake
+
+ The file was not found.
+
+ <PackageName>_ROOT CMake variable \[CMAKE_FIND_USE_PACKAGE_ROOT_PATH\].
+
+ none
+
+ CMAKE_PREFIX_PATH variable \[CMAKE_FIND_USE_CMAKE_PATH\].
+
+ none
+
+ CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables
+ \[CMAKE_FIND_USE_CMAKE_PATH\].
+
+ none
+
+ Env variable Resolved_DIR \[CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\].
+
+ none
+
+ CMAKE_PREFIX_PATH env variable \[CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\].
+(
+ [^
+]+)+
+
+ CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH env variables
+ \[CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\].
+(
+ [^
+]+)+
+
+ Paths specified by the find_package HINTS option.
+
+ none
+
+ Standard system environment variables
+ \[CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH\].
+
+ [^
+]*/Tests/RunCMake/find_package/PackageRoot
+
+ CMake User Package Registry \[CMAKE_FIND_USE_PACKAGE_REGISTRY\].
+(
+ [^
+]+)+
+
+ CMake variables defined in the Platform file
+ \[CMAKE_FIND_USE_CMAKE_SYSTEM_PATH\].
+(
+ [^
+]+)+
+
+ CMake System Package Registry
+ \[CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY\].
+(
+ [^
+]+)+
+
+ Paths specified by the find_package PATHS option.
+
+ none
+
+ find_package considered the following locations for Resolved's Config
+ module:
+
+ [^
+]*/Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake
+
+ The file was found at
+
+ [^
+]*/Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/find_package/FromPATHEnvDebugPkg.cmake b/Tests/RunCMake/find_package/FromPATHEnvDebugPkg.cmake
index 0ed8a12..72b03e6 100644
--- a/Tests/RunCMake/find_package/FromPATHEnvDebugPkg.cmake
+++ b/Tests/RunCMake/find_package/FromPATHEnvDebugPkg.cmake
@@ -1,4 +1,7 @@
set(ENV_PATH "$ENV{PATH}")
+set(ENV_CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}")
+
+set(ENV{CMAKE_PREFIX_PATH} "")
set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot")
find_package(Resolved QUIET)
@@ -28,4 +31,6 @@ foreach(path "/does_not_exist" "/PackageRoot" "")
find_package(ResolvedC NO_SYSTEM_ENVIRONMENT_PATH QUIET)
message(STATUS "Resolved_FOUND='${ResolvedC_FOUND}'")
endforeach()
+
+set(ENV{CMAKE_PREFIX_PATH} "${ENV_CMAKE_PREFIX_PATH}")
set(ENV{PATH} "${ENV_PATH}")
diff --git a/Tests/RunCMake/find_package/ModuleModeDebugPkg-stderr.txt b/Tests/RunCMake/find_package/ModuleModeDebugPkg-stderr.txt
new file mode 100644
index 0000000..e4fd7c5
--- /dev/null
+++ b/Tests/RunCMake/find_package/ModuleModeDebugPkg-stderr.txt
@@ -0,0 +1,128 @@
+^CMake Debug Log at ModuleModeDebugPkg/FindFoo.cmake:[0-9]+ \(find_program\):
+ find_program called with the following settings:
+
+ VAR: FOO_EXE
+ NAMES: "ModuleModeDebugPkgFooExe"
+ Documentation: Path to a program.
+ Framework
+ Only Search Frameworks: 0
+ Search Frameworks Last: 0
+ Search Frameworks First: [01]
+ AppBundle
+ Only Search AppBundle: 0
+ Search AppBundle Last: 0
+ Search AppBundle First: [01]
+ NO_DEFAULT_PATH Enabled
+
+ find_program considered the following locations:
+
+ The item was not found.
+
+Call Stack \(most recent call first\):
+ ModuleModeDebugPkg.cmake:[0-9]+ \(find_package\)
+ CMakeLists.txt:[0-9]+ \(include\)
++
+CMake Debug Log at ModuleModeDebugPkg/FindFoo.cmake:[0-9]+ \(find_library\):
+ find_library called with the following settings:
+
+ VAR: FOO_LIB
+ NAMES: "ModuleModeDebugPkgFooLib"
+ Documentation: Path to a library.
+ Framework
+ Only Search Frameworks: 0
+ Search Frameworks Last: 0
+ Search Frameworks First: [01]
+ AppBundle
+ Only Search AppBundle: 0
+ Search AppBundle Last: 0
+ Search AppBundle First: [01]
+ NO_DEFAULT_PATH Enabled
+
+ find_library considered the following locations:
+
+ The item was not found.
+
+Call Stack \(most recent call first\):
+ ModuleModeDebugPkg.cmake:[0-9]+ \(find_package\)
+ CMakeLists.txt:[0-9]+ \(include\)
++
+CMake Debug Log at ModuleModeDebugPkg/FindFoo.cmake:[0-9]+ \(find_path\):
+ find_path called with the following settings:
+
+ VAR: FOO_PATH
+ NAMES: "ModuleModeDebugPkgFoo.h"
+ Documentation: Path to a file.
+ Framework
+ Only Search Frameworks: 0
+ Search Frameworks Last: 0
+ Search Frameworks First: [01]
+ AppBundle
+ Only Search AppBundle: 0
+ Search AppBundle Last: 0
+ Search AppBundle First: [01]
+ NO_DEFAULT_PATH Enabled
+
+ find_path considered the following locations:
+
+ The item was not found.
+
+Call Stack \(most recent call first\):
+ ModuleModeDebugPkg.cmake:[0-9]+ \(find_package\)
+ CMakeLists.txt:[0-9]+ \(include\)
++
+CMake Debug Log at ModuleModeDebugPkg/FindFoo.cmake:[0-9]+ \(find_file\):
+ find_file called with the following settings:
+
+ VAR: FOO_FILE
+ NAMES: "ModuleModeDebugPkgFoo.h"
+ Documentation: Path to a file.
+ Framework
+ Only Search Frameworks: 0
+ Search Frameworks Last: 0
+ Search Frameworks First: [01]
+ AppBundle
+ Only Search AppBundle: 0
+ Search AppBundle Last: 0
+ Search AppBundle First: [01]
+ NO_DEFAULT_PATH Enabled
+
+ find_file considered the following locations:
+
+ The item was not found.
+
+Call Stack \(most recent call first\):
+ ModuleModeDebugPkg.cmake:[0-9]+ \(find_package\)
+ CMakeLists.txt:[0-9]+ \(include\)
++
+FindBar processed here.
++
+CMake Debug Log at ModuleModeDebugPkg/FindFoo.cmake:[0-9]+ \(find_package\):
+ Paths specified by the find_package HINTS option.
+
+ none
+
+ Paths specified by the find_package PATHS option.
+
+ none
+
+ find_package considered the following locations for Zot's Config module:
+
+ The file was not found.
+
+Call Stack \(most recent call first\):
+ ModuleModeDebugPkg.cmake:[0-9]+ \(find_package\)
+ CMakeLists.txt:[0-9]+ \(include\)
++
+CMake Debug Log at ModuleModeDebugPkg.cmake:[0-9]+ \(find_package\):
+ find_package considered the following paths for FindFoo.cmake:
+
+ [^
+]*/Modules/FindFoo.cmake
+
+ The file was found at
+
+ [^
+]*/Tests/RunCMake/find_package/ModuleModeDebugPkg/FindFoo.cmake
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/find_package/ModuleModeDebugPkg.cmake b/Tests/RunCMake/find_package/ModuleModeDebugPkg.cmake
new file mode 100644
index 0000000..d9cac09
--- /dev/null
+++ b/Tests/RunCMake/find_package/ModuleModeDebugPkg.cmake
@@ -0,0 +1,2 @@
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/ModuleModeDebugPkg)
+find_package(Foo)
diff --git a/Tests/RunCMake/find_package/ModuleModeDebugPkg/FindBar.cmake b/Tests/RunCMake/find_package/ModuleModeDebugPkg/FindBar.cmake
new file mode 100644
index 0000000..0711118
--- /dev/null
+++ b/Tests/RunCMake/find_package/ModuleModeDebugPkg/FindBar.cmake
@@ -0,0 +1,2 @@
+message("FindBar processed here.\n")
+find_program(BAR_EXE NAMES ModuleModeDebugPkgBarExe NO_DEFAULT_PATH)
diff --git a/Tests/RunCMake/find_package/ModuleModeDebugPkg/FindFoo.cmake b/Tests/RunCMake/find_package/ModuleModeDebugPkg/FindFoo.cmake
new file mode 100644
index 0000000..23a15b4
--- /dev/null
+++ b/Tests/RunCMake/find_package/ModuleModeDebugPkg/FindFoo.cmake
@@ -0,0 +1,6 @@
+find_program(FOO_EXE NAMES ModuleModeDebugPkgFooExe NO_DEFAULT_PATH)
+find_library(FOO_LIB NAMES ModuleModeDebugPkgFooLib NO_DEFAULT_PATH)
+find_path(FOO_PATH NAMES ModuleModeDebugPkgFoo.h NO_DEFAULT_PATH)
+find_file(FOO_FILE NAMES ModuleModeDebugPkgFoo.h NO_DEFAULT_PATH)
+find_package(Bar) # not included
+find_package(Zot NO_MODULE NO_DEFAULT_PATH) # is included
diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake
index 037502f..5f4c6cb 100644
--- a/Tests/RunCMake/find_package/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake
@@ -4,6 +4,7 @@ run_cmake(CMP0074-WARN)
run_cmake(CMP0074-OLD)
run_cmake(ComponentRequiredAndOptional)
run_cmake(FromPATHEnv)
+run_cmake_with_options(FromPATHEnvDebugPkg --debug-find-pkg=Resolved)
run_cmake(FromPrefixPath)
run_cmake(MissingNormal)
run_cmake(MissingNormalForceRequired)
@@ -15,10 +16,12 @@ run_cmake(MissingModule)
run_cmake(MissingModuleRequired)
run_cmake(MissingConfig)
run_cmake(MissingConfigDebug)
+run_cmake_with_options(MissingConfigDebugPkg --debug-find-pkg=NotHere)
run_cmake(MissingConfigOneName)
run_cmake(MissingConfigRequired)
run_cmake(MissingConfigVersion)
run_cmake(MixedModeOptions)
+run_cmake_with_options(ModuleModeDebugPkg --debug-find-pkg=Foo,Zot)
run_cmake(PackageRoot)
run_cmake(PackageRootNestedConfig)
run_cmake(PackageRootNestedModule)
@@ -51,6 +54,3 @@ if(UNIX
)
run_cmake(SetFoundResolved)
endif()
-
-run_cmake_with_options(MissingConfigDebugPkg --debug-find-pkg=NotHere)
-run_cmake_with_options(FromPATHEnvDebugPkg --debug-find-pkg=Resolved)