Skip to content

Instantly share code, notes, and snippets.

@eriwen
Created March 26, 2013 14:47

Revisions

  1. eriwen created this gist Mar 26, 2013.
    29 changes: 29 additions & 0 deletions test.gradle
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    // Usage: gradlew [-Dtest.type=all|unit|integration] test

    test {
    String testType = System.properties['test.type']
    if (testType == 'integration') {
    include '**/*IntegrationTest.*'
    include '**/*IntegrationSpec.*'
    } else if (testType == 'unit') {
    include '**/*Test.*'
    include '**/*Spec.*'
    exclude '**/*IntegrationTest.*'
    exclude '**/*IntegrationSpec.*'
    } else if (testType == 'all') {
    include '**/*Test.*'
    include '**/*Spec.*'
    } else {
    //Default to unit
    include '**/*Test.*'
    include '**/*Spec.*'
    exclude '**/*IntegrationTest.*'
    exclude '**/*IntegrationSpec.*'
    }
    }

    // Usage: gradlew integrationTest
    task integrationTest(type: Test, description: 'Runs the integration tests', group: 'Verification') {
    include '**/*IntegrationTest.*'
    include '**/*IntegrationSpec.*'
    }