提交 ccee8abf authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Detect not executed tests

上级 b0240f22
......@@ -8,6 +8,8 @@ package org.h2.test;
import java.lang.management.ManagementFactory;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.TimerTask;
import java.util.concurrent.TimeUnit;
......@@ -430,6 +432,7 @@ java org.h2.test.TestAll timer
private Server server;
HashMap<Class<? extends TestBase>, Boolean> executedTests = new HashMap<>();
/**
* Run all tests.
......@@ -689,6 +692,12 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
cipher = null;
test();
}
for (Entry<Class<? extends TestBase>, Boolean> entry : executedTests.entrySet()) {
if (!entry.getValue()) {
System.out.println("Warning: test " + entry.getKey().getName() + " was not executed.");
}
}
}
private void runCoverage() throws SQLException {
......
......@@ -128,8 +128,12 @@ public abstract class TestBase {
try {
init(conf);
if (!isEnabled()) {
if (!conf.executedTests.containsKey(getClass())) {
conf.executedTests.put(getClass(), false);
}
return;
}
conf.executedTests.put(getClass(), true);
start = System.nanoTime();
test();
println("");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论