Skip to content

core test

Run Go tests with coverage reporting.

Sets MACOSX_DEPLOYMENT_TARGET=26.0 to suppress linker warnings on macOS.

Usage

bash
core test [flags]

Flags

FlagDescription
--coverageShow detailed per-package coverage
--jsonOutput JSON for CI/agents
--pkgPackage pattern to test (default: ./...)
--raceEnable race detector
--runRun only tests matching this regex
--shortSkip long-running tests
--verboseShow test output as it runs

Examples

bash
# Run all tests with coverage summary
core test

# Show test output as it runs
core test --verbose

# Detailed per-package coverage
core test --coverage

# Test specific packages
core test --pkg ./pkg/...

# Run specific test by name
core test --run TestName

# Run tests matching pattern
core test --run "Test.*Good"

# Skip long-running tests
core test --short

# Enable race detector
core test --race

# Output JSON for CI/agents
core test --json

JSON Output

With --json, outputs structured results:

json
{
  "passed": 14,
  "failed": 0,
  "skipped": 0,
  "coverage": 75.1,
  "exit_code": 0,
  "failed_packages": []
}

See Also

Released under the EUPL-1.2 License.