Before this PR some testing function were based on file equality:
A test executes a command -> the command generates a file -> the generated file is checked to be 1 to 1 equal to a reference file provided
This makes the testing less general, as everytime the result xsd schema is updated, all the reference files needs to be updated as well
The PR replace those 4 tests with checking that the generated file follows the xsd schema defined here in doc/schema folder
To do so:
an xml validation helper class is defined,
the doc/schema/xqar_report_format.xsd is copied in test folder at build time
the new checks are executed
Moreover the new testing approach will be based on testing the properties of the output file. The first test of this approach is already included in the PR in the cTesterExampleCheckerBundle, CmdConfigContainsIssue test. This checks if the result file contains the Issue tag
How was the PR tested?
Build and ran all tests, worked as expected. 4 Tests failing
Notes
Adding the xsd checks makes 4 tests failing
3 of the fails for the same reason, when performing xsd check it is raised
Error: element 'Issue' is not allowed for content model '(Locations+)'
This is because the generated xml do not specify the Locations attribute which is required in current xsd as it is specified with minOccurs="1"
The 4 test fails for the same reason but on a different tag
Error: element 'CheckerResults' is not allowed for content model '(CheckerBundle+)'
Description
Before this PR some testing function were based on file equality: A test executes a command -> the command generates a file -> the generated file is checked to be 1 to 1 equal to a reference file provided
This makes the testing less general, as everytime the result xsd schema is updated, all the reference files needs to be updated as well
The PR replace those 4 tests with checking that the generated file follows the xsd schema defined here in doc/schema folder
To do so:
Moreover the new testing approach will be based on testing the properties of the output file. The first test of this approach is already included in the PR in the
cTesterExampleCheckerBundle, CmdConfigContainsIssue
test. This checks if the result file contains the Issue tagHow was the PR tested?
Notes
Adding the xsd checks makes 4 tests failing
3 of the fails for the same reason, when performing xsd check it is raised
This is because the generated xml do not specify the Locations attribute which is required in current xsd as it is specified with
minOccurs="1"
The 4 test fails for the same reason but on a different tag
Since the result XML is
but CheckerBundle inside CheckerResults has minOccurs=1 as well