mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-28 07:28:20 -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())
|
if (errors.isEmpty())
|
||||||
return count;
|
return count;
|
||||||
|
|
||||||
System.err.println("errors:");
|
System.err.println("errors: " + errors.size());
|
||||||
for (Error e : errors) {
|
for (Error e : errors) {
|
||||||
System.err.println("----> error in: " + e.f);
|
System.err.println("----> error in: " + e.f);
|
||||||
e.e.printStackTrace();
|
e.e.printStackTrace();
|
||||||
|
@ -30,7 +30,6 @@ public class Test74xx extends TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void check(File dig) throws PinException, NodeException, ElementNotFoundException, IOException {
|
private void check(File dig) throws PinException, NodeException, ElementNotFoundException, IOException {
|
||||||
System.out.println(dig);
|
|
||||||
Circuit circuit = new ToBreakRunner(dig).getCircuit();
|
Circuit circuit = new ToBreakRunner(dig).getCircuit();
|
||||||
assertTrue("is not DIL", circuit.getAttributes().get(Keys.IS_DIL));
|
assertTrue("is not DIL", circuit.getAttributes().get(Keys.IS_DIL));
|
||||||
assertTrue("is not locked", circuit.getAttributes().get(Keys.LOCKED_MODE));
|
assertTrue("is not locked", circuit.getAttributes().get(Keys.LOCKED_MODE));
|
||||||
|
@ -50,15 +50,12 @@ public class TestExamples extends TestCase {
|
|||||||
* @param dig the model file
|
* @param dig the model file
|
||||||
*/
|
*/
|
||||||
private void check(File dig) throws Exception {
|
private void check(File dig) throws Exception {
|
||||||
boolean hasTest = false;
|
|
||||||
try {
|
|
||||||
boolean shouldFail = dig.getName().endsWith("Error.dig");
|
boolean shouldFail = dig.getName().endsWith("Error.dig");
|
||||||
ToBreakRunner br = null;
|
ToBreakRunner br = null;
|
||||||
try {
|
try {
|
||||||
br = new ToBreakRunner(dig);
|
br = new ToBreakRunner(dig);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (shouldFail) {
|
if (shouldFail) {
|
||||||
hasTest = true;
|
|
||||||
return;
|
return;
|
||||||
} else
|
} else
|
||||||
throw e;
|
throw e;
|
||||||
@ -67,7 +64,6 @@ public class TestExamples extends TestCase {
|
|||||||
try {
|
try {
|
||||||
for (VisualElement el : br.getCircuit().getElements())
|
for (VisualElement el : br.getCircuit().getElements())
|
||||||
if (el.equalsDescription(TestCaseElement.TESTCASEDESCRIPTION)) {
|
if (el.equalsDescription(TestCaseElement.TESTCASEDESCRIPTION)) {
|
||||||
hasTest = true;
|
|
||||||
|
|
||||||
String label = el.getElementAttributes().getCleanLabel();
|
String label = el.getElementAttributes().getCleanLabel();
|
||||||
TestData td = el.getElementAttributes().get(TestCaseElement.TESTDATA);
|
TestData td = el.getElementAttributes().get(TestCaseElement.TESTDATA);
|
||||||
@ -84,18 +80,11 @@ public class TestExamples extends TestCase {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (shouldFail) {
|
if (shouldFail) {
|
||||||
hasTest = true;
|
|
||||||
return;
|
return;
|
||||||
} else
|
} else
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
assertFalse("File should fail but doesn't!", shouldFail);
|
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