Hello, 

I have a set of tests that I find myself executing singly a lot like this:

*gradlew someProj:test -Dtest.single=someImportantTest*

What I am trying to do is dynamically create task names for these important
tests and execute them like this: 

*gradlew someProj:someImportantTest* OR *gradlew someProj:sIT*

What I came up with is this:

def testList = ['someImportantTest1', 'someImportantTest2'...]

        testList.each{
                testName ->
                task "$testName" << { 
                        println "I am going to execute $testName as a single 
test..."
                        
                        // this is where the problem starts... I do not know
how to tell the test
                        // that I want to execute a single test with the
name... I tried these:
                        test.systemProperties['test.single']=testName
                        System.properties['test.single']=testName
                        
                        test.execute()
                }
        }

I have tried many more combinations but nothing seems to work. The test task
just executes all the tests instead of the test I want. Can you please
explain how I can achieve this?

Thank you in advance!!!!

--
View this message in context: 
http://gradle.1045684.n5.nabble.com/Attempting-to-execute-single-test-from-another-task-tp4892980p4892980.html
Sent from the gradle-user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to