Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add file content #577

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 107 additions & 34 deletions tested/dsl/schema-strict.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}
],
"properties" : {
"files" : {
"input_files" : {
"description" : "A list of files used in the test suite.",
"type" : "array",
"items" : {
Expand Down Expand Up @@ -97,7 +97,7 @@
"tab"
],
"properties" : {
"files" : {
"input_files" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/file"
Expand Down Expand Up @@ -149,7 +149,7 @@
"unit"
],
"properties" : {
"files" : {
"input_files" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/file"
Expand Down Expand Up @@ -229,7 +229,7 @@
"testcases"
],
"properties" : {
"files" : {
"input_files" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/file"
Expand All @@ -251,7 +251,7 @@
"script"
],
"properties" : {
"files" : {
"input_files" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/file"
Expand Down Expand Up @@ -335,7 +335,7 @@
}
]
},
"files" : {
"input_files" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/file"
Expand All @@ -353,7 +353,7 @@
"description" : "Expected output at stdout",
"$ref" : "#/definitions/textOutputChannel"
},
"file": {
"output_files": {
"description" : "Expected files generated by the submission.",
"$ref" : "#/definitions/fileOutputChannel"
},
Expand Down Expand Up @@ -431,7 +431,7 @@
}
]
},
"files" : {
"input_files" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/file"
Expand All @@ -449,6 +449,10 @@
"description" : "Expected output at stdout",
"$ref" : "#/definitions/textOutputChannel"
},
"output_files": {
"description" : "Expected files generated by the submission.",
"$ref" : "#/definitions/fileOutputChannel"
},
"exit_code" : {
"type" : "integer",
"description" : "Expected exit code for the run"
Expand Down Expand Up @@ -493,14 +497,14 @@
"description" : "A file used in the test suite.",
"required" : [
"name",
"url"
"path"
],
"properties" : {
"name" : {
"type" : "string",
"description" : "The filename, including the file extension."
},
"url" : {
"path" : {
"type" : "string",
"format" : "uri",
"description" : "Relative path to the file in the `description` folder of an exercise."
Expand All @@ -515,10 +519,22 @@
{
"type" : "object",
"description" : "Built-in oracle for text values.",
"required" : [
"data"
"oneOf": [
{
"required" : [
"data"
]
},
{
"required" : [
"content"
]
}
],
"properties" : {
"content": {
"$ref" : "#/definitions/textualType"
},
"data" : {
"$ref" : "#/definitions/textualType"
},
Expand All @@ -533,12 +549,26 @@
{
"type" : "object",
"description" : "Custom oracle for text values.",
"required" : [
"oracle",
"file",
"data"
"oneOf": [
{
"required" : [
"oracle",
"file",
"data"
]
},
{
"required" : [
"oracle",
"file",
"content"
]
}
],
"properties" : {
"content": {
"$ref" : "#/definitions/textualType"
},
"data" : {
"$ref" : "#/definitions/textualType"
},
Expand Down Expand Up @@ -574,21 +604,53 @@
},
"fileOutputChannel": {
"anyOf" : [
{
"type" : "array",
"description" : "Built-in oracle for files.",
"items" : {
"type" : "object",
"required" : [
"content",
"path"
],
"properties" : {
"content" : {
"type" : "string",
"description" : "Path or expected content for the file, relative to the evaluation directory."
},
"path" : {
"type" : "string",
"description" : "Path to where the file generated by the submission should go."
}
}
}
},
{
"type" : "object",
"description" : "Built-in oracle for files.",
"required" : [
"content",
"location"
"data"
],
"properties" : {
"content" : {
"type" : "string",
"description" : "Path to the file containing the expected contents, relative to the evaluation directory."
},
"location" : {
"type" : "string",
"description" : "Path to where the file generated by the submission should go."
"data": {
"type": "array",
"items" : {
"type" : "object",
"required" : [
"content",
"path"
],
"properties" : {
"content" : {
"type" : "string",
"description" : "Path or expected content for the file, relative to the evaluation directory."
},
"path" : {
"type" : "string",
"description" : "Path to where the file generated by the submission should go."
}
}
}
},
"oracle" : {
"const" : "builtin"
Expand All @@ -603,21 +665,32 @@
"description" : "Custom oracle for file values.",
"required" : [
"oracle",
"content",
"location",
"data",
"file"
],
"properties" : {
"oracle" : {
"const" : "custom_check"
},
"content" : {
"type" : "string",
"description" : "Path to the file containing the expected contents, relative to the evaluation directory."
},
"location" : {
"type" : "string",
"description" : "Path to where the file generated by the submission should go."
"data": {
"type": "array",
"items" : {
"type" : "object",
"required" : [
"content",
"path"
],
"properties" : {
"content" : {
"type" : "string",
"description" : "Path or expected content for the file, relative to the evaluation directory."
},
"path" : {
"type" : "string",
"description" : "Path to where the file generated by the submission should go."
}
}
}
},
"file" : {
"type" : "string",
Expand Down
Loading
Loading