aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-03-20 13:22:43 -0700
committerDylan Baker <dylan@pnwbakers.com>2020-04-17 10:49:09 -0700
commite0c9259e79f21c6ee19f996c1f5d817d510de663 (patch)
tree22cd773b3b0ec7635ce1dfdf31ddbb93d5047fb3 /data
parent91050e0c7c4920d9e793e0b911f8f3255b4d0e3e (diff)
downloadmeson-e0c9259e79f21c6ee19f996c1f5d817d510de663.zip
meson-e0c9259e79f21c6ee19f996c1f5d817d510de663.tar.gz
meson-e0c9259e79f21c6ee19f996c1f5d817d510de663.tar.bz2
Add a json schema for the test.json used in tests
This does a couple of nice things, one is that editors like vscode can be configured to use this schema to provide auto completion and error highlighting if invalid values are added or required values are missing. It also allows us test that the format of the test matrix work in a unit test, which I've added. It does require that the python jsonschema package is installed.
Diffstat (limited to 'data')
-rw-r--r--data/test.schema.json105
1 files changed, 105 insertions, 0 deletions
diff --git a/data/test.schema.json b/data/test.schema.json
new file mode 100644
index 0000000..72f160f
--- /dev/null
+++ b/data/test.schema.json
@@ -0,0 +1,105 @@
+{
+ "type": "object",
+ "properties": {
+ "env": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "installed": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "file": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "file",
+ "exe",
+ "shared_lib",
+ "pdb",
+ "implib",
+ "implibempty",
+ "expr"
+ ]
+ },
+ "platform": {
+ "type": "string",
+ "enum": [
+ "msvc",
+ "gcc",
+ "cygwin",
+ "!cygwin"
+ ]
+ },
+ "version": {
+ "type": "string"
+ },
+ "language": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "file",
+ "type"
+ ]
+ }
+ },
+ "matrix": {
+ "type": "object",
+ "additionalProperties": {
+ "properties": {
+ "options": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "val": {
+ "type": "string"
+ },
+ "compilers": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "skip_on_env": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "val"
+ ]
+ }
+ },
+ "exclude": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "do_not_set_opts": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "libdir",
+ "prefix"
+ ]
+ }
+ }
+ }
+}