mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-27 06:51:37 -04:00
made tests less verbose
This commit is contained in:
parent
3b8b5e463a
commit
8ce338e39c
@ -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();
|
||||
|
@ -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));
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user