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

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

parent fa663278
......@@ -18,8 +18,10 @@ 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.
setLevel(ROOT_LOGGER_NAME, WARN)
}
......@@ -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)
}
}
......
......@@ -18,6 +18,9 @@ class StaticAnalysisTest extends UvmTestBase {
val ir = r.read(new java.io.StringReader(uir), globalBundle)
ir
}
def printException(e: Exception): Unit = travisFriendlyExceptionPrint(e)
behavior of "StaticAnalyzer"
......@@ -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