diff --git a/README.md b/README.md index 34a8a97..4c04c81 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ $ go get -u github.com/marcelloh/gotest or get a specific version, like this: ``` -$ go install github.com/marcelloh/gotest@v1.19.4 +$ go install github.com/marcelloh/gotest@v1.19.5 $ go get -u github.com/marcelloh/gotest@v1.19.0 ``` diff --git a/dist/checksums.txt b/dist/checksums.txt index f41b184..367916d 100644 --- a/dist/checksums.txt +++ b/dist/checksums.txt @@ -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 diff --git a/dist/gotest_v1.19.4_Darwin_arm64.tar.gz b/dist/gotest_v1.19.4_Darwin_arm64.tar.gz deleted file mode 100644 index fa101ff..0000000 Binary files a/dist/gotest_v1.19.4_Darwin_arm64.tar.gz and /dev/null differ diff --git a/dist/gotest_v1.19.4_Darwin_x86_64.tar.gz b/dist/gotest_v1.19.4_Darwin_x86_64.tar.gz deleted file mode 100644 index 542c647..0000000 Binary files a/dist/gotest_v1.19.4_Darwin_x86_64.tar.gz and /dev/null differ diff --git a/dist/gotest_v1.19.4_Linux_arm64.tar.gz b/dist/gotest_v1.19.4_Linux_arm64.tar.gz deleted file mode 100644 index d60d65c..0000000 Binary files a/dist/gotest_v1.19.4_Linux_arm64.tar.gz and /dev/null differ diff --git a/dist/gotest_v1.19.4_Linux_i386.tar.gz b/dist/gotest_v1.19.4_Linux_i386.tar.gz deleted file mode 100644 index 5462b59..0000000 Binary files a/dist/gotest_v1.19.4_Linux_i386.tar.gz and /dev/null differ diff --git a/dist/gotest_v1.19.4_Linux_x86_64.tar.gz b/dist/gotest_v1.19.4_Linux_x86_64.tar.gz deleted file mode 100644 index b46e945..0000000 Binary files a/dist/gotest_v1.19.4_Linux_x86_64.tar.gz and /dev/null differ diff --git a/dist/gotest_v1.19.4_Windows_arm64.tar.gz b/dist/gotest_v1.19.4_Windows_arm64.tar.gz deleted file mode 100644 index 1f90813..0000000 Binary files a/dist/gotest_v1.19.4_Windows_arm64.tar.gz and /dev/null differ diff --git a/dist/gotest_v1.19.4_Windows_i386.tar.gz b/dist/gotest_v1.19.4_Windows_i386.tar.gz deleted file mode 100644 index 54cc16f..0000000 Binary files a/dist/gotest_v1.19.4_Windows_i386.tar.gz and /dev/null differ diff --git a/dist/gotest_v1.19.4_Windows_x86_64.tar.gz b/dist/gotest_v1.19.4_Windows_x86_64.tar.gz deleted file mode 100644 index ad77dcb..0000000 Binary files a/dist/gotest_v1.19.4_Windows_x86_64.tar.gz and /dev/null differ diff --git a/dist/gotest_v1.19.5_Darwin_arm64.tar.gz b/dist/gotest_v1.19.5_Darwin_arm64.tar.gz new file mode 100644 index 0000000..eea91f5 Binary files /dev/null and b/dist/gotest_v1.19.5_Darwin_arm64.tar.gz differ diff --git a/dist/gotest_v1.19.5_Darwin_x86_64.tar.gz b/dist/gotest_v1.19.5_Darwin_x86_64.tar.gz new file mode 100644 index 0000000..7b6a4f6 Binary files /dev/null and b/dist/gotest_v1.19.5_Darwin_x86_64.tar.gz differ diff --git a/dist/gotest_v1.19.5_Linux_arm64.tar.gz b/dist/gotest_v1.19.5_Linux_arm64.tar.gz new file mode 100644 index 0000000..3f19f03 Binary files /dev/null and b/dist/gotest_v1.19.5_Linux_arm64.tar.gz differ diff --git a/dist/gotest_v1.19.5_Linux_i386.tar.gz b/dist/gotest_v1.19.5_Linux_i386.tar.gz new file mode 100644 index 0000000..66d1837 Binary files /dev/null and b/dist/gotest_v1.19.5_Linux_i386.tar.gz differ diff --git a/dist/gotest_v1.19.5_Linux_x86_64.tar.gz b/dist/gotest_v1.19.5_Linux_x86_64.tar.gz new file mode 100644 index 0000000..8b84e57 Binary files /dev/null and b/dist/gotest_v1.19.5_Linux_x86_64.tar.gz differ diff --git a/dist/gotest_v1.19.5_Windows_arm64.tar.gz b/dist/gotest_v1.19.5_Windows_arm64.tar.gz new file mode 100644 index 0000000..e5c5926 Binary files /dev/null and b/dist/gotest_v1.19.5_Windows_arm64.tar.gz differ diff --git a/dist/gotest_v1.19.5_Windows_i386.tar.gz b/dist/gotest_v1.19.5_Windows_i386.tar.gz new file mode 100644 index 0000000..9e705ce Binary files /dev/null and b/dist/gotest_v1.19.5_Windows_i386.tar.gz differ diff --git a/dist/gotest_v1.19.5_Windows_x86_64.tar.gz b/dist/gotest_v1.19.5_Windows_x86_64.tar.gz new file mode 100644 index 0000000..56d9d4f Binary files /dev/null and b/dist/gotest_v1.19.5_Windows_x86_64.tar.gz differ diff --git a/gotest b/gotest index b2d6d4c..1077810 100755 Binary files a/gotest and b/gotest differ diff --git a/main.go b/main.go index 36eafa3..130c611 100644 --- a/main.go +++ b/main.go @@ -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 @@ -88,7 +87,7 @@ func run() int { startTime = time.Now().Local() ct.ResetColor() - println("gotest v1.19.4") + println("gotest v1.19.5") findTestFiles() @@ -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() } @@ -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", "")) + ": " @@ -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 {