提交 13dcb511 authored 作者: Thomas Mueller's avatar Thomas Mueller

Tests: less output

上级 9055002f
......@@ -40,6 +40,11 @@ public abstract class TestBase {
protected static String baseDir = getTestDir("");
private static final String BASE_TEST_DIR = "data";
/**
* The last time something was printed.
*/
private static long lastPrint;
/**
* The test configuration.
*/
......@@ -303,6 +308,7 @@ public abstract class TestBase {
*/
public void trace(String s) {
if (config.traceTest) {
lastPrint = 0;
println(s);
}
}
......@@ -365,6 +371,7 @@ public abstract class TestBase {
* @throws AssertionError always throws an AssertionError
*/
protected void fail(String string) {
lastPrint = 0;
println(string);
throw new AssertionError(string);
}
......@@ -404,8 +411,12 @@ public abstract class TestBase {
* @param s the message
*/
public void println(String s) {
long time = System.currentTimeMillis() - start;
printlnWithTime(time, getClass().getName() + " " + s);
long now = System.currentTimeMillis();
if (now > lastPrint + 1000) {
lastPrint = now;
long time = now - start;
printlnWithTime(time, getClass().getName() + " " + s);
}
}
/**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论