made tests less verbose

This commit is contained in:
hneemann 2017-06-24 09:58:25 +02:00
parent 3b8b5e463a
commit 8ce338e39c
3 changed files with 36 additions and 48 deletions

View File

@ -23,7 +23,7 @@ public class FileScanner {
if (errors.isEmpty())
return count;
System.err.println("errors:");
System.err.println("errors: " + errors.size());
for (Error e : errors) {
System.err.println("----> error in: " + e.f);
e.e.printStackTrace();

View File

@ -30,7 +30,6 @@ public class Test74xx extends TestCase {
}
private void check(File dig) throws PinException, NodeException, ElementNotFoundException, IOException {
System.out.println(dig);
Circuit circuit = new ToBreakRunner(dig).getCircuit();
assertTrue("is not DIL", circuit.getAttributes().get(Keys.IS_DIL));
assertTrue("is not locked", circuit.getAttributes().get(Keys.LOCKED_MODE));

View File

@ -50,15 +50,12 @@ public class TestExamples extends TestCase {
* @param dig the model file
*/
private void check(File dig) throws Exception {
boolean hasTest = false;
try {
boolean shouldFail = dig.getName().endsWith("Error.dig");
ToBreakRunner br = null;
try {
br = new ToBreakRunner(dig);
} catch (Exception e) {
if (shouldFail) {
hasTest = true;
return;
} else
throw e;
@ -67,7 +64,6 @@ public class TestExamples extends TestCase {
try {
for (VisualElement el : br.getCircuit().getElements())
if (el.equalsDescription(TestCaseElement.TESTCASEDESCRIPTION)) {
hasTest = true;
String label = el.getElementAttributes().getCleanLabel();
TestData td = el.getElementAttributes().get(TestCaseElement.TESTDATA);
@ -84,18 +80,11 @@ public class TestExamples extends TestCase {
}
} catch (Exception e) {
if (shouldFail) {
hasTest = true;
return;
} else
throw e;
}
assertFalse("File should fail but doesn't!", shouldFail);
} finally {
System.out.print("tested " + dig);
if (!hasTest) System.out.println(" -- no test cases");
else System.out.println();
}
}
}