From ee062ce4d0f3b4e2e5241fc520499fb332d4d07d Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 26 May 2025 19:41:47 +0200 Subject: [PATCH] cmFindCommon: test implicit configure log event reporting --- .../ConfigureLogTransitions-config.txt | 171 +++++++++++++++++ .../find_file/ConfigureLogTransitions.cmake | 22 +++ Tests/RunCMake/find_file/RunCMakeTest.cmake | 1 + .../ConfigureLogTransitions-config.txt | 167 +++++++++++++++++ .../ConfigureLogTransitions.cmake | 22 +++ .../RunCMake/find_library/RunCMakeTest.cmake | 1 + .../ConfigureLogTransitions-config.txt | 169 +++++++++++++++++ .../find_path/ConfigureLogTransitions.cmake | 22 +++ Tests/RunCMake/find_path/RunCMakeTest.cmake | 1 + .../ConfigureLogTransitions-config.txt | 177 ++++++++++++++++++ .../ConfigureLogTransitions.cmake | 22 +++ .../RunCMake/find_program/RunCMakeTest.cmake | 1 + 12 files changed, 776 insertions(+) create mode 100644 Tests/RunCMake/find_file/ConfigureLogTransitions-config.txt create mode 100644 Tests/RunCMake/find_file/ConfigureLogTransitions.cmake create mode 100644 Tests/RunCMake/find_library/ConfigureLogTransitions-config.txt create mode 100644 Tests/RunCMake/find_library/ConfigureLogTransitions.cmake create mode 100644 Tests/RunCMake/find_path/ConfigureLogTransitions-config.txt create mode 100644 Tests/RunCMake/find_path/ConfigureLogTransitions.cmake create mode 100644 Tests/RunCMake/find_program/ConfigureLogTransitions-config.txt create mode 100644 Tests/RunCMake/find_program/ConfigureLogTransitions.cmake diff --git a/Tests/RunCMake/find_file/ConfigureLogTransitions-config.txt b/Tests/RunCMake/find_file/ConfigureLogTransitions-config.txt new file mode 100644 index 0000000000..b1eaed1652 --- /dev/null +++ b/Tests/RunCMake/find_file/ConfigureLogTransitions-config.txt @@ -0,0 +1,171 @@ +^ +--- +events: + - +events:( + - + kind: "find-v1"( + [^ +]*)+| ++ - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)* + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(message\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotDefined -> NotFound + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_file\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "file" + variable: "NOEXIST_FILE" + description: "Path to a file." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "NoExist.h" + candidate_directories: + - ".*/Tests/RunCMake/find_file/include/" + - ".*/Tests/RunCMake/find_file/"( + - "[^"]+")+ + searched_directories: + - ".*/Tests/RunCMake/find_file/include/NoExist.h" + - ".*/Tests/RunCMake/find_file/NoExist.h"( + - "[^"]+")+ + found: false + search_context:( + [^ +]*)+ + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_file\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotFound -> NotFound + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_file\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotDefined -> Found + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_file\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "file" + variable: "PREFIX_IN_PATH" + description: "Path to a file." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "PrefixInPATH.h" + candidate_directories: + - ".*/Tests/RunCMake/find_file/include/" + - ".*/Tests/RunCMake/find_file/"( + - "[^"]+")+ + found: ".*/Tests/RunCMake/find_file/include/PrefixInPATH.h" + search_context:( + [^ +]*)+ + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_file\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + Found -> Found + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_file\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + Found -> NotFound + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_file\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "file" + variable: "PREFIX_IN_PATH" + description: "Path to a file." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "PrefixInPATH.h" + candidate_directories: + - ".*/Tests/RunCMake/find_file/include/" + - ".*/Tests/RunCMake/find_file/"( + - "[^"]+")+ + searched_directories: + - ".*/Tests/RunCMake/find_file/include/NoExist.h" + - ".*/Tests/RunCMake/find_file/NoExist.h"( + - "[^"]+")+ + found: false + search_context:( + [^ +]*)+ + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_file\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotFound -> Found + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_file\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "file" + variable: "PREFIX_IN_PATH" + description: "Path to a file." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "PrefixInPATH.h" + candidate_directories: + - ".*/Tests/RunCMake/find_file/include/" + - ".*/Tests/RunCMake/find_file/"( + - "[^"]+")+ + found: ".*/Tests/RunCMake/find_file/include/PrefixInPATH.h" + search_context:( + [^ +]*)+ +... diff --git a/Tests/RunCMake/find_file/ConfigureLogTransitions.cmake b/Tests/RunCMake/find_file/ConfigureLogTransitions.cmake new file mode 100644 index 0000000000..ab0600d571 --- /dev/null +++ b/Tests/RunCMake/find_file/ConfigureLogTransitions.cmake @@ -0,0 +1,22 @@ +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") + +message(CONFIGURE_LOG "NotDefined -> NotFound") +find_file(NOEXIST_FILE NAMES NoExist.h) + +message(CONFIGURE_LOG "NotFound -> NotFound") +find_file(NOEXIST_FILE NAMES NoExist.h) + +message(CONFIGURE_LOG "NotDefined -> Found") +find_file(PREFIX_IN_PATH NAMES PrefixInPATH.h) + +message(CONFIGURE_LOG "Found -> Found") +find_file(PREFIX_IN_PATH NAMES PrefixInPATH.h) + +message(CONFIGURE_LOG "Found -> NotFound") +unset(PREFIX_IN_PATH CACHE) +unset(CMAKE_PREFIX_PATH) +find_file(PREFIX_IN_PATH NAMES PrefixInPATH.h) + +message(CONFIGURE_LOG "NotFound -> Found") +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") +find_file(PREFIX_IN_PATH NAMES PrefixInPATH.h) diff --git a/Tests/RunCMake/find_file/RunCMakeTest.cmake b/Tests/RunCMake/find_file/RunCMakeTest.cmake index 54840d1384..85986240dc 100644 --- a/Tests/RunCMake/find_file/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_file/RunCMakeTest.cmake @@ -1,5 +1,6 @@ include(RunCMake) +run_cmake(ConfigureLogTransitions) run_cmake(FromPATHEnv) run_cmake(FromPrefixPath) run_cmake(PrefixInPATH) diff --git a/Tests/RunCMake/find_library/ConfigureLogTransitions-config.txt b/Tests/RunCMake/find_library/ConfigureLogTransitions-config.txt new file mode 100644 index 0000000000..c1ad17ae07 --- /dev/null +++ b/Tests/RunCMake/find_library/ConfigureLogTransitions-config.txt @@ -0,0 +1,167 @@ +^ +--- +events: + - +events:( + - + kind: "find-v1"( + [^ +]*)+| ++ - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)* + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(message\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotDefined -> NotFound + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_library\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "library" + variable: "NOEXIST_FILE" + description: "Path to a library." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "NoExist" + candidate_directories: + - ".*/Tests/RunCMake/find_library/lib/" + - ".*/Tests/RunCMake/find_library/"( + - "[^"]+")+ + searched_directories: + - ".*/Tests/RunCMake/find_library/lib/" + - ".*/Tests/RunCMake/find_library/"( + - "[^"]+")+ + found: false + search_context:( + [^ +]*)+ + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_library\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotFound -> NotFound + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_library\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotDefined -> Found + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_library\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "library" + variable: "PREFIX_IN_PATH" + description: "Path to a library." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "PrefixInPATH" + candidate_directories: + - ".*/Tests/RunCMake/find_library/lib/" + - ".*/Tests/RunCMake/find_library/"( + - "[^"]+")+ + found: ".*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a" + search_context:( + [^ +]*)+ + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_library\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + Found -> Found + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_library\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + Found -> NotFound + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_library\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "library" + variable: "PREFIX_IN_PATH" + description: "Path to a library." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "PrefixInPATH" + candidate_directories:( + - "[^"]+")+ + searched_directories:( + - "[^"]+")+ + found: false + search_context:( + [^ +]*)+ + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_library\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotFound -> Found + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_library\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "library" + variable: "PREFIX_IN_PATH" + description: "Path to a library." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "PrefixInPATH" + candidate_directories: + - ".*/Tests/RunCMake/find_library/lib/" + - ".*/Tests/RunCMake/find_library/"( + - "[^"]+")+ + found: ".*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a" + search_context:( + [^ +]*)+ +... diff --git a/Tests/RunCMake/find_library/ConfigureLogTransitions.cmake b/Tests/RunCMake/find_library/ConfigureLogTransitions.cmake new file mode 100644 index 0000000000..fb0b34f505 --- /dev/null +++ b/Tests/RunCMake/find_library/ConfigureLogTransitions.cmake @@ -0,0 +1,22 @@ +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") + +message(CONFIGURE_LOG "NotDefined -> NotFound") +find_library(NOEXIST_FILE NAMES NoExist) + +message(CONFIGURE_LOG "NotFound -> NotFound") +find_library(NOEXIST_FILE NAMES NoExist) + +message(CONFIGURE_LOG "NotDefined -> Found") +find_library(PREFIX_IN_PATH NAMES PrefixInPATH) + +message(CONFIGURE_LOG "Found -> Found") +find_library(PREFIX_IN_PATH NAMES PrefixInPATH) + +message(CONFIGURE_LOG "Found -> NotFound") +unset(PREFIX_IN_PATH CACHE) +unset(CMAKE_PREFIX_PATH) +find_library(PREFIX_IN_PATH NAMES PrefixInPATH) + +message(CONFIGURE_LOG "NotFound -> Found") +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") +find_library(PREFIX_IN_PATH NAMES PrefixInPATH) diff --git a/Tests/RunCMake/find_library/RunCMakeTest.cmake b/Tests/RunCMake/find_library/RunCMakeTest.cmake index 3f2b10beef..fa35791d8d 100644 --- a/Tests/RunCMake/find_library/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_library/RunCMakeTest.cmake @@ -1,5 +1,6 @@ include(RunCMake) +run_cmake(ConfigureLogTransitions) run_cmake(Created) run_cmake(FromPrefixPath) run_cmake(FromPATHEnv) diff --git a/Tests/RunCMake/find_path/ConfigureLogTransitions-config.txt b/Tests/RunCMake/find_path/ConfigureLogTransitions-config.txt new file mode 100644 index 0000000000..0879ae2122 --- /dev/null +++ b/Tests/RunCMake/find_path/ConfigureLogTransitions-config.txt @@ -0,0 +1,169 @@ +^ +--- +events:( + - + kind: "find-v1"( + [^ +]*)+| ++ - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)* + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(message\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotDefined -> NotFound + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_path\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "path" + variable: "NOEXIST_FILE" + description: "Path to a file." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "NoExist.h" + candidate_directories: + - ".*/Tests/RunCMake/find_path/include/" + - ".*/Tests/RunCMake/find_path/"( + - "[^"]+")+ + searched_directories: + - ".*/Tests/RunCMake/find_path/include/NoExist.h" + - ".*/Tests/RunCMake/find_path/NoExist.h"( + - "[^"]+")+ + found: false + search_context:( + [^ +]*)+ + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_path\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotFound -> NotFound + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_path\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotDefined -> Found + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_path\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "path" + variable: "PREFIX_IN_PATH" + description: "Path to a file." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "PrefixInPATH.h" + candidate_directories: + - ".*/Tests/RunCMake/find_path/include/" + - ".*/Tests/RunCMake/find_path/"( + - "[^"]+")+ + found: ".*/Tests/RunCMake/find_path/include/PrefixInPATH.h" + search_context:( + [^ +]*)+ + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_path\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + Found -> Found + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_path\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + Found -> NotFound + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_path\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "path" + variable: "PREFIX_IN_PATH" + description: "Path to a file." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "PrefixInPATH.h" + candidate_directories: + - ".*/Tests/RunCMake/find_path/include/" + - ".*/Tests/RunCMake/find_path/"( + - "[^"]+")+ + searched_directories: + - ".*/Tests/RunCMake/find_path/include/NoExist.h" + - ".*/Tests/RunCMake/find_path/NoExist.h"( + - "[^"]+")+ + found: false + search_context:( + [^ +]*)+ + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_path\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotFound -> Found + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_path\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "path" + variable: "PREFIX_IN_PATH" + description: "Path to a file." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "PrefixInPATH.h" + candidate_directories: + - ".*/Tests/RunCMake/find_path/include/" + - ".*/Tests/RunCMake/find_path/"( + - "[^"]+")+ + found: ".*/Tests/RunCMake/find_path/include/PrefixInPATH.h" + search_context:( + [^ +]*)+ +... diff --git a/Tests/RunCMake/find_path/ConfigureLogTransitions.cmake b/Tests/RunCMake/find_path/ConfigureLogTransitions.cmake new file mode 100644 index 0000000000..a9769aae01 --- /dev/null +++ b/Tests/RunCMake/find_path/ConfigureLogTransitions.cmake @@ -0,0 +1,22 @@ +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") + +message(CONFIGURE_LOG "NotDefined -> NotFound") +find_path(NOEXIST_FILE NAMES NoExist.h) + +message(CONFIGURE_LOG "NotFound -> NotFound") +find_path(NOEXIST_FILE NAMES NoExist.h) + +message(CONFIGURE_LOG "NotDefined -> Found") +find_path(PREFIX_IN_PATH NAMES PrefixInPATH.h) + +message(CONFIGURE_LOG "Found -> Found") +find_path(PREFIX_IN_PATH NAMES PrefixInPATH.h) + +message(CONFIGURE_LOG "Found -> NotFound") +unset(PREFIX_IN_PATH CACHE) +unset(CMAKE_PREFIX_PATH) +find_path(PREFIX_IN_PATH NAMES PrefixInPATH.h) + +message(CONFIGURE_LOG "NotFound -> Found") +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") +find_path(PREFIX_IN_PATH NAMES PrefixInPATH.h) diff --git a/Tests/RunCMake/find_path/RunCMakeTest.cmake b/Tests/RunCMake/find_path/RunCMakeTest.cmake index dc4b692717..abbdf0d182 100644 --- a/Tests/RunCMake/find_path/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_path/RunCMakeTest.cmake @@ -1,5 +1,6 @@ include(RunCMake) +run_cmake(ConfigureLogTransitions) run_cmake(EmptyOldStyle) run_cmake(FromPATHEnv) run_cmake(PrefixInPATH) diff --git a/Tests/RunCMake/find_program/ConfigureLogTransitions-config.txt b/Tests/RunCMake/find_program/ConfigureLogTransitions-config.txt new file mode 100644 index 0000000000..005fc2afcb --- /dev/null +++ b/Tests/RunCMake/find_program/ConfigureLogTransitions-config.txt @@ -0,0 +1,177 @@ +^ +--- +events: + - +events:( + - + kind: "find-v1"( + [^ +]*)+| ++ - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)* + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(message\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotDefined -> NotFound + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_program\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "program" + variable: "NOEXIST_FILE" + description: "Path to a program." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "NoExist" + candidate_directories: + - ".*/Tests/RunCMake/find_program/Prefix/bin/" + - ".*/Tests/RunCMake/find_program/Prefix/sbin/" + - ".*/Tests/RunCMake/find_program/Prefix/"( + - "[^"]+")+ + searched_directories:( + - ".*/Tests/RunCMake/find_program/Prefix/bin/NoExist(|.com|.exe)")+( + - ".*/Tests/RunCMake/find_program/Prefix/sbin/NoExist(|.com|.exe)")+( + - ".*/Tests/RunCMake/find_program/Prefix/NoExist(|.com|.exe)")+( + - "[^"]+")+ + found: false + search_context:( + [^ +]*)+ + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_program\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotFound -> NotFound + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_program\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotDefined -> Found + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_program\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "program" + variable: "PREFIX_IN_PATH" + description: "Path to a program." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "prog" + candidate_directories: + - ".*/Tests/RunCMake/find_program/Prefix/bin/" + - ".*/Tests/RunCMake/find_program/Prefix/sbin/" + - ".*/Tests/RunCMake/find_program/Prefix/"( + - "[^"]+")+( + searched_directories: + - ".*/Tests/RunCMake/find_program/Prefix/bin/prog.com" + - ".*/Tests/RunCMake/find_program/Prefix/bin/prog.exe")? + found: ".*/Tests/RunCMake/find_program/Prefix/bin/prog" + search_context:( + [^ +]*)+ + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(message\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + Found -> Found + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_program\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + Found -> NotFound + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_program\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "program" + variable: "PREFIX_IN_PATH" + description: "Path to a program." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "prog" + candidate_directories:( + - "[^"]+")+ + searched_directories:( + - "[^"]+")+ + found: false + search_context:( + [^ +]*)+ + - + kind: "message-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_program\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + NotFound -> Found + - + kind: "find-v1" + backtrace: + - "ConfigureLogTransitions.cmake:[0-9]+ \(find_program\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + mode: "program" + variable: "PREFIX_IN_PATH" + description: "Path to a program." + settings: + SearchFramework: "(NEVER|FIRST)" + SearchAppBundle: "(NEVER|FIRST)" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "prog" + candidate_directories: + - ".*/Tests/RunCMake/find_program/Prefix/bin/" + - ".*/Tests/RunCMake/find_program/Prefix/sbin/" + - ".*/Tests/RunCMake/find_program/Prefix/"( + - "[^"]+")+( + searched_directories: + - ".*/Tests/RunCMake/find_program/Prefix/bin/prog.com" + - ".*/Tests/RunCMake/find_program/Prefix/bin/prog.exe")? + found: ".*/Tests/RunCMake/find_program/Prefix/bin/prog" + search_context:( + [^ +]*)+ +... diff --git a/Tests/RunCMake/find_program/ConfigureLogTransitions.cmake b/Tests/RunCMake/find_program/ConfigureLogTransitions.cmake new file mode 100644 index 0000000000..0ce3077c5b --- /dev/null +++ b/Tests/RunCMake/find_program/ConfigureLogTransitions.cmake @@ -0,0 +1,22 @@ +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Prefix") + +message(CONFIGURE_LOG "NotDefined -> NotFound") +find_program(NOEXIST_FILE NAMES NoExist) + +message(CONFIGURE_LOG "NotFound -> NotFound") +find_program(NOEXIST_FILE NAMES NoExist) + +message(CONFIGURE_LOG "NotDefined -> Found") +find_program(PREFIX_IN_PATH NAMES prog) + +message(CONFIGURE_LOG "Found -> Found") +find_program(PREFIX_IN_PATH NAMES prog) + +message(CONFIGURE_LOG "Found -> NotFound") +unset(PREFIX_IN_PATH CACHE) +unset(CMAKE_PREFIX_PATH) +find_program(PREFIX_IN_PATH NAMES prog) + +message(CONFIGURE_LOG "NotFound -> Found") +set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") +find_program(PREFIX_IN_PATH NAMES prog) diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake index c7a10bbc2e..dc84821a7c 100644 --- a/Tests/RunCMake/find_program/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake @@ -1,5 +1,6 @@ include(RunCMake) +run_cmake(ConfigureLogTransitions) run_cmake(EnvAndHints) run_cmake(DirsPerName) run_cmake(NamesPerDir)