Skip to content

Commit

Permalink
test: set work dir of Compilation via `io.kotest.engine.spec.Tempdi…
Browse files Browse the repository at this point in the history
…rKt.tempdir`
  • Loading branch information
oldratlee committed Feb 7, 2022
1 parent 5a9f46e commit d7072dd
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.foldright.auto.pipeline.processor.AutoPipelineProcessor
import com.tschuchort.compiletesting.KotlinCompilation
import com.tschuchort.compiletesting.SourceFile
import io.kotest.core.spec.style.AnnotationSpec
import io.kotest.engine.spec.tempdir
import io.kotest.matchers.collections.shouldHaveSize
import io.kotest.matchers.shouldBe
import org.jetbrains.kotlin.konan.file.File
Expand All @@ -22,6 +23,10 @@ class AutoPipelineProcessorTest : AnnotationSpec() {

// see compile diagnostics in real time?
verbose = false

// set work dir via `io.kotest.engine.spec.TempdirKt.tempdir`
// so auto delete the temp dir after test
workingDir = tempdir(AutoPipelineProcessorTest::class.qualifiedName)
}.compile()

compileResult.exitCode shouldBe KotlinCompilation.ExitCode.OK
Expand Down

0 comments on commit d7072dd

Please sign in to comment.