Add expected stdout for failing-meson and warning-meson tests

Initially produced using:

  for d in "test cases/failing/"* ; do rm -r _build ; ./meson.py setup "$d" _build | grep ERROR >"$d"/expected_stdout.txt; done

then converted to json with jq using:

  jq --raw-input --slurp 'split("\n") | {stdout: map({line: select(. != "")})}' expected_stdout.txt >test.json

or merged with existing json using:

  jq --slurp '.[0] + .[1]' test.json expected.json >test.json.new

v2:
Add some comments to explain the match when it isn't totally obvious

v3:
Add or adjust existing re: in expected output to handle '/' or '\' path
separators appearing in message, not location.

v4:
Put expected stdout in test.json, rather than a separate expected_stdout.txt file
Park comments in an unused 'comments' key, as JSON doesn't have a syntax for comments
This commit is contained in:
Jon Turney 2020-02-12 00:31:57 +00:00
parent f867bfbce0
commit 3cff11a75b
No known key found for this signature in database
GPG Key ID: C7C86F0370285C81
97 changed files with 722 additions and 10 deletions

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "ERROR: First statement must be a call to project"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/10 out of bounds/meson.build:4:0: ERROR: Index 0 out of bounds of array of size 0."
}
]
}

View File

@ -0,0 +1,8 @@
{
"stdout": [
{
"match": "re",
"line": "test cases/failing/11 object arithmetic/meson\\.build:3:0: ERROR: Invalid use of addition: .*"
}
]
}

View File

@ -0,0 +1,8 @@
{
"stdout": [
{
"match": "re",
"line": "test cases/failing/12 string arithmetic/meson\\.build:3:0: ERROR: Invalid use of addition: .*"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/13 array arithmetic/meson.build:3:0: ERROR: Multiplication works only with integers."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/14 invalid option name/meson_options.txt:1:0: ERROR: Option names can only contain letters, numbers or dashes."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/15 kwarg before arg/meson.build:3:0: ERROR: All keyword arguments must be after positional arguments."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/16 extract from subproject/meson.build:6:0: ERROR: Tried to extract objects from a subproject target."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/17 same target/meson.build:4:0: ERROR: Tried to create target \"foo\", but a target of that name already exists."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/18 wrong plusassign/meson.build:3:0: ERROR: Plusassignment target must be an id."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "ERROR: Multiple producers for Ninja target \"clash\". Please rename your targets."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/2 missing file/meson.build:3:0: ERROR: File missing.c does not exist."
}
]
}

View File

@ -0,0 +1,8 @@
{
"stdout": [
{
"match": "re",
"line": "test cases/failing/20 version/meson\\.build:1:0: ERROR: Meson version is .* but project requires >100\\.0\\.0"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/21 subver/meson.build:3:0: ERROR: Subproject foo version is 1.0.0 but >1.0.0 required."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/22 assert/meson.build:3:0: ERROR: Assert failed: I am fail."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/23 rel testdir/meson.build:4:0: ERROR: Workdir keyword argument must be an absolute path."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/24 int conversion/meson.build:3:13: ERROR: String 'notanumber' cannot be converted to int"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/25 badlang/meson.build:3:0: ERROR: Tried to use unknown language \"nonexisting\"."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/26 output subdir/meson.build:3:0: ERROR: Output file name must not contain a subdirectory."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/27 noprog use/meson.build:5:0: ERROR: Tried to use not-found external program in \"command\""
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/28 no crossprop/meson.build:3:0: ERROR: Unknown cross property: nonexisting."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/29 nested ternary/meson.build:3:12: ERROR: Nested ternary operators are not allowed."
}
]
}

View File

