File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
src/main/java/io/github/utplsql/cli Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,8 @@ database - database to connect to.
5858 If not defined, then output will be displayed on screen, even if the parameter -s is not specified.
5959 If more than one -o parameter is specified for one -f parameter, the last one is taken into consideration.
6060-s - Forces putting output to to screen for a given -f parameter.
61+ -c - If specified, enables printing of test results in colors as defined by ANSICONSOLE standards.
62+ Works only on reporeters that support colors (ut_documentation_reporter).
6163```
6264
6365Parameters -f, -o, -s are correlated. That is parameters -o and -s are controlling outputs for reporter specified by the preceding -f parameter.
@@ -80,3 +82,7 @@ utplsql run hr/hr@xe
8082```
8183
8284Invokes all unit test suites from schema "hr". Results are displayed to screen using default ut_documentation_reporter.
85+
86+ ##### Enabling Color Outputs on Windows
87+
88+ To enable color outputs on Windows cmd you need to install an open-source utility called [ ANSICON] ( http://adoxa.altervista.org/ansicon/ ) .
Original file line number Diff line number Diff line change @@ -44,6 +44,11 @@ public class RunCommand {
4444 "-f reporter_name [output_file] [console_output]" )
4545 private List <String > reporterParams = new ArrayList <>();
4646
47+ @ Parameter (
48+ names = {"-c" , "--color" },
49+ description = "enables printing of test results in colors as defined by ANSICONSOLE standards" )
50+ private boolean colorConsole = false ;
51+
4752 public ConnectionInfo getConnectionInfo () {
4853 return connectionInfoList .get (0 );
4954 }
@@ -81,11 +86,10 @@ public List<ReporterOptions> getReporterOptionsList() {
8186
8287 public void run () throws Exception {
8388 final ConnectionInfo ci = getConnectionInfo ();
84- System .out .println ("Running Tests For: " + ci .toString ());
8589
8690 final List <ReporterOptions > reporterOptionsList = getReporterOptionsList ();
87- final List <Reporter > reporterList = new ArrayList <>();
8891 final List <String > testPaths = getTestPaths ();
92+ final List <Reporter > reporterList = new ArrayList <>();
8993
9094 if (testPaths .isEmpty ()) testPaths .add (ci .getUser ());
9195
@@ -109,6 +113,7 @@ public void run() throws Exception {
109113 new TestRunner ()
110114 .addPathList (testPaths )
111115 .addReporterList (reporterList )
116+ .colorConsole (colorConsole )
112117 .run (conn );
113118 } catch (SQLException e ) {
114119 // TODO
You can’t perform that action at this time.
0 commit comments