Tests/InstallPackageInfo: Consolidate bad arguments tests

Consolidate InstallPackageInfo's bad arguments tests into only two test
cases that each test multiple invocations, rather than having a single
test per invocation. This makes them match the similar ExportPackageInfo
tests which were necessarily consolidated due to those testing many more
variants (due to differences in the respective interfaces). This will
simplify adding additional tests in the future.
This commit is contained in:
Matthew Woehlke
2025-05-29 13:43:15 -04:00
parent d4ab279742
commit 9adf93d112
14 changed files with 27 additions and 23 deletions

View File

@@ -1,2 +1,10 @@
CMake Error at BadArgs1.cmake:3 \(install\):
install COMPAT_VERSION requires VERSION.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)
CMake Error at BadArgs1.cmake:4 \(install\):
install VERSION_SCHEMA requires VERSION.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)

View File

@@ -1,3 +1,4 @@
add_library(foo INTERFACE)
install(TARGETS foo EXPORT foo DESTINATION .)
install(PACKAGE_INFO test EXPORT foo COMPAT_VERSION 1.0)
install(PACKAGE_INFO test EXPORT foo VERSION_SCHEMA simple)

View File

@@ -1,2 +1,16 @@
CMake Error at BadArgs2.cmake:3 \(install\):
install VERSION_SCHEMA requires VERSION.
install APPENDIX and VERSION are mutually exclusive.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)
CMake Error at BadArgs2.cmake:4 \(install\):
install APPENDIX and DEFAULT_TARGETS are mutually exclusive.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)
CMake Error at BadArgs2.cmake:5 \(install\):
install APPENDIX and DEFAULT_CONFIGURATIONS are mutually exclusive.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)

View File

@@ -1,3 +1,5 @@
add_library(foo INTERFACE)
install(TARGETS foo EXPORT foo DESTINATION .)
install(PACKAGE_INFO test EXPORT foo VERSION_SCHEMA simple)
install(PACKAGE_INFO test EXPORT foo APPENDIX test VERSION 1.0)
install(PACKAGE_INFO test EXPORT foo APPENDIX test DEFAULT_TARGETS foo)
install(PACKAGE_INFO test EXPORT foo APPENDIX test DEFAULT_CONFIGURATIONS test)

View File

@@ -1,2 +0,0 @@
CMake Error at BadArgs3.cmake:3 \(install\):
install APPENDIX and VERSION are mutually exclusive.

View File

@@ -1,3 +0,0 @@
add_library(foo INTERFACE)
install(TARGETS foo EXPORT foo DESTINATION .)
install(PACKAGE_INFO test EXPORT foo APPENDIX test VERSION 1.0)

View File

@@ -1,2 +0,0 @@
CMake Error at BadArgs4.cmake:3 \(install\):
install APPENDIX and DEFAULT_TARGETS are mutually exclusive.

View File

@@ -1,3 +0,0 @@
add_library(foo INTERFACE)
install(TARGETS foo EXPORT foo DESTINATION .)
install(PACKAGE_INFO test EXPORT foo APPENDIX test DEFAULT_TARGETS foo)

View File

@@ -1,2 +0,0 @@
CMake Error at BadArgs5.cmake:3 \(install\):
install APPENDIX and DEFAULT_CONFIGURATIONS are mutually exclusive.

View File

@@ -1,3 +0,0 @@
add_library(foo INTERFACE)
install(TARGETS foo EXPORT foo DESTINATION .)
install(PACKAGE_INFO test EXPORT foo APPENDIX test DEFAULT_CONFIGURATIONS test)

View File

@@ -26,9 +26,6 @@ endfunction()
# Test incorrect usage
run_cmake(BadArgs1)
run_cmake(BadArgs2)
run_cmake(BadArgs3)
run_cmake(BadArgs4)
run_cmake(BadArgs5)
run_cmake(BadName)
run_cmake(BadDefaultTarget)
run_cmake(ReferencesNonExportedTarget)