From 99a26c503afe9a29c225d7976b075b2607ed837c Mon Sep 17 00:00:00 2001 From: breblanc Date: Sat, 11 Jan 2025 19:45:18 +0100 Subject: [PATCH] changed some names --- tested/dsl/schema-strict.json | 32 ++++++++++++++++++-------------- tested/dsl/schema.json | 32 ++++++++++++++++++-------------- tested/dsl/translate_parser.py | 18 +++++++++--------- 3 files changed, 45 insertions(+), 37 deletions(-) diff --git a/tested/dsl/schema-strict.json b/tested/dsl/schema-strict.json index 8ec453be..8ab5f251 100644 --- a/tested/dsl/schema-strict.json +++ b/tested/dsl/schema-strict.json @@ -39,7 +39,7 @@ } ], "properties" : { - "files" : { + "in_files" : { "description" : "A list of files used in the test suite.", "type" : "array", "items" : { @@ -97,7 +97,7 @@ "tab" ], "properties" : { - "files" : { + "in_files" : { "type" : "array", "items" : { "$ref" : "#/definitions/file" @@ -149,7 +149,7 @@ "unit" ], "properties" : { - "files" : { + "in_files" : { "type" : "array", "items" : { "$ref" : "#/definitions/file" @@ -229,7 +229,7 @@ "testcases" ], "properties" : { - "files" : { + "in_files" : { "type" : "array", "items" : { "$ref" : "#/definitions/file" @@ -251,7 +251,7 @@ "script" ], "properties" : { - "files" : { + "in_files" : { "type" : "array", "items" : { "$ref" : "#/definitions/file" @@ -335,7 +335,7 @@ } ] }, - "files" : { + "in_files" : { "type" : "array", "items" : { "$ref" : "#/definitions/file" @@ -353,7 +353,7 @@ "description" : "Expected output at stdout", "$ref" : "#/definitions/textOutputChannel" }, - "file": { + "out_files": { "description" : "Expected files generated by the submission.", "$ref" : "#/definitions/fileOutputChannel" }, @@ -431,7 +431,7 @@ } ] }, - "files" : { + "in_files" : { "type" : "array", "items" : { "$ref" : "#/definitions/file" @@ -449,6 +449,10 @@ "description" : "Expected output at stdout", "$ref" : "#/definitions/textOutputChannel" }, + "out_files": { + "description" : "Expected files generated by the submission.", + "$ref" : "#/definitions/fileOutputChannel" + }, "exit_code" : { "type" : "integer", "description" : "Expected exit code for the run" @@ -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." @@ -578,15 +582,15 @@ "type" : "object", "description" : "Built-in oracle for files.", "required" : [ - "content", - "location" + "path_expected", + "path_generated" ], "properties" : { - "content" : { + "path_expected" : { "type" : "string", "description" : "Path to the file containing the expected contents, relative to the evaluation directory." }, - "location" : { + "path_generated" : { "type" : "string", "description" : "Path to where the file generated by the submission should go." }, diff --git a/tested/dsl/schema.json b/tested/dsl/schema.json index 92478b6a..665c447c 100644 --- a/tested/dsl/schema.json +++ b/tested/dsl/schema.json @@ -39,7 +39,7 @@ } ], "properties" : { - "files" : { + "in_files" : { "description" : "A list of files used in the test suite.", "type" : "array", "items" : { @@ -97,7 +97,7 @@ "tab" ], "properties" : { - "files" : { + "in_files" : { "type" : "array", "items" : { "$ref" : "#/definitions/file" @@ -149,7 +149,7 @@ "unit" ], "properties" : { - "files" : { + "in_files" : { "type" : "array", "items" : { "$ref" : "#/definitions/file" @@ -229,7 +229,7 @@ "testcases" ], "properties" : { - "files" : { + "in_files" : { "type" : "array", "items" : { "$ref" : "#/definitions/file" @@ -251,7 +251,7 @@ "script" ], "properties" : { - "files" : { + "in_files" : { "type" : "array", "items" : { "$ref" : "#/definitions/file" @@ -335,7 +335,7 @@ } ] }, - "files" : { + "in_files" : { "type" : "array", "items" : { "$ref" : "#/definitions/file" @@ -353,6 +353,10 @@ "description" : "Expected output at stdout", "$ref" : "#/definitions/textOutputChannel" }, + "out_files": { + "description" : "Expected files generated by the submission.", + "$ref" : "#/definitions/fileOutputChannel" + }, "exit_code" : { "type" : "integer", "description" : "Expected exit code for the run" @@ -427,7 +431,7 @@ } ] }, - "files" : { + "in_files" : { "type" : "array", "items" : { "$ref" : "#/definitions/file" @@ -445,7 +449,7 @@ "description" : "Expected output at stdout", "$ref" : "#/definitions/textOutputChannel" }, - "file": { + "out_files": { "description" : "Expected files generated by the submission.", "$ref" : "#/definitions/fileOutputChannel" }, @@ -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." @@ -578,15 +582,15 @@ "type" : "object", "description" : "Built-in oracle for files.", "required" : [ - "content", - "location" + "path_expected", + "path_generated" ], "properties" : { - "content" : { + "path_expected" : { "type" : "string", "description" : "Path to the file containing the expected contents, relative to the evaluation directory." }, - "location" : { + "path_generated" : { "type" : "string", "description" : "Path to where the file generated by the submission should go." }, diff --git a/tested/dsl/translate_parser.py b/tested/dsl/translate_parser.py index 0aa48574..4c5b78f4 100644 --- a/tested/dsl/translate_parser.py +++ b/tested/dsl/translate_parser.py @@ -254,9 +254,9 @@ def deepen_context(self, new_level: YamlDict | None) -> "DslContext": return self the_files = self.files - if "files" in new_level: - assert isinstance(new_level["files"], list) - additional_files = {_convert_file(f) for f in new_level["files"]} + if "in_files" in new_level: + assert isinstance(new_level["in_files"], list) + additional_files = {_convert_file(f) for f in new_level["in_files"]} the_files = list(set(self.files) | additional_files) the_config = self.config @@ -395,8 +395,8 @@ def _convert_value(value: YamlObject) -> Value: def _convert_file(link_file: YamlDict) -> FileUrl: assert isinstance(link_file["name"], str) - assert isinstance(link_file["url"], str) - return FileUrl(name=link_file["name"], url=link_file["url"]) + assert isinstance(link_file["path"], str) + return FileUrl(name=link_file["name"], url=link_file["path"]) def _convert_evaluation_function(stream: dict) -> EvaluationFunction: @@ -479,8 +479,8 @@ def _convert_file_output_channel( ) -> FileOutputChannel: assert isinstance(stream, dict) - expected = str(stream["content"]) - actual = str(stream["location"]) + expected = str(stream["path_expected"]) + actual = str(stream["path_generated"]) if "oracle" not in stream or stream["oracle"] == "builtin": config = context.merge_inheritable_with_specific_config(stream, config_name) @@ -606,8 +606,8 @@ def _convert_testcase(testcase: YamlDict, context: DslContext) -> Testcase: if (stdout := testcase.get("stdout")) is not None: output.stdout = _convert_text_output_channel(stdout, context, "stdout") - if (file := testcase.get("file")) is not None: - output.file = _convert_file_output_channel(file, context, "file") + if (file := testcase.get("out_files")) is not None: + output.file = _convert_file_output_channel(file, context, "out_files") if (stderr := testcase.get("stderr")) is not None: output.stderr = _convert_text_output_channel(stderr, context, "stderr") if (exception := testcase.get("exception")) is not None: