test-app

Purpose

Examples

grails test-app
grails test-app Foo
grails test-app Foo Bar

Description

Usage:

grails [environment]* test-app [names]*

Fired Events:

StatusFinal - When the test cycle completes

Executes the Grails unit and integration tests located in the test/unit and test/integration directories. By default all tests are executed, but you can specify the names of the tests (without the "Tests" or other test type suffix) as argument to the command:

grails test-app Foo
grails test-app Foo Bar

The first example will execute a test called FooTests.groovy whilst the second will execute FooTests.groovy and BarTests.groovy if they exist.

Tests can also use the suffix of Test instead of Tests.

You can also choose to only run the unit or integration tests:

grails test-app unit:
grails test-app integration:

If you only wish to re-run failed tests use the -rerun flag

grails test-app -rerun

See the Testing section for examples on how to combine the different options to target tests.

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
Sponsored by SpringSource