Skip to content

Commit

Permalink
different fail count
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelloh committed Jan 3, 2022
1 parent 3857057 commit 507e7e8
Show file tree
Hide file tree
Showing 20 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $ go get -u github.com/marcelloh/gotest
or get a specific version, like this:

```
$ go install github.com/marcelloh/[email protected].4
$ go install github.com/marcelloh/[email protected].5
$ go get -u github.com/marcelloh/[email protected]
```

Expand Down
16 changes: 8 additions & 8 deletions dist/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
3ad324d315ecdf7d752670bf9531aeed80382e59188e400dec5da053607bf16a gotest_v1.19.4_Linux_x86_64.tar.gz
62148d629133919782a49ff46ee7902cc9018ded50564c53dc90126a0e39ebbc gotest_v1.19.4_Linux_arm64.tar.gz
888dbae191313e8e0c63fa63d234ad7ff51ead19d2918f4d16444f4a61f9e439 gotest_v1.19.4_Windows_i386.tar.gz
9403c45f998c6f4f55bd7e27c3f8cba3ff67dcfbf38f42ebc32aac9ecc31dcca gotest_v1.19.4_Windows_x86_64.tar.gz
99d379e73d91b52b0d0ab4666ed6aaaa234dc658a5c3065882a7c0e3a7567187 gotest_v1.19.4_Windows_arm64.tar.gz
b07f868dce4ae0a74ef52325cbc59a04cb7fc5b30af694eb38e48f66170af8fe gotest_v1.19.4_Linux_i386.tar.gz
b520f18bf64fbfbf8248f3bb24496237b58e611e90341237f0719187f3234100 gotest_v1.19.4_Darwin_arm64.tar.gz
e01f1278aa22f60471b9a9cb6da82f8d8a4c51e1c8765a3af6b48ca393f1b926 gotest_v1.19.4_Darwin_x86_64.tar.gz
0e75990dbbc01383ecd14847d7edd95ba95d3d0923fbdd65d803e95a429d931b gotest_v1.19.5_Windows_arm64.tar.gz
15775daa5763782b0834078f381770ab30f8d9a6f3e55c5c4608b2fb8e3dacae gotest_v1.19.5_Darwin_x86_64.tar.gz
518744652c9f066fcaf7748718d9c52a67628862362f13ab98acce88c3528597 gotest_v1.19.5_Windows_x86_64.tar.gz
7f6be3d2598af569788be6e152e091705251c9d2572301f652cc92777fd39b79 gotest_v1.19.5_Linux_arm64.tar.gz
944eb250c76a1043ada63a9712327283c87220e81adfd5c05625f4bf45a7a553 gotest_v1.19.5_Linux_i386.tar.gz
bd887a50dee966eeac195b8c18c40530f585e47ece4af4e54eac09967c79d0d0 gotest_v1.19.5_Windows_i386.tar.gz
e302ae864978e7e3b7e5bb81463f679b78b92a2fc558def2f79801f0030d54b7 gotest_v1.19.5_Linux_x86_64.tar.gz
efbc22d9305278b5a30ad309af99841876971a32076d8d10ea061edac9c70f3b gotest_v1.19.5_Darwin_arm64.tar.gz
Binary file removed dist/gotest_v1.19.4_Darwin_arm64.tar.gz
Binary file not shown.
Binary file removed dist/gotest_v1.19.4_Darwin_x86_64.tar.gz
Binary file not shown.
Binary file removed dist/gotest_v1.19.4_Linux_arm64.tar.gz
Binary file not shown.
Binary file removed dist/gotest_v1.19.4_Linux_i386.tar.gz
Binary file not shown.
Binary file removed dist/gotest_v1.19.4_Linux_x86_64.tar.gz
Binary file not shown.
Binary file removed dist/gotest_v1.19.4_Windows_arm64.tar.gz
Binary file not shown.
Binary file removed dist/gotest_v1.19.4_Windows_i386.tar.gz
Binary file not shown.
Binary file removed dist/gotest_v1.19.4_Windows_x86_64.tar.gz
Binary file not shown.
Binary file added dist/gotest_v1.19.5_Darwin_arm64.tar.gz
Binary file not shown.
Binary file added dist/gotest_v1.19.5_Darwin_x86_64.tar.gz
Binary file not shown.
Binary file added dist/gotest_v1.19.5_Linux_arm64.tar.gz
Binary file not shown.
Binary file added dist/gotest_v1.19.5_Linux_i386.tar.gz
Binary file not shown.
Binary file added dist/gotest_v1.19.5_Linux_x86_64.tar.gz
Binary file not shown.
Binary file added dist/gotest_v1.19.5_Windows_arm64.tar.gz
Binary file not shown.
Binary file added dist/gotest_v1.19.5_Windows_i386.tar.gz
Binary file not shown.
Binary file added dist/gotest_v1.19.5_Windows_x86_64.tar.gz
Binary file not shown.
Binary file modified gotest
Binary file not shown.
28 changes: 16 additions & 12 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,16 @@ import (
/* ---------------------- Constants/Types/Variables ------------------ */

var (
isFile bool
testFuncs = map[string]string{}
startTime time.Time
//watcher = &fsnotify.Watcher{}
isFile bool
testFuncs = map[string]string{}
startTime time.Time
args []string
totalSkips int
totalFails int
totalNoTests int
lastLine string
lastFunc string
fileLine string //nolint: gocritic,unused
fileLine string //nolint: unused
verbose bool
oldGo bool
testRunning string
Expand Down Expand Up @@ -88,7 +87,7 @@ func run() int {
startTime = time.Now().Local()

ct.ResetColor()
println("gotest v1.19.4")
println("gotest v1.19.5")

findTestFiles()

Expand Down Expand Up @@ -268,11 +267,9 @@ func parse(line string) {
fileLine = lastLine
lastFunc = getFuncName(trimmed)
case strings.Contains(trimmed, "[build failed]"):
colorRed()

totalFails++
addFail()
case strings.HasPrefix(trimmed, "# "):
colorRed()
addFail()
case strings.HasPrefix(trimmed, "FAIL"):
colorRed()
}
Expand All @@ -298,8 +295,15 @@ func parse(line string) {
}
}

func addFail() {
colorRed()

totalFails++
}

func checkYellow(trimmed string) {
testRunning = ""

switch {
case strings.HasPrefix(trimmed, "=== RUN"):
testRunning = strings.TrimSpace(strings.ReplaceAll(trimmed, "=== RUN", "")) + ": "
Expand Down Expand Up @@ -455,10 +459,10 @@ func walkerFilter(path string, fileInfo os.FileInfo, walkError error) (err error

matched, err := filepath.Match(filter, fileInfo.Name())
if err != nil || !matched {
return nil //nolint: gocritic,nilerr
return nil //nolint: nilerr
}

path = strings.Replace(path, "\\", "/", -1) // for windows
path = strings.ReplaceAll(path, "\\", "/") // for windows
if depth >= 0 {
slashes := strings.Count(path, "/")
if slashes > orgSlashes {
Expand Down

0 comments on commit 507e7e8

Please sign in to comment.