@ -0,0 +1,9 @@
{
"stdout": [
{
"comment": "'missing/meson.build' gets transformed with os.path.sep separators",
"match": "re",
"line": "test cases/failing/3 missing subdir/meson\\.build:3:0: ERROR: Non\\-existent build file 'missing[\\\\/]meson\\.build'"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/30 invalid man extension/meson.build:2:0: ERROR: Man file must have a file extension of a number between 1 and 8"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/31 no man extension/meson.build:2:0: ERROR: Man file must have a file extension of a number between 1 and 8"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/32 exe static shared/meson.build:9:0: ERROR: Can't link non-PIC static library 'stat' into shared library 'shr2'. Use the 'pic' option to static_library to build with PIC."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/33 non-root subproject/some/meson.build:1:0: ERROR: Subproject directory not found and someproj.wrap file not found"
}
]
}

View File

@ -0,0 +1,8 @@
{
"stdout": [
{
"match": "re",
"line": "test cases/failing/34 dependency not\\-required then required/meson\\.build:4:0: ERROR: Dependency \"foo\\-bar\\-xyz\\-12\\.3\" not found, tried .*"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/35 project argument after target/meson.build:7:0: ERROR: Tried to use 'add_project_arguments' after a build target has been declared."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/37 has function external dependency/meson.build:8:3: ERROR: Dependencies must be external dependencies"
}
]
}

View File

@ -1,3 +1,10 @@
{
"do_not_set_opts": ["libdir"]
"do_not_set_opts": [
"libdir"
],
"stdout": [
{
"line": "test cases/failing/38 libdir must be inside prefix/meson.build:1:0: ERROR: The value of the 'libdir' option is '/opt/lib' which must be a subdir of the prefix '/usr'."
}
]
}

View File

@ -1,3 +1,11 @@
{
"do_not_set_opts": ["prefix"]
"do_not_set_opts": [
"prefix"
],
"stdout": [
{
"comment": "literal 'some/path/notabs' appears in output, irrespective of os.path.sep, as that's the prefix",
"line": "test cases/failing/39 prefix absolute/meson.build:1:0: ERROR: prefix value 'some/path/notabs' must be an absolute path"
}
]
}

View File

@ -0,0 +1,9 @@
{
"stdout": [
{
"match": "re",
"comment": "'subdir/meson.build' gets transformed with os.path.sep separators",
"line": "test cases/failing/4 missing meson\\.build/meson\\.build:3:0: ERROR: Non\\-existent build file 'subdir[\\\\/]meson\\.build'"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/40 kwarg assign/meson.build:3:0: ERROR: Tried to assign values inside an argument list."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/41 custom target plainname many inputs/meson.build:5:0: ERROR: Output cannot contain @PLAINNAME@ or @BASENAME@ when there is more than one input (we can't know which to use)"
}
]
}

View File

