Commit 3d56493a authored by Kunshan Wang's avatar Kunshan Wang

When using travis, don't print anything that looks like error.

parent fa663278
......@@ -18,6 +18,8 @@ object LogSetter {
trait LogSetter {
import LogSetter._
def isTravis = LogSetter.isTravis
val ROOT_LOGGER_NAME = org.slf4j.Logger.ROOT_LOGGER_NAME
if (isTravis) { // Travis does not like logging, so just heighten the log level whenever we run tests.
......@@ -32,4 +34,11 @@ trait LogSetter {
}
}
def travisFriendlyExceptionPrint(e: Exception): Unit = {
if (isTravis) {
println("Eror message generated. This is expected.")
} else {
e.printStackTrace()
}
}
}
\ No newline at end of file
......@@ -24,7 +24,7 @@ class NicerErrorMessage extends UvmTestBase with TestingBundlesValidators {
val b = parseFile("tests/uvm-parsing-test/bundle-with-error.uir", gb)
} catch {
case e: TextIRParsingException => // expected
e.printStackTrace()
travisFriendlyExceptionPrint(e)
}
}
......
......@@ -28,7 +28,7 @@ class SourceInfoRepoTest extends UvmTestBase {
} catch {
case e: TestFailedException => throw e
case e: Exception => // expected
e.printStackTrace()
travisFriendlyExceptionPrint(e)
}
}
......
......@@ -19,6 +19,9 @@ class StaticAnalysisTest extends UvmTestBase {
ir
}
def printException(e: Exception): Unit = travisFriendlyExceptionPrint(e)
behavior of "StaticAnalyzer"
def shouldWorkFineIn(text: String): Unit = {
......@@ -35,7 +38,7 @@ class StaticAnalysisTest extends UvmTestBase {
fail()
} catch {
case e: StaticCheckingException => // expected
e.printStackTrace()
printException(e)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment