sclass ErrorCounter { new LPair errors; int total; void run(O info, Runnable r) { try { r.run(); } catch print e { errors.add(pair(info, e)); } ++total; } void print() { _print(toString_short() + (nempty(errors) ? "" : ". Fails: " + pairsA(errors))); } S toString_short() { ret empty(errors) ? "No errors (tests: " + total + ")" : n2(errors, "error") + " in " + n2(total, "test") + ". Fails: " + pairsA(errors); } void add(ErrorCounter ec) { if (ec == null) ret; total += ec.total; addAll(errors, ec.errors); } bool allCorrect() { ret empty(errors); } }