Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ database - database to connect to.
If not defined, then output will be displayed on screen, even if the parameter -s is not specified.
If more than one -o parameter is specified for one -f parameter, the last one is taken into consideration.
-s - Forces putting output to to screen for a given -f parameter.
-c - If specified, enables printing of test results in colors as defined by ANSICONSOLE standards.
Works only on reporeters that support colors (ut_documentation_reporter).
```

Parameters -f, -o, -s are correlated. That is parameters -o and -s are controlling outputs for reporter specified by the preceding -f parameter.
Expand All @@ -80,3 +82,7 @@ utplsql run hr/hr@xe
```

Invokes all unit test suites from schema "hr". Results are displayed to screen using default ut_documentation_reporter.

##### Enabling Color Outputs on Windows

To enable color outputs on Windows cmd you need to install an open-source utility called [ANSICON](http://adoxa.altervista.org/ansicon/).
9 changes: 7 additions & 2 deletions src/main/java/io/github/utplsql/cli/RunCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public class RunCommand {
"-f reporter_name [output_file] [console_output]")
private List<String> reporterParams = new ArrayList<>();

@Parameter(
names = {"-c", "--color"},
description = "enables printing of test results in colors as defined by ANSICONSOLE standards")
private boolean colorConsole = false;

public ConnectionInfo getConnectionInfo() {
return connectionInfoList.get(0);
}
Expand Down Expand Up @@ -81,11 +86,10 @@ public List<ReporterOptions> getReporterOptionsList() {

public void run() throws Exception {
final ConnectionInfo ci = getConnectionInfo();
System.out.println("Running Tests For: " + ci.toString());

final List<ReporterOptions> reporterOptionsList = getReporterOptionsList();
final List<Reporter> reporterList = new ArrayList<>();
final List<String> testPaths = getTestPaths();
final List<Reporter> reporterList = new ArrayList<>();

if (testPaths.isEmpty()) testPaths.add(ci.getUser());

Expand All @@ -109,6 +113,7 @@ public void run() throws Exception {
new TestRunner()
.addPathList(testPaths)
.addReporterList(reporterList)
.colorConsole(colorConsole)
.run(conn);
} catch (SQLException e) {
// TODO
Expand Down