LinuxCommandLibrary

gradle-test

Gradle unit test runner

TLDR

Run all tests

$ gradle test
copy
Run with wrapper
$ ./gradlew test
copy
Run specific test class
$ gradle test --tests [SomeTestClass]
copy
Run specific test method
$ gradle test --tests [SomeTestClass.testMethod]
copy
Run tests matching pattern
$ gradle test --tests '*Test'
copy
Force re-run all tests
$ gradle cleanTest test
copy
Run tests with continue on failure
$ gradle test --continue
copy
Dry run without executing
$ gradle test --test-dry-run
copy

SYNOPSIS

gradle test [--tests pattern] [options]

DESCRIPTION

gradle test runs the unit test suite for a Gradle project. It compiles test sources, runs tests, and generates reports. Use --tests to run specific tests by class name, method name, or wildcard pattern. Multiple --tests options can be combined. By default, Gradle skips tests that passed previously unless sources changed.

PARAMETERS

--tests pattern

Run tests matching pattern (class, method, or wildcard).
--continue
Continue on test failure.
--test-dry-run
Simulate without executing tests.
--info
Show more test output.
--rerun-tasks
Force re-run even if up-to-date.
-x task
Exclude a task.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community