summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2019-06-27 12:50:57 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2019-06-27 14:57:34 (GMT)
commit27d6e51ae9b57657289a4db6092d8a47472b842e (patch)
treec874f3bda593a598aff2696e2abf81148fca6c1f
parent49cfd390075ba1f92aa96bbf3d3510a813e0b068 (diff)
downloadCMake-27d6e51ae9b57657289a4db6092d8a47472b842e.zip
CMake-27d6e51ae9b57657289a4db6092d8a47472b842e.tar.gz
CMake-27d6e51ae9b57657289a4db6092d8a47472b842e.tar.bz2
Tests: add tests for export set error messages
-rw-r--r--Tests/RunCMake/export/DependOnDoubleExport-result.txt1
-rw-r--r--Tests/RunCMake/export/DependOnDoubleExport-stderr.txt13
-rw-r--r--Tests/RunCMake/export/DependOnDoubleExport.cmake7
-rw-r--r--Tests/RunCMake/export/DependOnNotExport-result.txt1
-rw-r--r--Tests/RunCMake/export/DependOnNotExport-stderr.txt6
-rw-r--r--Tests/RunCMake/export/DependOnNotExport.cmake4
-rw-r--r--Tests/RunCMake/export/RunCMakeTest.cmake2
7 files changed, 34 insertions, 0 deletions
diff --git a/Tests/RunCMake/export/DependOnDoubleExport-result.txt b/Tests/RunCMake/export/DependOnDoubleExport-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/export/DependOnDoubleExport-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt b/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt
new file mode 100644
index 0000000..b78c7e4
--- /dev/null
+++ b/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt
@@ -0,0 +1,13 @@
+CMake Error in CMakeLists.txt:
+ export called with target "exported" which requires target "doubleexported"
+ that is not in this export set, but in multiple other export sets:
+ .*/Tests/RunCMake/export/DependOnDoubleExport-build/exportset.cmake,
+ .*/Tests/RunCMake/export/DependOnDoubleExport-build/manual.cmake.
+
+
+ An exported target cannot depend upon another target which is exported
+ multiple times. Consider consolidating the exports of the "doubleexported"
+ target to a single export.
+
+
+CMake Generate step failed. Build files cannot be regenerated correctly.
diff --git a/Tests/RunCMake/export/DependOnDoubleExport.cmake b/Tests/RunCMake/export/DependOnDoubleExport.cmake
new file mode 100644
index 0000000..8d108d7
--- /dev/null
+++ b/Tests/RunCMake/export/DependOnDoubleExport.cmake
@@ -0,0 +1,7 @@
+add_library(doubleexported INTERFACE)
+install(TARGETS doubleexported EXPORT exportset)
+export(TARGETS doubleexported FILE "${CMAKE_CURRENT_BINARY_DIR}/manual.cmake")
+export(EXPORT exportset FILE "${CMAKE_CURRENT_BINARY_DIR}/exportset.cmake")
+add_library(exported INTERFACE)
+target_link_libraries(exported INTERFACE doubleexported)
+export(TARGETS exported FILE "${CMAKE_CURRENT_BINARY_DIR}/exports.cmake")
diff --git a/Tests/RunCMake/export/DependOnNotExport-result.txt b/Tests/RunCMake/export/DependOnNotExport-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/export/DependOnNotExport-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/export/DependOnNotExport-stderr.txt b/Tests/RunCMake/export/DependOnNotExport-stderr.txt
new file mode 100644
index 0000000..80f5758
--- /dev/null
+++ b/Tests/RunCMake/export/DependOnNotExport-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error in CMakeLists.txt:
+ export called with target "exported" which requires target "notexported"
+ that is not in any export set.
+
+
+CMake Generate step failed. Build files cannot be regenerated correctly.
diff --git a/Tests/RunCMake/export/DependOnNotExport.cmake b/Tests/RunCMake/export/DependOnNotExport.cmake
new file mode 100644
index 0000000..06c1ad9
--- /dev/null
+++ b/Tests/RunCMake/export/DependOnNotExport.cmake
@@ -0,0 +1,4 @@
+add_library(notexported INTERFACE)
+add_library(exported INTERFACE)
+target_link_libraries(exported INTERFACE notexported)
+export(TARGETS exported FILE "${CMAKE_CURRENT_BINARY_DIR}/exports.cmake")
diff --git a/Tests/RunCMake/export/RunCMakeTest.cmake b/Tests/RunCMake/export/RunCMakeTest.cmake
index 97a0ca6..4d2f217 100644
--- a/Tests/RunCMake/export/RunCMakeTest.cmake
+++ b/Tests/RunCMake/export/RunCMakeTest.cmake
@@ -10,3 +10,5 @@ run_cmake(ForbiddenToExportInterfaceProperties)
run_cmake(ForbiddenToExportImportedProperties)
run_cmake(ForbiddenToExportPropertyWithGenExp)
run_cmake(ExportPropertiesUndefined)
+run_cmake(DependOnNotExport)
+run_cmake(DependOnDoubleExport)