using tabwriter fix for better output.
This commit is contained in:
parent
ef0ef6e215
commit
71ebdd8208
@ -10,6 +10,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"strings"
|
"strings"
|
||||||
|
"text/tabwriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
func getVersion() string {
|
func getVersion() string {
|
||||||
@ -140,15 +141,19 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("\n\nSUMMARY\n\n")
|
fmt.Printf("\n\nSUMMARY\n\n")
|
||||||
fmt.Printf("%-60s %-10s %-10s %-10s %-10s %-10s %-10s\n\n", "SUITE", "COUNT", "PASSED", "FAILURES", "ERRORS", "DISABLED", "SKIPPED")
|
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
|
||||||
|
|
||||||
|
fmt.Fprintf(w, "%s\t%-10s\t%-10s\t%-10s\t%-10s\t%-10s\t%-10s\n",
|
||||||
|
"SUITE", "COUNT", "PASSED", "FAILURES", "ERRORS", "DISABLED", "SKIPPED")
|
||||||
|
|
||||||
for _, suite := range testsuites.Suites {
|
for _, suite := range testsuites.Suites {
|
||||||
fmt.Printf("%-60s %-10d %-10d %-10d %-10d %-10d %-10d\n",
|
fmt.Fprintf(w, "%s\t%-10d\t%-10d\t%-10d\t%-10d\t%-10d\t%-10d\n",
|
||||||
suite.Name,
|
suite.Name,
|
||||||
suite.TestCount,
|
suite.TestCount,
|
||||||
suite.TestCount-suite.Failures-suite.Errors-suite.Skipped-suite.Disabled,
|
suite.TestCount-suite.Failures-suite.Errors-suite.Skipped-suite.Disabled,
|
||||||
suite.Failures, suite.Errors, suite.Disabled, suite.Skipped)
|
suite.Failures, suite.Errors, suite.Disabled, suite.Skipped)
|
||||||
}
|
}
|
||||||
fmt.Printf("\n%-60s %-10d %-10d %-10d %-10d %-10d %-10d\n",
|
fmt.Fprintf(w, "\n%s\t%10d\t%10d\t%10d\t%10d\t%10d\t%10d\n",
|
||||||
"TOTAL",
|
"TOTAL",
|
||||||
testsuites.Tests,
|
testsuites.Tests,
|
||||||
testsuites.Tests-testsuites.Failures-testsuites.Errors-testsuites.Skipped-testsuites.Disabled,
|
testsuites.Tests-testsuites.Failures-testsuites.Errors-testsuites.Skipped-testsuites.Disabled,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user