summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-14 19:13:11 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-17 13:06:59 (GMT)
commitdbd933365ec780d27ab7c0dfba30dc1af1094607 (patch)
tree2fd61c1a48fbf8a0cea360400529e1abb588ac11 /Tests/RunCMake
parent56457837e28de29d4f94b0cc9c47ef314d8f05e1 (diff)
downloadCMake-dbd933365ec780d27ab7c0dfba30dc1af1094607.zip
CMake-dbd933365ec780d27ab7c0dfba30dc1af1094607.tar.gz
CMake-dbd933365ec780d27ab7c0dfba30dc1af1094607.tar.bz2
cmListFileLexer: Allow a leading UTF-8 Byte-Order-Mark (#11137)
Teach the lexer to read a UTF-8, UTF-16 BE/LE, or UTF-32 BE/LE Byte-Order-Mark from the start of a file if any is present. Report an error on files using UTF-16 or UTF-32 and accept a UTF-8 or missing BOM.
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/Syntax/BOM-UTF-16-BE-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt6
-rw-r--r--Tests/RunCMake/Syntax/BOM-UTF-16-BE.cmakebin0 -> 54 bytes
-rw-r--r--Tests/RunCMake/Syntax/BOM-UTF-16-LE-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt6
-rw-r--r--Tests/RunCMake/Syntax/BOM-UTF-16-LE.cmakebin0 -> 54 bytes
-rw-r--r--Tests/RunCMake/Syntax/BOM-UTF-32-BE-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt6
-rw-r--r--Tests/RunCMake/Syntax/BOM-UTF-32-BE.cmakebin0 -> 108 bytes
-rw-r--r--Tests/RunCMake/Syntax/BOM-UTF-32-LE-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt6
-rw-r--r--Tests/RunCMake/Syntax/BOM-UTF-32-LE.cmakebin0 -> 108 bytes
-rw-r--r--Tests/RunCMake/Syntax/BOM-UTF-8-stdout.txt1
-rw-r--r--Tests/RunCMake/Syntax/BOM-UTF-8.cmake1
-rw-r--r--Tests/RunCMake/Syntax/RunCMakeTest.cmake5
15 files changed, 35 insertions, 0 deletions
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-BE-result.txt b/Tests/RunCMake/Syntax/BOM-UTF-16-BE-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BOM-UTF-16-BE-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt
new file mode 100644
index 0000000..b3f1e47
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error at CMakeLists.txt:3 \(include\):
+ File
+
+ .*/Tests/RunCMake/Syntax/BOM-UTF-16-BE.cmake
+
+ starts with a Byte-Order-Mark that is not UTF-8.
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-BE.cmake b/Tests/RunCMake/Syntax/BOM-UTF-16-BE.cmake
new file mode 100644
index 0000000..c51f6e6
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BOM-UTF-16-BE.cmake
Binary files differ
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-LE-result.txt b/Tests/RunCMake/Syntax/BOM-UTF-16-LE-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BOM-UTF-16-LE-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt
new file mode 100644
index 0000000..c08c902
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error at CMakeLists.txt:3 \(include\):
+ File
+
+ .*/Tests/RunCMake/Syntax/BOM-UTF-16-LE.cmake
+
+ starts with a Byte-Order-Mark that is not UTF-8.
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-LE.cmake b/Tests/RunCMake/Syntax/BOM-UTF-16-LE.cmake
new file mode 100644
index 0000000..b57446f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BOM-UTF-16-LE.cmake
Binary files differ
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-BE-result.txt b/Tests/RunCMake/Syntax/BOM-UTF-32-BE-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BOM-UTF-32-BE-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt
new file mode 100644
index 0000000..5dde4e3
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error at CMakeLists.txt:3 \(include\):
+ File
+
+ .*/Tests/RunCMake/Syntax/BOM-UTF-32-BE.cmake
+
+ starts with a Byte-Order-Mark that is not UTF-8.
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-BE.cmake b/Tests/RunCMake/Syntax/BOM-UTF-32-BE.cmake
new file mode 100644
index 0000000..23c57f3
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BOM-UTF-32-BE.cmake
Binary files differ
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-LE-result.txt b/Tests/RunCMake/Syntax/BOM-UTF-32-LE-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BOM-UTF-32-LE-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt
new file mode 100644
index 0000000..eb054ec
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error at CMakeLists.txt:3 \(include\):
+ File
+
+ .*/Tests/RunCMake/Syntax/BOM-UTF-32-LE.cmake
+
+ starts with a Byte-Order-Mark that is not UTF-8.
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-LE.cmake b/Tests/RunCMake/Syntax/BOM-UTF-32-LE.cmake
new file mode 100644
index 0000000..c330f5b
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BOM-UTF-32-LE.cmake
Binary files differ
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-8-stdout.txt b/Tests/RunCMake/Syntax/BOM-UTF-8-stdout.txt
new file mode 100644
index 0000000..5776d6e
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BOM-UTF-8-stdout.txt
@@ -0,0 +1 @@
+-- message
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-8.cmake b/Tests/RunCMake/Syntax/BOM-UTF-8.cmake
new file mode 100644
index 0000000..bdff83b
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BOM-UTF-8.cmake
@@ -0,0 +1 @@
+message(STATUS "message")
diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
index 2d87328..d1a15c8 100644
--- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
@@ -1,5 +1,10 @@
include(RunCMake)
+run_cmake(BOM-UTF-8)
+run_cmake(BOM-UTF-16-LE)
+run_cmake(BOM-UTF-16-BE)
+run_cmake(BOM-UTF-32-LE)
+run_cmake(BOM-UTF-32-BE)
run_cmake(CommandSpaces)
run_cmake(CommandTabs)
run_cmake(CommandNewlines)