From 32bb7d9340252b428af43c506a715082cd94c857 Mon Sep 17 00:00:00 2001 From: breblanc Date: Sat, 1 Feb 2025 17:51:13 +0100 Subject: [PATCH] Made inlining for stdout and stderr possible and made everything more consitent --- tested/dsl/schema-strict.json | 19 ++++++------------- tested/dsl/schema.json | 19 ++++++------------- tested/dsl/translate_parser.py | 20 +++++++++++++++++--- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/tested/dsl/schema-strict.json b/tested/dsl/schema-strict.json index 53049ac8..fdc48254 100644 --- a/tested/dsl/schema-strict.json +++ b/tested/dsl/schema-strict.json @@ -527,14 +527,13 @@ }, { "required" : [ - "path" + "content" ] } ], "properties" : { - "path": { - "type" : "string", - "description" : "The path to the file containing the text value." + "content": { + "$ref" : "#/definitions/textualType" }, "data" : { "$ref" : "#/definitions/textualType" @@ -562,19 +561,13 @@ "required" : [ "oracle", "file", - "path" + "content" ] } ], - "required" : [ - "oracle", - "file", - "data" - ], "properties" : { - "path": { - "type" : "string", - "description" : "The path to the file containing the text value." + "content": { + "$ref" : "#/definitions/textualType" }, "data" : { "$ref" : "#/definitions/textualType" diff --git a/tested/dsl/schema.json b/tested/dsl/schema.json index eee3bbf4..02fbaff8 100644 --- a/tested/dsl/schema.json +++ b/tested/dsl/schema.json @@ -527,14 +527,13 @@ }, { "required" : [ - "path" + "content" ] } ], "properties" : { - "path": { - "type" : "string", - "description" : "The path to the file containing the text value." + "content": { + "$ref" : "#/definitions/textualType" }, "data" : { "$ref" : "#/definitions/textualType" @@ -562,19 +561,13 @@ "required" : [ "oracle", "file", - "path" + "content" ] } ], - "required" : [ - "oracle", - "file", - "data" - ], "properties" : { - "path": { - "type" : "string", - "description" : "The path to the file containing the text value." + "content": { + "$ref" : "#/definitions/textualType" }, "data" : { "$ref" : "#/definitions/textualType" diff --git a/tested/dsl/translate_parser.py b/tested/dsl/translate_parser.py index af147075..7c970ec1 100644 --- a/tested/dsl/translate_parser.py +++ b/tested/dsl/translate_parser.py @@ -461,12 +461,18 @@ def _convert_text_output_channel( if isinstance(stream, str): config = context.config.get(config_name, dict()) + if isinstance(stream, PathString): + path = stream raw_data = stream else: assert isinstance(stream, dict) - if (path := stream.get("path")) is not None: + data = stream.get("content", stream.get("data")) + assert data is not None + + if isinstance(data, PathString): + path = data config = context.config.get(config_name, dict()) - raw_data = str(path) + raw_data = data else: config = context.merge_inheritable_with_specific_config(stream, config_name) raw_data = str(stream["data"]) @@ -478,7 +484,15 @@ def _convert_text_output_channel( data = raw_data if isinstance(stream, str): - return TextOutputChannel(data=data, oracle=GenericTextOracle(options=config)) + if path is not None: + return TextOutputChannel( + data=data, + oracle=GenericTextOracle(options=config), + type=TextChannelType.FILE, + ) + return TextOutputChannel( + data=data, oracle=GenericTextOracle(options=config) + ) else: assert isinstance(stream, dict) if "oracle" not in stream or stream["oracle"] == "builtin":