olabusayoT commented on code in PR #1204:
URL: https://github.com/apache/daffodil/pull/1204#discussion_r1754963380
##########
daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala:
##########
@@ -959,32 +988,49 @@ abstract class TestCase(testCaseXML: NodeSeq, val parent:
DFDLTestSuite) {
protected def checkDiagnosticMessages(
diagnostics: Seq[Diagnostic],
- errors: ExpectedErrors,
- optWarnings: Option[ExpectedWarnings],
- implString: Option[String]
- ): Unit = {
- Assert.usage(this.isNegativeTest)
+ errors: Seq[ExpectedErrors],
+ optWarnings: Option[Seq[ExpectedWarnings]],
+ optValidationErrors: Option[Seq[ExpectedValidationErrors]],
+ implString: Option[String]): Unit = {
+
+ VerifyTestCase.verifyDiagnosticsFound(
+ diagnostics,
+ optValidationErrors,
+ implString
+ )
// check for any test-specified errors or warnings
if (
!isCrossTest(implString.get) ||
parent.shouldDoErrorComparisonOnCrossTests
- )
- VerifyTestCase.verifyAllDiagnosticsFound(
+ ) {
+ VerifyTestCase.verifyDiagnosticsFound(
diagnostics,
Some(errors),
implString
)
+ }
if (
!isCrossTest(implString.get) ||
parent.shouldDoWarningComparisonOnCrossTests
- )
- VerifyTestCase.verifyAllDiagnosticsFound(
+ ) {
+ lazy val warningDiagnostics = diagnostics.filterNot(d => d.isError ||
d.isValidation)
+ lazy val nonNoneAttribWarnings = optWarnings.filter {w =>
!w.forall(_.matchAttrib.contains("none")) }.getOrElse(Nil)
+ if (noWarnings && warningDiagnostics.nonEmpty) {
+ throw TDMLException(s"Test should not create warnings, but created the
following: ${warningDiagnostics.mkString("\n")}",
Review Comment:
I updated the logic and renamed noWarnings to noWarningsAllowed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]