summaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorCharles Brunet <charles.brunet@optelgroup.com>2024-02-14 08:57:35 -0500
committerEli Schwartz <eschwartz93@gmail.com>2024-02-23 15:00:39 -0500
commit715dc27b2b8432d9749df985f262de8a8347c59b (patch)
tree17acc9cf96161b31fd403d0062bedc72c80fc7b2 /test cases
parent138e0fe9841b44a6d0402b66bbd0c10966cfe87b (diff)
downloadmeson-715dc27b2b8432d9749df985f262de8a8347c59b.tar.gz
Detect utf8 bom from meson build files
Some text editors on Windows may use utf8bom encoding by default. Prevent crash and properly report misencoded files. Fixes #12766.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/failing/130 utf8 with bom/meson.build3
-rw-r--r--test cases/failing/130 utf8 with bom/test.json8
-rw-r--r--test cases/failing/131 utf8 with bom subdir/meson.build3
-rw-r--r--test cases/failing/131 utf8 with bom subdir/subdir/meson.build1
-rw-r--r--test cases/failing/131 utf8 with bom subdir/test.json8
-rw-r--r--test cases/failing/132 utf8 with bom options/meson.build1
-rw-r--r--test cases/failing/132 utf8 with bom options/meson.options1
-rw-r--r--test cases/failing/132 utf8 with bom options/test.json8
8 files changed, 33 insertions, 0 deletions
diff --git a/test cases/failing/130 utf8 with bom/meson.build b/test cases/failing/130 utf8 with bom/meson.build
new file mode 100644
index 000000000..492a0c691
--- /dev/null
+++ b/test cases/failing/130 utf8 with bom/meson.build
@@ -0,0 +1,3 @@
+project('utf8 with bom')
+
+subdir('subdir')
diff --git a/test cases/failing/130 utf8 with bom/test.json b/test cases/failing/130 utf8 with bom/test.json
new file mode 100644
index 000000000..2292bebe3
--- /dev/null
+++ b/test cases/failing/130 utf8 with bom/test.json
@@ -0,0 +1,8 @@
+{
+ "stdout": [
+ {
+ "line": "test cases/failing/130 utf8 with bom/meson.build:0:0: ERROR: Builder file must be encoded in UTF-8 (with no BOM)"
+ }
+ ]
+ }
+ \ No newline at end of file
diff --git a/test cases/failing/131 utf8 with bom subdir/meson.build b/test cases/failing/131 utf8 with bom subdir/meson.build
new file mode 100644
index 000000000..8d3bbd7e8
--- /dev/null
+++ b/test cases/failing/131 utf8 with bom subdir/meson.build
@@ -0,0 +1,3 @@
+project('utf8 with bom subdir')
+
+subdir('subdir')
diff --git a/test cases/failing/131 utf8 with bom subdir/subdir/meson.build b/test cases/failing/131 utf8 with bom subdir/subdir/meson.build
new file mode 100644
index 000000000..dbf2b9cc7
--- /dev/null
+++ b/test cases/failing/131 utf8 with bom subdir/subdir/meson.build
@@ -0,0 +1 @@
+a = 'Hello, World!'
diff --git a/test cases/failing/131 utf8 with bom subdir/test.json b/test cases/failing/131 utf8 with bom subdir/test.json
new file mode 100644
index 000000000..72cc5152d
--- /dev/null
+++ b/test cases/failing/131 utf8 with bom subdir/test.json
@@ -0,0 +1,8 @@
+{
+ "stdout": [
+ {
+ "line": "test cases/failing/131 utf8 with bom subdir/subdir/meson.build:0:0: ERROR: Builder file must be encoded in UTF-8 (with no BOM)"
+ }
+ ]
+ }
+ \ No newline at end of file
diff --git a/test cases/failing/132 utf8 with bom options/meson.build b/test cases/failing/132 utf8 with bom options/meson.build
new file mode 100644
index 000000000..50413e031
--- /dev/null
+++ b/test cases/failing/132 utf8 with bom options/meson.build
@@ -0,0 +1 @@
+project('utf8 with bom options')
diff --git a/test cases/failing/132 utf8 with bom options/meson.options b/test cases/failing/132 utf8 with bom options/meson.options
new file mode 100644
index 000000000..250c03279
--- /dev/null
+++ b/test cases/failing/132 utf8 with bom options/meson.options
@@ -0,0 +1 @@
+option('someoption', type : 'string', value : 'optval', description : 'An option')
diff --git a/test cases/failing/132 utf8 with bom options/test.json b/test cases/failing/132 utf8 with bom options/test.json
new file mode 100644
index 000000000..c09f48e6a
--- /dev/null
+++ b/test cases/failing/132 utf8 with bom options/test.json
@@ -0,0 +1,8 @@
+{
+ "stdout": [
+ {
+ "line": "test cases/failing/132 utf8 with bom options/meson.options:0:0: ERROR: Builder file must be encoded in UTF-8 (with no BOM)"
+ }
+ ]
+ }
+ \ No newline at end of file