@ -1,10 +1,33 @@
{
"installed": [
{"type": "file", "file": "usr/include/diff.h"},
{"type": "file", "file": "usr/include/first.h"},
{"type": "file", "file": "usr/bin/diff.sh"},
{"type": "file", "file": "usr/bin/second.sh"},
{"type": "file", "file": "opt/same.h"},
{"type": "file", "file": "opt/same.sh"}
{
"type": "file",
"file": "usr/include/diff.h"
},
{
"type": "file",
"file": "usr/include/first.h"
},
{
"type": "file",
"file": "usr/bin/diff.sh"
},
{
"type": "file",
"file": "usr/bin/second.sh"
},
{
"type": "file",
"file": "opt/same.h"
},
{
"type": "file",
"file": "opt/same.sh"
}
],
"stdout": [
{
"line": "ERROR: Target 'too-few-install-dirs' has 3 outputs: ['toofew.h', 'toofew.c', 'toofew.sh'], but only 2 \"install_dir\"s were found."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/43 project name colon/meson.build:1:0: ERROR: Project name 'name with :' must not contain ':'"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/44 abs subdir/meson.build:5:0: ERROR: Subdir argument must be a relative path."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/45 abspath to srcdir/meson.build:3:0: ERROR: Tried to form an absolute path to a source dir. You should not do that but use relative paths instead."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/46 pkgconfig variables reserved/meson.build:8:5: ERROR: Variable \"prefix\" is reserved"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/47 pkgconfig variables zero length/meson.build:8:5: ERROR: Invalid variable \"=value\". Variables must be in 'name=value' format"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/48 pkgconfig variables zero length value/meson.build:8:5: ERROR: Invalid variable \"key=\". Variables must be in 'name=value' format"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/49 pkgconfig variables not key value/meson.build:8:5: ERROR: Invalid variable \"this_should_be_key_value\". Variables must be in 'name=value' format"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/5 misplaced option/meson.build:3:0: ERROR: Tried to call option() in build description file. All options must be in the option file."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/50 executable comparison/meson.build:6:0: ERROR: exe1 can only be compared for equality."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/51 inconsistent comparison/meson.build:5:0: ERROR: Values of different types (list, str) cannot be compared using <."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/52 slashname/meson.build:11:0: ERROR: Problem encountered: Re-enable me once slash in name is finally prohibited."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/53 reserved meson prefix/meson.build:3:0: ERROR: The \"meson-\" prefix is reserved and cannot be used for top-level subdir()."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/54 wrong shared crate type/meson.build:7:0: ERROR: Crate type \"staticlib\" invalid for dynamic libraries; must be \"dylib\" or \"cdylib\""
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/55 wrong static crate type/meson.build:7:0: ERROR: Crate type \"cdylib\" invalid for static libraries; must be \"rlib\" or \"staticlib\""
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/56 or on new line/meson.build:4:8: ERROR: Invalid or clause."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/57 kwarg in module/meson.build:3:0: ERROR: Function does not take keyword arguments."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/58 link with executable/meson.build:4:0: ERROR: Link target 'prog' is not linkable."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/59 assign custom target index/meson.build:24:0: ERROR: Assignment target must be an id."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/6 missing incdir/meson.build:3:0: ERROR: Include dir nosuchdir does not exist."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/60 getoption prefix/meson.build:5:0: ERROR: Having a colon in option name is forbidden, projects are not allowed to directly access options of other subprojects."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/61 bad option argument/meson_options.txt:1:0: ERROR: Invalid kwargs for option \"name\": \"vaule\""
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/62 subproj filegrab/subprojects/a/meson.build:3:0: ERROR: Sandbox violation: Tried to grab file prog.c from a different subproject."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/63 grab subproj/meson.build:7:0: ERROR: Sandbox violation: Tried to grab file sub.c from a different subproject."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/64 grab sibling/subprojects/a/meson.build:3:0: ERROR: Sandbox violation: Tried to grab file sneaky.c from a different subproject."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/65 string as link target/meson.build:2:0: ERROR: '' is not a target."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/66 dependency not-found and required/meson.build:2:0: ERROR: Dependency is both required and not-found"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/68 wrong boost module/meson.build:9:0: ERROR: Dependency \"boost\" not found"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/69 install_data rename bad size/meson.build:3:0: ERROR: Size of rename argument is different from number of sources"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/7 go to subproject/meson.build:3:0: ERROR: Must not go into subprojects dir with subdir(), use subproject() instead."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/70 skip only subdir/meson.build:8:0: ERROR: File main.cpp does not exist."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/71 dual override/meson.build:5:6: ERROR: Tried to override executable \"override\" which has already been overridden."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/72 override used/meson.build:5:6: ERROR: Tried to override finding of executable \"something.py\" which has already been found."
}
]
}

View File

@ -0,0 +1,8 @@
{
"stdout": [
{
"match": "re",
"line": "test cases/failing/73 run_command unclean exit/meson\\.build:4:0: ERROR: Command \".*[\\\\/]test cases[\\\\/]failing[\\\\/]73 run_command unclean exit[\\\\/]\\.[\\\\/]returncode\\.py 1\" failed with status 1\\."
}
]
}

View File

