diff options
Diffstat (limited to 'meson/test cases/warning')
15 files changed, 82 insertions, 0 deletions
diff --git a/meson/test cases/warning/1 version for string div/a/b.c b/meson/test cases/warning/1 version for string div/a/b.c new file mode 100644 index 000000000..74de8a8e3 --- /dev/null +++ b/meson/test cases/warning/1 version for string div/a/b.c @@ -0,0 +1,3 @@ +int main(void) +{ +} diff --git a/meson/test cases/warning/1 version for string div/meson.build b/meson/test cases/warning/1 version for string div/meson.build new file mode 100644 index 000000000..54e97088b --- /dev/null +++ b/meson/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/meson/test cases/warning/1 version for string div/test.json b/meson/test cases/warning/1 version for string div/test.json new file mode 100644 index 000000000..c37931a92 --- /dev/null +++ b/meson/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": "WARNING: Project targeting '>=0.48.0' but tried to use feature introduced in '0.49.0': / with string arguments." + } + ] +} diff --git a/meson/test cases/warning/2 languages missing native/meson.build b/meson/test cases/warning/2 languages missing native/meson.build new file mode 100644 index 000000000..e2047152b --- /dev/null +++ b/meson/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/meson/test cases/warning/2 languages missing native/test.json b/meson/test cases/warning/2 languages missing native/test.json new file mode 100644 index 000000000..f929654d8 --- /dev/null +++ b/meson/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/meson/test cases/warning/3 fallback consistency/meson.build b/meson/test cases/warning/3 fallback consistency/meson.build new file mode 100644 index 000000000..ad2b22604 --- /dev/null +++ b/meson/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/meson/test cases/warning/3 fallback consistency/subprojects/sub/meson.build b/meson/test cases/warning/3 fallback consistency/subprojects/sub/meson.build new file mode 100644 index 000000000..12a6570df --- /dev/null +++ b/meson/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/meson/test cases/warning/3 fallback consistency/test.json b/meson/test cases/warning/3 fallback consistency/test.json new file mode 100644 index 000000000..ee4f1f214 --- /dev/null +++ b/meson/test cases/warning/3 fallback consistency/test.json @@ -0,0 +1,7 @@ +{ + "stdout": [ + { + "line": "WARNING: Inconsistency: Subproject has overridden the dependency with another variable than 'dep2'" + } + ] +} diff --git a/meson/test cases/warning/4 fallback consistency/meson.build b/meson/test cases/warning/4 fallback consistency/meson.build new file mode 100644 index 000000000..013b473e5 --- /dev/null +++ b/meson/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/meson/test cases/warning/4 fallback consistency/subprojects/sub/meson.build b/meson/test cases/warning/4 fallback consistency/subprojects/sub/meson.build new file mode 100644 index 000000000..12a6570df --- /dev/null +++ b/meson/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/meson/test cases/warning/4 fallback consistency/test.json b/meson/test cases/warning/4 fallback consistency/test.json new file mode 100644 index 000000000..ee4f1f214 --- /dev/null +++ b/meson/test cases/warning/4 fallback consistency/test.json @@ -0,0 +1,7 @@ +{ + "stdout": [ + { + "line": "WARNING: Inconsistency: Subproject has overridden the dependency with another variable than 'dep2'" + } + ] +} diff --git a/meson/test cases/warning/5 fallback consistency/meson.build b/meson/test cases/warning/5 fallback consistency/meson.build new file mode 100644 index 000000000..3af6ce888 --- /dev/null +++ b/meson/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/meson/test cases/warning/5 fallback consistency/subprojects/foo.wrap b/meson/test cases/warning/5 fallback consistency/subprojects/foo.wrap new file mode 100644 index 000000000..28055d958 --- /dev/null +++ b/meson/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/meson/test cases/warning/5 fallback consistency/subprojects/foo/meson.build b/meson/test cases/warning/5 fallback consistency/subprojects/foo/meson.build new file mode 100644 index 000000000..fb58a4ab3 --- /dev/null +++ b/meson/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/meson/test cases/warning/5 fallback consistency/test.json b/meson/test cases/warning/5 fallback consistency/test.json new file mode 100644 index 000000000..c254aaf08 --- /dev/null +++ b/meson/test cases/warning/5 fallback consistency/test.json @@ -0,0 +1,7 @@ +{ + "stdout": [ + { + "line": "WARNING: Inconsistency: Subproject has overridden the dependency with another variable than 'bar_dep'" + } + ] +} |