All Downloads are FREE. Search and download functionalities are using the official Maven repository.

a-wrench_0.17.0.0.2.source-code.RunOutput.scala Maven / Gradle / Ivy

The newest version!
package org.xmid
package wrench

import java.io.{File => JFile}

import wrench.Util._

final case class RunOutput(test: TestCase, exitCode: Int, output: String) {
  private[wrench] def checkSucceeded(implicit ctx: ActionContext): Boolean = {
    if (exitCode != 0) {
      ctx.error(test.name + " exited with " + exitCode)
      ctx.error("output: " + output)
      false
    }
    else if (test.runCheckFile.nonEmpty) {
      val checkFilePath = test.runCheckFile.get.getAbsolutePath()
      FileDiff.check(test.name, output.toLines, checkFilePath) match {
        case Some(msg) =>
          ctx.error(msg)
          FileDiff.dump(test.runLogPath, output.toLines)
          ctx.error(FileDiff.diffMessage(checkFilePath, test.runLogPath))
          false
        case _ =>
          true
      }
    }
    else true
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy