summaryrefslogtreecommitdiffstats
path: root/test cases/warning
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/warning')
-rw-r--r--test cases/warning/1 version for string div/a/b.c3
-rw-r--r--test cases/warning/1 version for string div/meson.build3
-rw-r--r--test cases/warning/1 version for string div/test.json8
-rw-r--r--test cases/warning/2 languages missing native/meson.build3
-rw-r--r--test cases/warning/2 languages missing native/test.json7
-rw-r--r--test cases/warning/3 fallback consistency/meson.build7
-rw-r--r--test cases/warning/3 fallback consistency/subprojects/sub/meson.build5
-rw-r--r--test cases/warning/3 fallback consistency/test.json10
-rw-r--r--test cases/warning/4 fallback consistency/meson.build4
-rw-r--r--test cases/warning/4 fallback consistency/subprojects/sub/meson.build5
-rw-r--r--test cases/warning/4 fallback consistency/test.json10
-rw-r--r--test cases/warning/5 fallback consistency/meson.build4
-rw-r--r--test cases/warning/5 fallback consistency/subprojects/foo.wrap6
-rw-r--r--test cases/warning/5 fallback consistency/subprojects/foo/meson.build6
-rw-r--r--test cases/warning/5 fallback consistency/test.json10
-rw-r--r--test cases/warning/6 list add/meson.build7
-rw-r--r--test cases/warning/6 list add/test.json7
-rw-r--r--test cases/warning/7 module without unstable/meson.build3
-rw-r--r--test cases/warning/7 module without unstable/test.json7
-rw-r--r--test cases/warning/8 target with no sources/meson.build3
-rw-r--r--test cases/warning/8 target with no sources/test.json7
21 files changed, 125 insertions, 0 deletions
diff --git a/test cases/warning/1 version for string div/a/b.c b/test cases/warning/1 version for string div/a/b.c
new file mode 100644
index 0000000..74de8a8
--- /dev/null
+++ b/test cases/warning/1 version for string div/a/b.c
@@ -0,0 +1,3 @@
+int main(void)
+{
+}
diff --git a/test cases/warning/1 version for string div/meson.build b/test cases/warning/1 version for string div/meson.build
new file mode 100644
index 0000000..54e9708
--- /dev/null
+++ b/test cases/warning/1 version for string div/meson.build
@@ -0,0 +1,3 @@
+project('warn on string division', 'c', meson_version: '>=0.48.0')
+
+executable('prog', 'a' / 'b.c')
diff --git a/test cases/warning/1 version for string div/test.json b/test cases/warning/1 version for string div/test.json
new file mode 100644
index 0000000..e8acb69
--- /dev/null
+++ b/test cases/warning/1 version for string div/test.json
@@ -0,0 +1,8 @@
+{
+ "stdout": [
+ {
+ "comment": "literal '/' appears in output, irrespective of os.path.sep, as that's the operator",
+ "line": "test cases/warning/1 version for string div/meson.build:3: WARNING: Project targets '>=0.48.0' but uses feature introduced in '0.49.0': / with string arguments."
+ }
+ ]
+}
diff --git a/test cases/warning/2 languages missing native/meson.build b/test cases/warning/2 languages missing native/meson.build
new file mode 100644
index 0000000..e204715
--- /dev/null
+++ b/test cases/warning/2 languages missing native/meson.build
@@ -0,0 +1,3 @@
+project('languages missing native',
+ meson_version : '>= 0.54')
+add_languages('c')
diff --git a/test cases/warning/2 languages missing native/test.json b/test cases/warning/2 languages missing native/test.json
new file mode 100644
index 0000000..f929654
--- /dev/null
+++ b/test cases/warning/2 languages missing native/test.json
@@ -0,0 +1,7 @@
+{
+ "stdout": [
+ {
+ "line": "test cases/warning/2 languages missing native/meson.build:3: WARNING: add_languages is missing native:, assuming languages are wanted for both host and build."
+ }
+ ]
+}
diff --git a/test cases/warning/3 fallback consistency/meson.build b/test cases/warning/3 fallback consistency/meson.build
new file mode 100644
index 0000000..ad2b226
--- /dev/null
+++ b/test cases/warning/3 fallback consistency/meson.build
@@ -0,0 +1,7 @@
+project('proj', 'c')
+
+# The first call succeed and cache the value of 'sub' dependency. The 2nd call
+# should return the cached value, but still verify the fallback variable is
+# consistent.
+dependency('sub', fallback : ['sub', 'dep1'])
+dependency('sub', fallback : ['sub', 'dep2'])
diff --git a/test cases/warning/3 fallback consistency/subprojects/sub/meson.build b/test cases/warning/3 fallback consistency/subprojects/sub/meson.build
new file mode 100644
index 0000000..12a6570
--- /dev/null
+++ b/test cases/warning/3 fallback consistency/subprojects/sub/meson.build
@@ -0,0 +1,5 @@
+project('proj', 'c')
+
+dep1 = declare_dependency()
+dep2 = declare_dependency()
+meson.override_dependency('sub', dep1)
diff --git a/test cases/warning/3 fallback consistency/test.json b/test cases/warning/3 fallback consistency/test.json
new file mode 100644
index 0000000..60e25b4
--- /dev/null
+++ b/test cases/warning/3 fallback consistency/test.json
@@ -0,0 +1,10 @@
+{
+ "stdout": [
+ {
+ "line": "WARNING: Inconsistency: Subproject has overridden the dependency with another variable than 'dep2'"
+ }
+ ],
+ "tools": {
+ "cmake": ">=3.14"
+ }
+}
diff --git a/test cases/warning/4 fallback consistency/meson.build b/test cases/warning/4 fallback consistency/meson.build
new file mode 100644
index 0000000..013b473
--- /dev/null
+++ b/test cases/warning/4 fallback consistency/meson.build
@@ -0,0 +1,4 @@
+project('proj', 'c')
+
+# Subproject overrides 'sub' with another variable than dep2. This should warn.
+dependency('sub', fallback : ['sub', 'dep2'])
diff --git a/test cases/warning/4 fallback consistency/subprojects/sub/meson.build b/test cases/warning/4 fallback consistency/subprojects/sub/meson.build
new file mode 100644
index 0000000..12a6570
--- /dev/null
+++ b/test cases/warning/4 fallback consistency/subprojects/sub/meson.build
@@ -0,0 +1,5 @@
+project('proj', 'c')
+
+dep1 = declare_dependency()
+dep2 = declare_dependency()
+meson.override_dependency('sub', dep1)
diff --git a/test cases/warning/4 fallback consistency/test.json b/test cases/warning/4 fallback consistency/test.json
new file mode 100644
index 0000000..60e25b4
--- /dev/null
+++ b/test cases/warning/4 fallback consistency/test.json
@@ -0,0 +1,10 @@
+{
+ "stdout": [
+ {
+ "line": "WARNING: Inconsistency: Subproject has overridden the dependency with another variable than 'dep2'"
+ }
+ ],
+ "tools": {
+ "cmake": ">=3.14"
+ }
+}
diff --git a/test cases/warning/5 fallback consistency/meson.build b/test cases/warning/5 fallback consistency/meson.build
new file mode 100644
index 0000000..3af6ce8
--- /dev/null
+++ b/test cases/warning/5 fallback consistency/meson.build
@@ -0,0 +1,4 @@
+project('fallback consistency')
+
+# Subproject overrides foo with foo_dep but wrap file says it's bar_dep. This should warn.
+dependency('foo')
diff --git a/test cases/warning/5 fallback consistency/subprojects/foo.wrap b/test cases/warning/5 fallback consistency/subprojects/foo.wrap
new file mode 100644
index 0000000..28055d9
--- /dev/null
+++ b/test cases/warning/5 fallback consistency/subprojects/foo.wrap
@@ -0,0 +1,6 @@
+[wrap-file]
+source_url = http://host.invalid/foo.tar.gz
+source_filename = foo.tar.gz
+
+[provide]
+foo = bar_dep
diff --git a/test cases/warning/5 fallback consistency/subprojects/foo/meson.build b/test cases/warning/5 fallback consistency/subprojects/foo/meson.build
new file mode 100644
index 0000000..fb58a4a
--- /dev/null
+++ b/test cases/warning/5 fallback consistency/subprojects/foo/meson.build
@@ -0,0 +1,6 @@
+project('sub')
+
+foo_dep = declare_dependency()
+meson.override_dependency('foo', foo_dep)
+
+bar_dep = declare_dependency()
diff --git a/test cases/warning/5 fallback consistency/test.json b/test cases/warning/5 fallback consistency/test.json
new file mode 100644
index 0000000..8ab28d1
--- /dev/null
+++ b/test cases/warning/5 fallback consistency/test.json
@@ -0,0 +1,10 @@
+{
+ "stdout": [
+ {
+ "line": "WARNING: Inconsistency: Subproject has overridden the dependency with another variable than 'bar_dep'"
+ }
+ ],
+ "tools": {
+ "cmake": ">=3.14"
+ }
+}
diff --git a/test cases/warning/6 list add/meson.build b/test cases/warning/6 list add/meson.build
new file mode 100644
index 0000000..94b7eab
--- /dev/null
+++ b/test cases/warning/6 list add/meson.build
@@ -0,0 +1,7 @@
+project('test list add', meson_version: '>=0.59.0')
+
+l1 = [1, 2, 3]
+l2 = l1 + 4
+l2 += 5
+
+message(l2)
diff --git a/test cases/warning/6 list add/test.json b/test cases/warning/6 list add/test.json
new file mode 100644
index 0000000..e3ce8d0
--- /dev/null
+++ b/test cases/warning/6 list add/test.json
@@ -0,0 +1,7 @@
+{
+ "stdout": [
+ {
+ "line": "test cases/warning/6 list add/meson.build:4: WARNING: Project targets '>=0.59.0' but uses feature introduced in '0.60.0': list.<plus>. The right hand operand was not a list."
+ }
+ ]
+}
diff --git a/test cases/warning/7 module without unstable/meson.build b/test cases/warning/7 module without unstable/meson.build
new file mode 100644
index 0000000..409a236
--- /dev/null
+++ b/test cases/warning/7 module without unstable/meson.build
@@ -0,0 +1,3 @@
+project('module import without unstable', meson_version : '>= 0.55')
+
+import('keyval')
diff --git a/test cases/warning/7 module without unstable/test.json b/test cases/warning/7 module without unstable/test.json
new file mode 100644
index 0000000..62b8aa1
--- /dev/null
+++ b/test cases/warning/7 module without unstable/test.json
@@ -0,0 +1,7 @@
+{
+ "stdout": [
+ {
+ "line": "test cases/warning/7 module without unstable/meson.build:3: WARNING: Project targets '>= 0.55' but uses feature introduced in '0.56.0': module keyval as stable module. Consider either adding \"unstable-\" to the module name, or updating the meson required version to \">= 0.56.0\""
+ }
+ ]
+}
diff --git a/test cases/warning/8 target with no sources/meson.build b/test cases/warning/8 target with no sources/meson.build
new file mode 100644
index 0000000..2a8ee11
--- /dev/null
+++ b/test cases/warning/8 target with no sources/meson.build
@@ -0,0 +1,3 @@
+project('no sources', 'c')
+
+static_library('no sources')
diff --git a/test cases/warning/8 target with no sources/test.json b/test cases/warning/8 target with no sources/test.json
new file mode 100644
index 0000000..30e5b05
--- /dev/null
+++ b/test cases/warning/8 target with no sources/test.json
@@ -0,0 +1,7 @@
+{
+ "stdout": [
+ {
+ "line": "WARNING: Build target no sources has no sources. This was never supposed to be allowed but did because of a bug, support will be removed in a future release of Meson"
+ }
+ ]
+}