Tests: Teach RunCMake to optionally ignore policy version deprecation warnings

Avoid requiring tests for deprecated behavior to match the warnings
explicitly.
This commit is contained in:
Brad King
2023-02-06 14:00:00 -05:00
parent 536f35c4f1
commit 3092b14ed0
14 changed files with 19 additions and 75 deletions

View File

@@ -1,6 +0,0 @@
^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.$

View File

@@ -1,13 +1,6 @@
^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
+
CMake Deprecation Warning at CMP0019-OLD.cmake:[0-9]+ \(cmake_policy\):
^CMake Deprecation Warning at CMP0019-OLD\.cmake:[0-9]+ \(cmake_policy\):
The OLD behavior for policy CMP0019 will be removed from a future version
of CMake.
of CMake\.
The cmake-policies\(7\) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under

View File

@@ -1,11 +1,4 @@
^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
+
CMake Warning \(dev\) in CMakeLists.txt:
^CMake Warning \(dev\) in CMakeLists\.txt:
Policy CMP0019 is not set: Do not re-expand variables in include and link
information. Run "cmake --help-policy CMP0019" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.

View File

@@ -1,4 +1,5 @@
include(RunCMake)
set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
run_cmake(CMP0019-WARN)
run_cmake(CMP0019-OLD)

View File

@@ -1,6 +0,0 @@
^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.$

View File

@@ -1,6 +0,0 @@
^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.$

View File

@@ -1,6 +0,0 @@
^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.$

View File

@@ -1,6 +0,0 @@
^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.$

View File

@@ -1,6 +0,0 @@
^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.$

View File

@@ -1,11 +1,4 @@
^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
+
CMake Warning \(dev\) in CMakeLists.txt:
^CMake Warning \(dev\) in CMakeLists\.txt:
Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
interface. Run "cmake --help-policy CMP0022" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.

View File

@@ -1,11 +1,4 @@
^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
+
CMake Warning \(dev\) in CMakeLists.txt:
^CMake Warning \(dev\) in CMakeLists\.txt:
Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
interface. Run "cmake --help-policy CMP0022" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.

View File

@@ -1,6 +0,0 @@
^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.$

View File

@@ -1,4 +1,5 @@
include(RunCMake)
set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
run_cmake(CMP0022-WARN)
run_cmake(CMP0022-WARN-tll)

View File

@@ -186,6 +186,18 @@ function(run_cmake test)
"|[^\n]*Bullseye Testing Technology"
")[^\n]*\n)+"
)
if(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION)
string(REGEX REPLACE [[
^CMake Deprecation Warning at [^
]*CMakeLists.txt:1 \(cmake_minimum_required\):
Compatibility with CMake < 2\.8\.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a \.\.\.<max> suffix to tell
CMake that the project does not need compatibility with older versions\.
+
]] "" actual_stderr "${actual_stderr}")
endif()
foreach(o IN ITEMS stdout stderr config)
string(REGEX REPLACE "\r\n" "\n" actual_${o} "${actual_${o}}")
string(REGEX REPLACE "${ignore_line_regex}" "\\1" actual_${o} "${actual_${o}}")