@ -0,0 +1,8 @@
{
"stdout": [
{
"comment": "this error message is not very informative",
"line": "test cases/failing/74 int literal leading zero/meson.build:5:13: ERROR: Expecting eof got number."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/75 configuration immutable/meson.build:12:16: ERROR: Can not set values on configuration object that has been used."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/76 link with shared module on osx/meson.build:8:0: ERROR: target links against shared modules."
}
]
}

View File

@ -0,0 +1,8 @@
{
"stdout": [
{
"match": "re",
"line": "test cases/failing/77 non ascii in ascii encoded configure file/meson\\.build:5:0: ERROR: Could not write output file .*[\\\\/]config9\\.h: 'ascii' codec can't encode character '\\\\u0434' in position 17: ordinal not in range\\(128\\)"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/78 subproj dependency not-found and required/meson.build:2:0: ERROR: Subproject directory not found and missing.wrap file not found"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/79 unfound run/meson.build:4:0: ERROR: Tried to use non-existing executable 'nonexisting_prog'"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/8 recursive/subprojects/b/meson.build:3:0: ERROR: Recursive include of subprojects: a => b => a."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/80 framework dependency with version/meson.build:8:0: ERROR: Unknown version of dependency 'appleframeworks', but need ['>0']."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/81 override exe config/meson.build:6:0: ERROR: Program 'bar' was overridden with the compiled executable 'foo' and therefore cannot be used during configuration"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/82 gl dependency with version/meson.build:9:0: ERROR: Unknown version of dependency 'gl', but need ['>0']."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/83 threads dependency with version/meson.build:3:0: ERROR: Unknown version of dependency 'threads', but need ['>0']."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/85 dub libray/meson.build:11:0: ERROR: Dependency \"dubtestproject\" not found"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/86 dub executable/meson.build:11:0: ERROR: Dependency \"dubtestproject:test1\" not found"
}
]
}

View File

@ -2,8 +2,18 @@
"matrix": {
"options": {
"warning_level": [
{ "val": "1", "skip_on_env": [ "SINGLE_DUB_COMPILER" ] }
{
"val": "1",
"skip_on_env": [
"SINGLE_DUB_COMPILER"
]
}
]
}
}
},
"stdout": [
{
"line": "test cases/failing/87 dub compiler/meson.build:17:0: ERROR: Dependency \"dubtestproject:test2\" not found"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/88 subproj not-found dep/meson.build:2:0: ERROR: Could not find dependency notfound_dep in subproject somesubproj"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/89 invalid configure file/meson.build:3:0: ERROR: \"install_dir\" must be specified when \"install\" in a configure_file is true"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/9 missing extra file/meson.build:3:0: ERROR: File missing.txt does not exist."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/90 kwarg dupe/meson.build:5:0: ERROR: Entry \"install\" defined both as a keyword argument and in a \"kwarg\" entry."
}
]
}

View File

@ -0,0 +1,8 @@
{
"stdout": [
{
"comment": "literal 'pch/prog.h' from meson.build appears in output, irrespective of os.path.sep",
"line": "test cases/failing/91 missing pch file/meson.build:2:0: ERROR: File pch/prog.h does not exist."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/92 pch source different folder/meson.build:4:0: ERROR: PCH files must be stored in the same folder."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/93 vala without c/meson.build:2:0: ERROR: Compiling Vala requires C. Add C to your project languages and rerun Meson."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/94 unknown config tool/meson.build:2:0: ERROR: Dependency \"no-such-config-tool\" not found"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/95 custom target install data/meson.build:11:0: ERROR: Argument must be string or file."
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/96 add dict non string key/meson.build:9:0: ERROR: Key must be a string"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/97 add dict duplicate keys/meson.build:9:0: ERROR: Duplicate dictionary key: myKey"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/99 no native prop/meson.build:3:0: ERROR: Unknown native property: nonexisting."
}
]
}

View File

@ -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"
}
]
}

View File

@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/warning/2 languages missing native/meson.build:2: WARNING: add_languages is missing native:, assuming languages are wanted for both host and build."
}
]
}