mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-06 08:04:55 +00:00
config_tools: add SyntacticValidationStage before save scenario
add SyntacticValidationStage before save scenario Tracked-On: #6691 Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
This commit is contained in:
@@ -12,13 +12,11 @@ from scenario_config.xml_loader import XMLLoadStage
|
||||
|
||||
from .pyodide import (
|
||||
convert_result, write_temp_file,
|
||||
# Todo: add debug switch
|
||||
# is_debug,
|
||||
nuc11_board, nuc11_scenario, scenario_xml_schema_path, datachecks_xml_schema_path
|
||||
)
|
||||
|
||||
|
||||
def main(board, scenario):
|
||||
def main(board, scenario, completed_verify=False):
|
||||
pipeline = PipelineEngine(["board_path", "scenario_path", "schema_path", "datachecks_path"])
|
||||
stages = [
|
||||
ValidatorConstructionByFileStage(),
|
||||
@@ -27,11 +25,10 @@ def main(board, scenario):
|
||||
XMLLoadStage("board"),
|
||||
XMLLoadStage("scenario"),
|
||||
DefaultValuePopulatingStage(),
|
||||
SemanticValidationStage(),
|
||||
SyntacticValidationStage()
|
||||
]
|
||||
#
|
||||
# if is_debug:
|
||||
# stages.append(SyntacticValidationStage())
|
||||
if completed_verify:
|
||||
stages.append(SemanticValidationStage())
|
||||
|
||||
pipeline.add_stages(stages)
|
||||
with TemporaryDirectory() as tmpdir:
|
||||
@@ -50,7 +47,9 @@ def main(board, scenario):
|
||||
)
|
||||
pipeline.run(obj)
|
||||
|
||||
validate_result = obj.get("semantic_errors")
|
||||
validate_result: list = obj.get("syntactic_errors")
|
||||
if completed_verify:
|
||||
validate_result.extend(obj.get("semantic_errors"))
|
||||
return convert_result(validate_result)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user