Skip to content

Commit

Permalink
Merge pull request #85 from macisamuele/maci-improve-coverage-report
Browse files Browse the repository at this point in the history
Run integration tests to improve reported coverage
  • Loading branch information
macisamuele committed Jan 27, 2020
2 parents 9a23d29 + 8c20146 commit b81d32c
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions plugin/src/test/java/com/yelp/codegen/MainTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.yelp.codegen
import java.io.File
import org.junit.Test
import org.junit.rules.TemporaryFolder

class MainTest {

private fun runGenerator(platform: String) {
val temporaryFolder = TemporaryFolder()
val junitTestsSpecsPath = File(
// Repo root
File(".").absoluteFile.parentFile.parentFile.absolutePath,
"samples${File.separator}junit-tests${File.separator}junit_tests_specs.json"
).path

try {
temporaryFolder.create()
main(
listOf(
"-p", platform,
"-i", junitTestsSpecsPath,
"-o", temporaryFolder.newFolder("kotlin").absolutePath,
"-s", "junittests",
"-v", "0.0.1",
"-g", "com.yelp.codegen",
"-a", " generatecodesamples"
).toTypedArray()
)
} finally {
temporaryFolder.delete()
}
}

@Test
fun generateKotlinFromJUnitTestSampleSpecs() {
runGenerator("kotlin")
}

@Test
fun generateKotlinCoroutinesFromJUnitTestSampleSpecs() {
runGenerator("kotlin-coroutines")
}
}

0 comments on commit b81d32c

Please sign in to comment.