summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-03-20 10:16:50 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-03-20 10:17:00 (GMT)
commit94139ac58e2a4b1c4e3360b6d0da31ba9ba23c3c (patch)
tree6b5c0327c0f54ad107e5057894486c1b54be5aba /Tests
parent9bbea2344b058734047b0c889b2a6dae13c85cec (diff)
parent8affe9aa336b873e9c8e40ec5911ffe23c2ef03a (diff)
downloadCMake-94139ac58e2a4b1c4e3360b6d0da31ba9ba23c3c.zip
CMake-94139ac58e2a4b1c4e3360b6d0da31ba9ba23c3c.tar.gz
CMake-94139ac58e2a4b1c4e3360b6d0da31ba9ba23c3c.tar.bz2
Merge topic 'export-repeat'
8affe9aa33 export: Fix use-after-free on multiple calls overwriting same FILE Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4494
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/export/Repeat.cmake5
-rw-r--r--Tests/RunCMake/export/Repeat/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/export/RunCMakeTest.cmake1
3 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/export/Repeat.cmake b/Tests/RunCMake/export/Repeat.cmake
new file mode 100644
index 0000000..f3262e7
--- /dev/null
+++ b/Tests/RunCMake/export/Repeat.cmake
@@ -0,0 +1,5 @@
+add_library(foo INTERFACE)
+export(TARGETS foo FILE foo.cmake)
+export(TARGETS foo FILE foo.cmake)
+add_subdirectory(Repeat)
+include(CMakePackageConfigHelpers)
diff --git a/Tests/RunCMake/export/Repeat/CMakeLists.txt b/Tests/RunCMake/export/Repeat/CMakeLists.txt
new file mode 100644
index 0000000..b37f6ca
--- /dev/null
+++ b/Tests/RunCMake/export/Repeat/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_library(bar INTERFACE)
+export(TARGETS bar FILE ${CMAKE_BINARY_DIR}/foo.cmake)
diff --git a/Tests/RunCMake/export/RunCMakeTest.cmake b/Tests/RunCMake/export/RunCMakeTest.cmake
index 4d2f217..df35d95 100644
--- a/Tests/RunCMake/export/RunCMakeTest.cmake
+++ b/Tests/RunCMake/export/RunCMakeTest.cmake
@@ -2,6 +2,7 @@ include(RunCMake)
run_cmake(CustomTarget)
run_cmake(Empty)
+run_cmake(Repeat)
run_cmake(TargetNotFound)
run_cmake(AppendExport)
run_cmake(OldIface)