[BTA tests] Use arbitrary named versions instead of just numbered ones
^KT-61860 In Progress
This commit is contained in:
committed by
Space Team
parent
bc85375a1e
commit
e302420197
+5
-5
@@ -13,7 +13,7 @@ interface ScenarioModule {
|
|||||||
/**
|
/**
|
||||||
* Performs registered existing file modification.
|
* Performs registered existing file modification.
|
||||||
*
|
*
|
||||||
* Prefer the overload with versioned file modification if it's possible
|
* Prefer using [replaceFileWithVersion] if it's possible
|
||||||
*/
|
*/
|
||||||
fun changeFile(
|
fun changeFile(
|
||||||
fileName: String,
|
fileName: String,
|
||||||
@@ -26,9 +26,9 @@ interface ScenarioModule {
|
|||||||
*
|
*
|
||||||
* Check the example `ExampleIncrementalScenarioTest.testScenario4` out
|
* Check the example `ExampleIncrementalScenarioTest.testScenario4` out
|
||||||
*/
|
*/
|
||||||
fun changeFile(
|
fun replaceFileWithVersion(
|
||||||
fileName: String,
|
fileName: String,
|
||||||
version: UInt,
|
version: String,
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,7 +39,7 @@ interface ScenarioModule {
|
|||||||
/**
|
/**
|
||||||
* Performs registered new file creation.
|
* Performs registered new file creation.
|
||||||
*
|
*
|
||||||
* Prefer the overload with versioned file modification if it's possible
|
* Prefer using [createPredefinedFile] if it's possible
|
||||||
*/
|
*/
|
||||||
fun createFile(fileName: String, content: String)
|
fun createFile(fileName: String, content: String)
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ interface ScenarioModule {
|
|||||||
* Performs registered new file creation by copying a revision from
|
* Performs registered new file creation by copying a revision from
|
||||||
* the file located by path "[fileName].[version]" in the module sources directory.
|
* the file located by path "[fileName].[version]" in the module sources directory.
|
||||||
*/
|
*/
|
||||||
fun createFile(fileName: String, version: UInt)
|
fun createPredefinedFile(fileName: String, version: String)
|
||||||
|
|
||||||
fun compile(
|
fun compile(
|
||||||
forceOutput: LogLevel? = null,
|
forceOutput: LogLevel? = null,
|
||||||
|
|||||||
+2
-2
@@ -32,7 +32,7 @@ internal class ScenarioModuleImpl(
|
|||||||
writeFile(fileName, transform(file.readText()))
|
writeFile(fileName, transform(file.readText()))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun changeFile(fileName: String, version: UInt) {
|
override fun replaceFileWithVersion(fileName: String, version: String) {
|
||||||
val file = module.sourcesDirectory.resolve(fileName)
|
val file = module.sourcesDirectory.resolve(fileName)
|
||||||
val chosenRevision = module.sourcesDirectory.resolve("$fileName.$version")
|
val chosenRevision = module.sourcesDirectory.resolve("$fileName.$version")
|
||||||
Files.delete(file)
|
Files.delete(file)
|
||||||
@@ -50,7 +50,7 @@ internal class ScenarioModuleImpl(
|
|||||||
writeFile(fileName, content)
|
writeFile(fileName, content)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createFile(fileName: String, version: UInt) {
|
override fun createPredefinedFile(fileName: String, version: String) {
|
||||||
val file = module.sourcesDirectory.resolve(fileName)
|
val file = module.sourcesDirectory.resolve(fileName)
|
||||||
val chosenRevision = module.sourcesDirectory.resolve("$fileName.$version")
|
val chosenRevision = module.sourcesDirectory.resolve("$fileName.$version")
|
||||||
Files.copy(chosenRevision, file)
|
Files.copy(chosenRevision, file)
|
||||||
|
|||||||
+2
-2
@@ -129,7 +129,7 @@ class ExampleIncrementalScenarioTest : BaseCompilationTest() {
|
|||||||
val module1 = module("jvm-module-1")
|
val module1 = module("jvm-module-1")
|
||||||
|
|
||||||
// replaces bar.kt with bar.kt.1
|
// replaces bar.kt with bar.kt.1
|
||||||
module1.changeFile("bar.kt", 1U)
|
module1.replaceFileWithVersion("bar.kt", "add-default-argument")
|
||||||
|
|
||||||
module1.compile {
|
module1.compile {
|
||||||
assertCompiledSources("bar.kt")
|
assertCompiledSources("bar.kt")
|
||||||
@@ -146,7 +146,7 @@ class ExampleIncrementalScenarioTest : BaseCompilationTest() {
|
|||||||
val module1 = module("jvm-module-1")
|
val module1 = module("jvm-module-1")
|
||||||
|
|
||||||
// creates secret.kt from secret.kt.1
|
// creates secret.kt from secret.kt.1
|
||||||
module1.createFile("secret.kt", 1U)
|
module1.createPredefinedFile("secret.kt", "new-file")
|
||||||
|
|
||||||
module1.compile {
|
module1.compile {
|
||||||
assertCompiledSources("secret.kt")
|
assertCompiledSources("secret.kt")
|
||||||
|
|||||||
Reference in New Issue
Block a user