stevedlawrence commented on a change in pull request #129: Cross Testing 
Capability with IBM DFDL
URL: https://github.com/apache/incubator-daffodil/pull/129#discussion_r229685175
 
 

 ##########
 File path: 
daffodil-tdml/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala
 ##########
 @@ -682,87 +774,64 @@ case class ParserTestCase(ptc: NodeSeq, parentArg: 
DFDLTestSuite)
 
   lazy val optExpectedInfoset = this.optExpectedOrInputInfoset
 
-  override def runProcessor(schemaSource: DaffodilSchemaSource,
+  override def runProcessor(compileResult: TDML.CompileResult,
     optDataToParse: Option[InputStream],
     optLengthLimitInBits: Option[Long],
-    optErrors: Option[ExpectedErrors],
-    optWarnings: Option[ExpectedWarnings],
-    optValidationErrors: Option[ExpectedValidationErrors],
+    optExpectedErrors: Option[ExpectedErrors],
+    optExpectedWarnings: Option[ExpectedWarnings],
+    optExpectedValidationErrors: Option[ExpectedValidationErrors],
     validationMode: ValidationMode.Type,
     roundTrip: RoundTrip,
     tracer: Option[Debugger]) = {
 
-    val useSerializedProcessor =
-      if (validationMode == ValidationMode.Full) false
-      else if (optWarnings.isDefined) false
-      else true
+
     val nBits = optLengthLimitInBits.get
     val dataToParse = optDataToParse.get
 
-    val processor = getProcessor(schemaSource, useSerializedProcessor)
-    processor.right.foreach {
-      case (warnings, proc) =>
-        //
-        // Print out the warnings
-        // (JIRA DFDL-1583 is implementation of expected warnings checking.)
-        //
-        warnings.foreach { System.err.println(_) }
-
-        setupDebugOrTrace(proc)
-    }
-
-    (optExpectedInfoset, optErrors) match {
-      case (Some(infoset), None) => {
-        processor.left.foreach { diags => throw new TDMLException(diags) }
-        processor.right.foreach {
-          case (warnings, processor) =>
-            runParseExpectSuccess(processor, dataToParse, nBits, optWarnings, 
optValidationErrors, validationMode, roundTrip)
+    (optExpectedInfoset, optExpectedErrors) match {
+      case (Some(_), None) => {
+        compileResult.left.foreach { diags => throw new TDMLException(diags) }
+        compileResult.right.foreach {
+          case (_, processor) =>
+            runParseExpectSuccess(processor, dataToParse, nBits, 
optExpectedWarnings, optExpectedValidationErrors, validationMode, roundTrip)
         }
       }
 
-      case (None, Some(errors)) => {
-        processor.left.foreach { diags =>
-          VerifyTestCase.verifyAllDiagnosticsFound(diags, Some(errors))
+      case (None, Some(_)) => {
+        compileResult.left.foreach { diags =>
+          VerifyTestCase.verifyAllDiagnosticsFound(diags, optExpectedErrors)
 
 Review comment:
   How should we handle implementations that will likely have different 
diagnostics? Perhaps we only validate expected errors when using Daffodil, and 
for other implementations we just expect some errors, but don't care what they 
are?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to