diff --git a/test/java/foundation/pEp/jniadapter/test/framework/TestSuite.java b/test/java/foundation/pEp/jniadapter/test/framework/TestSuite.java index de985e5..876eb0b 100644 --- a/test/java/foundation/pEp/jniadapter/test/framework/TestSuite.java +++ b/test/java/foundation/pEp/jniadapter/test/framework/TestSuite.java @@ -7,6 +7,7 @@ import java.util.ArrayList; public class TestSuite { private static ArrayList tests = new ArrayList(); private static boolean verbose = false; + private static TermColor testColor = TermColor.CYAN; private TestSuite() { } @@ -18,6 +19,15 @@ public class TestSuite { verbose = v; } + public static TermColor getTestColor() { + return testColor; + } + + public static void setTestColor(TermColor color) { + testColor = color; + } + + public static void add(TestUnit t) { tests.add(t); } @@ -25,6 +35,7 @@ public class TestSuite { public static void run() { for (TestUnit t : tests) { t.setVerboseMode(verbose); + t.setTestColor(testColor); t.run(); } printStats(); diff --git a/test/java/foundation/pEp/jniadapter/test/framework/TestUnit.java b/test/java/foundation/pEp/jniadapter/test/framework/TestUnit.java index 8b35377..8ac4ee3 100644 --- a/test/java/foundation/pEp/jniadapter/test/framework/TestUnit.java +++ b/test/java/foundation/pEp/jniadapter/test/framework/TestUnit.java @@ -16,6 +16,7 @@ public class TestUnit implements Runnable { private Throwable lastException; private boolean verboseMode = true; + private TermColor testColor = TermColor.CYAN; // Defaults (line width 80) private int logFmtTestNameLen = 35; @@ -37,6 +38,14 @@ public class TestUnit implements Runnable { this.verboseMode = verboseMode; } + public TermColor getTestColor() { + return testColor; + } + + public void setTestColor(TermColor testColor) { + this.testColor = testColor; + } + public TestResult getResult() { return result; } @@ -64,7 +73,7 @@ public class TestUnit implements Runnable { //Context init problems need to throw to fail try { setTestState(TestState.CTX_INIT); - setTermColor(TermColor.BLUE); + setTermColor(testColor); ctx.init(); setTermColor(TermColor.RESET); } catch (Throwable t) { @@ -78,7 +87,7 @@ public class TestUnit implements Runnable { } //tests need to throw to fail setTestState(TestState.RUNNING); - setTermColor(TermColor.CYAN); + setTermColor(testColor); lambda.accept(ctx); setTermColor(TermColor.RESET); setTestState(TestState.SUCCESS);