package org.gradle.script.lang.kotlin.samples

import org.gradle.script.lang.kotlin.fixtures.AbstractIntegrationTest

import org.hamcrest.CoreMatchers.containsString
import org.hamcrest.CoreMatchers.not

import org.junit.Assume.assumeThat
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized

import java.io.File


@RunWith(Parameterized::class)
class SamplesSmokeTest(val sampleDir: File) : AbstractIntegrationTest() {

    companion object {
        @Parameterized.Parameters(name = "{0}")
        @JvmStatic fun testCases(): Iterable<File> =
            samplesRootDir.listFiles().filter { it.isDirectory }
    }

    @Before
    fun populateProjectRootWithSample() {
        assumeThat(sampleDir.name, not(containsString("android")))
        // TODO:pm un-ignore build-scan sample test once the breakage is fixed upstream
        assumeThat(sampleDir.name, not(containsString("build-scan")))
        copySampleProject(from = sampleDir, to = projectRoot)
    }

    @Test
    fun `tasks task succeeds on `() {
        build("tasks")
    }
}

package org.gradle.script.lang.kotlin.samples

import org.gradle.script.lang.kotlin.fixtures.AbstractIntegrationTest

import org.hamcrest.CoreMatchers.containsString
import org.hamcrest.CoreMatchers.not

import org.junit.Assume.assumeThat
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized

import java.io.File


@RunWith(Parameterized::class)
class SamplesSmokeTest(val sampleDir: File) : AbstractIntegrationTest() {

    companion object {
        @Parameterized.Parameters(name = "{0}")
        @JvmStatic fun testCases(): Iterable<File> =
            samplesRootDir.listFiles().filter { it.isDirectory }
    }

    @Before
    fun populateProjectRootWithSample() {
        assumeThat(sampleDir.name, not(containsString("android")))
        copySampleProject(from = sampleDir, to = projectRoot)
    }

    @Test
    fun `tasks task succeeds on `() {
        build("tasks")
    }
}

Revert "Temporarily disable build-scan sample test until upstream breakage is fixed"
Revert "Temporarily disable build-scan sample test until upstream breakage is fixed"

This reverts commit 500c27ae5554da40d0aad24214b56a9cf0667cfb.

robinverduijn/gradle,gradle/gradle,gradle/gradle,robinverduijn/gradle,robinverduijn/gradle,robinverduijn/gradle,robinverduijn/gradle,robinverduijn/gradle,blindpirate/gradle,blindpirate/gradle,blindpirate/gradle,blindpirate/gradle,robinverduijn/gradle,blindpirate/gradle,blindpirate/gradle,blindpirate/gradle,gradle/gradle,robinverduijn/gradle,gradle/gradle-script-kotlin,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle-script-kotlin,blindpirate/gradle,blindpirate/gradle,blindpirate/gradle,gradle/gradle,robinverduijn/gradle,gradle/gradle,gradle/gradle,robinverduijn/gradle,robinverduijn/gradle