[Test] Add ability to specify directive for test file
Rules of directives resolving: - If no `MODULE` or `FILE` was declared in test then all directives belongs to module - If `FILE` is declared, then all directives after it will belong to file until next `FILE` or `MODULE` directive will be declared - All directives between `MODULE` and `FILE` directives belongs to module - All directives before first `MODULE` are global and belongs to each declared module
This commit is contained in:
committed by
TeamCityServer
parent
e17153fab9
commit
28cff22cd0
@@ -43,7 +43,8 @@ class TestFile(
|
||||
* isAdditional means that this file provided as addition to sources of testdata
|
||||
* and there is no need to apply any handlers or preprocessors over it
|
||||
*/
|
||||
val isAdditional: Boolean
|
||||
val isAdditional: Boolean,
|
||||
val directives: RegisteredDirectives
|
||||
) {
|
||||
val name: String = relativePath.split("/").last()
|
||||
}
|
||||
|
||||
+8
-1
@@ -26,7 +26,14 @@ abstract class AdditionalSourceProvider(val testServices: TestServices) {
|
||||
}
|
||||
|
||||
protected fun File.toTestFile(): TestFile {
|
||||
return TestFile(this.name, this.readText(), this, startLineNumberInOriginalFile = 0, isAdditional = true)
|
||||
return TestFile(
|
||||
this.name,
|
||||
this.readText(),
|
||||
originalFile = this,
|
||||
startLineNumberInOriginalFile = 0,
|
||||
isAdditional = true,
|
||||
directives = RegisteredDirectives.Empty
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user