Browse Source

file(ARCHIVE*): Add test for keyword arguments with missing values

Brad King 3 years ago
parent
commit
dfff470d15

+ 3 - 0
Tests/RunCMake/File_Archive/RunCMakeTest.cmake

@@ -13,6 +13,9 @@ run_cmake(zip)
 # Extracting only selected files or directories
 run_cmake(zip-filtered)
 
+run_cmake(create-missing-args)
+run_cmake(extract-missing-args)
+
 run_cmake(unsupported-format)
 run_cmake(zip-with-bad-compression)
 run_cmake(7zip-with-bad-compression)

+ 1 - 0
Tests/RunCMake/File_Archive/create-missing-args-result.txt

@@ -0,0 +1 @@
+1

+ 9 - 0
Tests/RunCMake/File_Archive/create-missing-args-stderr.txt

@@ -0,0 +1,9 @@
+^CMake Error at create-missing-args.cmake:[0-9]+ \(file\):
+  file Keywords missing values:
+
+    OUTPUT
+    FORMAT
+    COMPRESSION
+    COMPRESSION_LEVEL
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)$

+ 8 - 0
Tests/RunCMake/File_Archive/create-missing-args.cmake

@@ -0,0 +1,8 @@
+file(ARCHIVE_CREATE
+  OUTPUT              # missing output path
+  FORMAT              # missing output format
+  COMPRESSION         # missing compression type
+  COMPRESSION_LEVEL   # missing compression level
+  MTIME               # missing modification time
+  PATHS               # no paths
+  )

+ 1 - 0
Tests/RunCMake/File_Archive/extract-missing-args-result.txt

@@ -0,0 +1 @@
+1

+ 7 - 0
Tests/RunCMake/File_Archive/extract-missing-args-stderr.txt

@@ -0,0 +1,7 @@
+^CMake Error at extract-missing-args.cmake:[0-9]+ \(file\):
+  file Keywords missing values:
+
+    INPUT
+    DESTINATION
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)$

+ 5 - 0
Tests/RunCMake/File_Archive/extract-missing-args.cmake

@@ -0,0 +1,5 @@
+file(ARCHIVE_EXTRACT
+  INPUT         # missing input
+  DESTINATION   # missing destination
+  PATTERNS      # no patterns
+  )