package com.github.blindpirate.gogradle.task;

import org.gradle.api.DefaultTask;

public class TestTask extends DefaultTask {
}

@@ -51,79 +51,1044 @@
 ort 
-org.gradle.api.DefaultTask;%0A%0Apublic class TestTask extends DefaultTask %7B
+com.github.blindpirate.gogradle.build.BuildManager;%0Aimport com.github.blindpirate.gogradle.util.CollectionUtils;%0Aimport org.gradle.api.Incubating;%0Aimport org.gradle.api.internal.tasks.options.Option;%0Aimport org.gradle.api.tasks.TaskAction;%0A%0Aimport javax.inject.Inject;%0Aimport java.util.List;%0A%0Apublic class TestTask extends AbstractGolangTask %7B%0A%0A    private List%3CString%3E testNamePattern;%0A%0A    @Inject%0A    private BuildManager buildManager;%0A%0A    public TestTask() %7B%0A        dependsOn(GolangTaskContainer.INSTALL_TEST_DEPENDENCIES_TASK_NAME);%0A    %7D%0A%0A    @Option(option = %22tests%22, description = %22Sets test class or method name to be included, '*' is supported.%22)%0A    @Incubating%0A    public TestTask setTestNamePattern(List%3CString%3E testNamePattern) %7B%0A        this.testNamePattern = testNamePattern;%0A        return this;%0A    %7D%0A%0A    @TaskAction%0A    void test() %7B%0A        if (CollectionUtils.isEmpty(testNamePattern)) %7B%0A            buildManager.test();%0A        %7D else %7B%0A            buildManager.testWithPatterns(testNamePattern);%0A        %7D%0A    %7D
 %0A%7D%0A

Complete TestTask