Ranjith's
Ranjith's

Reputation: 4730

How to run/execute a gradle task?

How to run this gradle task/include it in build task (https://github.com/prashant-ramcharan/courgette-jvm)

task regressionSuite(type: Test, dependsOn: testClasses) {
    systemProperty('name', 'value')

    include '**/RegressionTestSuite.class'

    outputs.upToDateWhen { false }
}

When I do gradle clean regressionSuite is always giving me build successful.. but it's not executing the specified class. Specific file is in the path.

I'm new to gradle.. any help much appreciated!!

Upvotes: 0

Views: 210

Answers (1)

Rene Groeschke
Rene Groeschke

Reputation: 28653

you need to configure also the testClassesDir and the classpath property of the test task, otherwise the class you define in your pattern can't be found nor the test can be executed:

task regressionSuite(type: Test) {
    systemProperty('name', 'value')

    include '**/RegressionTestSuite.class'

    outputs.upToDateWhen { false }

    classpath = sourceSets.test.runtimeClasspath
    testClassesDir = sourceSets.test.output.classesDir
}

Upvotes: 1

Related Questions