Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run integration tests to improve reported coverage #85

Merged
merged 1 commit into from
Jan 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
}
}