Skip to content

entiqon/gotestx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoTestX

Go Test eXtended tool with coverage support

Go Version Latest Release Build Status Codecov

GoTestX extends the standard go test command with a simpler, more versatile interface.
It adds optional coverage reporting, quiet mode, and clean output filtering — while remaining fully compatible with go test.


✨ Features

  • Coverage mode (-c): generates coverage.out with -covermode=atomic.
  • Open coverage (-o): opens the HTML coverage report in a browser (macOS only).
  • Quiet mode (-q): suppresses verbose chatter, but always reports:
    • ✅ success if all tests passed
    • coverage % if -c is enabled
    • ❌ failure (with hint to rerun without -q)
  • Clean view (-V): removes ? … [no test files] lines for cleaner output.
  • Flag combinations: short flags can be combined (e.g. -cq, -coq, -cVq).
  • Smart package detection:
    • Expands ./pkg./pkg/... if root has no Go files but subpackages do.
    • Reports errors if a path doesn’t exist or has no Go files.

🚀 Installation

Install directly via GitHub:

go install github.com/entiqon/gotestx@latest

Check installation:

gotestx -v

📦 Usage

gotestx [options] [packages]

Options:

  -c, --with-coverage   Run tests with coverage report generation (coverage.out)
  -o, --open-coverage   Open coverage report in browser (macOS only, implies -c)
  -q, --quiet           Suppress verbose output, only show summary/coverage/fail
  -V, --clean-view      Suppress 'no test files' lines for cleaner output
  -h, --help            Show this help
  -v, --version         Show version info

🧪 Examples

Run tests for all packages:

gotestx

Run tests with coverage:

gotestx -c ./...

Run quietly with coverage (only one summary line):

gotestx -cq ./...

Run with coverage and open report in browser (macOS):

gotestx -o ./...

Run with clean output (no [no test files] lines):

gotestx -V ./...

Combine flags:

gotestx -cVq ./...

🖥 Sample Output

Normal run:

Running tests normally across: ./internal/...
ok  	github.com/entiqon/gotestx/internal	0.359s

Quiet run:

✅ Tests finished successfully

Quiet + coverage:

ok  	github.com/entiqon/gotestx/internal	0.359s	coverage: 100.0% of statements

Quiet with failure:

❌ Tests failed (use without -q to see details)

Clean view:

ok  	github.com/entiqon/gotestx/internal/join	0.01s

(no [no test files] lines)


🛠 Development

Clone the repository:

git clone https://github.com/entiqon/gotestx.git
cd gotestx

Build:

go build -o gotestx .

Test:

go test ./internal/... -v

📄 License

Part of the Entiqon Project.
Licensed under the MIT License.