Makefile: run the browser drive whenever any browser test file exists
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Summary
Browser target tests each candidate file with [ -f ] instead of ls
Agent notes
ls fails if either operand is missing, so a lone browser_test.go or *_browser_test.go skipped the drive. Now loops over both patterns; proven with dummy files, removed afterwards.
1 file changed,
+4
−1
Makefile+4 −1
CI passed — run details
CI log
=== vet === go vet ./... === fmt === === test === go test ./... -count=1 ok amadan.net/rastrillo/abono 0.010s === race === CGO_ENABLED=1 go test ./... -race -count=1 ok amadan.net/rastrillo/abono 1.080s === browser === browser: no browser test file yet, nothing to run
Intent
diff --git a/Makefile b/Makefile| index 4c204be..8187518 100644 |
| --- a/Makefile |
| +++ b/Makefile |
| @@ -31,7 +31,10 @@ race: |
| # only once a browser test file exists, so an empty package does not |
| # fail the gate. |
| browser: |
| - @if ls *_browser_test.go browser_test.go >/dev/null 2>&1; then \ |
| + @found=; for f in *_browser_test.go browser_test.go; do \ |
| + if [ -f "$$f" ]; then found=1; fi; \ |
| + done; \ |
| + if [ -n "$$found" ]; then \ |
| go test -tags browser -run TestBrowser -count=1 .; \ |
| else \ |
| echo "browser: no browser test file yet, nothing to run"; \ |