Skip to content

Commit

Permalink
cli.test: colorize the success/failure
Browse files Browse the repository at this point in the history
updating and adding vendored source to do it

Signed-off-by: Vincent Batts <[email protected]>
  • Loading branch information
vbatts committed Aug 20, 2018
1 parent 03270d3 commit 37d776a
Show file tree
Hide file tree
Showing 408 changed files with 170,560 additions and 130 deletions.
14 changes: 10 additions & 4 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ import:
version: 8dbc5d05d6edcc104950cc299a1ce6641235bc86
subpackages:
- unix
- package: github.com/fatih/color
version: ^1.6.0
10 changes: 7 additions & 3 deletions test/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ import (
"fmt"
"os"
"os/exec"

"github.com/fatih/color"
)

func main() {
flag.Parse()
green := color.New(color.FgGreen).SprintFunc()
red := color.New(color.FgRed).SprintFunc()

failed := 0
for _, arg := range flag.Args() {
Expand All @@ -22,12 +26,12 @@ func main() {
cmd.Stdout = os.Stdout
if err := cmd.Run(); err != nil {
failed++
fmt.Fprintf(os.Stderr, "FAILED: %s\n", arg)
fmt.Fprintf(os.Stderr, red("FAILED: %s\n"), arg)
}
}
if failed > 0 {
fmt.Fprintf(os.Stderr, "%d FAILED tests\n", failed)
fmt.Fprintf(os.Stderr, red("%d FAILED tests\n"), failed)
os.Exit(1)
}
fmt.Fprintf(os.Stdout, "SUCCESS: no cli tests failed\n")
fmt.Fprintf(os.Stdout, green("SUCCESS: no cli tests failed\n"))
}
22 changes: 22 additions & 0 deletions vendor/github.com/davecgh/go-spew/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions vendor/github.com/davecgh/go-spew/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions vendor/github.com/davecgh/go-spew/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

201 changes: 201 additions & 0 deletions vendor/github.com/davecgh/go-spew/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions vendor/github.com/davecgh/go-spew/cov_report.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 37d776a

Please sign in to comment.