Refactor files in the 'spec' package
This commit is contained in:
+7
-3
@@ -3,15 +3,19 @@
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.generators.tests
|
||||
package org.jetbrains.kotlin.spec.tasks
|
||||
|
||||
import org.jetbrains.kotlin.generators.tests.generator.testGroup
|
||||
import org.jetbrains.kotlin.checkers.AbstractDiagnosticsTestSpec
|
||||
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.TEST_PATH
|
||||
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.TESTDATA_PATH
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
testGroup("compiler/tests-spec/tests", "compiler/tests-spec/testData") {
|
||||
fun generateTests() {
|
||||
testGroup(TEST_PATH, TESTDATA_PATH) {
|
||||
testClass<AbstractDiagnosticsTestSpec> {
|
||||
model("diagnostics", excludeDirs = listOf("helpers"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) = generateTests()
|
||||
+3
-3
@@ -5,9 +5,9 @@
|
||||
|
||||
package org.jetbrains.kotlin.spec.tasks
|
||||
|
||||
import org.jetbrains.kotlin.spec.SpecTestsStatElement
|
||||
import org.jetbrains.kotlin.spec.SpecTestsStatElementType
|
||||
import org.jetbrains.kotlin.spec.TestsStatisticCollector
|
||||
import org.jetbrains.kotlin.spec.utils.SpecTestsStatElement
|
||||
import org.jetbrains.kotlin.spec.utils.SpecTestsStatElementType
|
||||
import org.jetbrains.kotlin.spec.utils.TestsStatisticCollector
|
||||
import org.jetbrains.kotlin.spec.validators.SpecTestLinkedType
|
||||
|
||||
const val PRINT_BASE_INDENT = " "
|
||||
|
||||
+1
-2
@@ -3,12 +3,11 @@
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.spec
|
||||
package org.jetbrains.kotlin.spec.utils
|
||||
|
||||
import com.google.gson.*
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import org.jetbrains.kotlin.spec.validators.*
|
||||
import java.io.File
|
||||
|
||||
object TestsJsonMapBuilder {
|
||||
private val stringListType = object : TypeToken<List<String>>() {}.type
|
||||
+3
-5
@@ -3,8 +3,9 @@
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.spec
|
||||
package org.jetbrains.kotlin.spec.utils
|
||||
|
||||
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.TESTDATA_PATH
|
||||
import org.jetbrains.kotlin.spec.validators.*
|
||||
import java.io.File
|
||||
|
||||
@@ -25,8 +26,6 @@ enum class SpecTestsStatElementType {
|
||||
}
|
||||
|
||||
object TestsStatisticCollector {
|
||||
private const val TEST_DATA_DIR = "./testData"
|
||||
|
||||
private fun incrementStatCounters(baseStatElement: SpecTestsStatElement, elementTypes: List<Pair<SpecTestsStatElementType, Any>>) {
|
||||
var currentStatElement = baseStatElement
|
||||
|
||||
@@ -43,8 +42,7 @@ object TestsStatisticCollector {
|
||||
val statistic = mutableMapOf<TestArea, SpecTestsStatElement>()
|
||||
|
||||
for (specTestArea in TestArea.values()) {
|
||||
val specTestsPath =
|
||||
"$TEST_DATA_DIR/${specTestArea.name.toLowerCase()}/${AbstractSpecTestValidator.dirsByLinkedType[testLinkedType]}"
|
||||
val specTestsPath = "$TESTDATA_PATH/${specTestArea.name.toLowerCase()}/${testLinkedType.testDataPath}"
|
||||
|
||||
statistic[specTestArea] = SpecTestsStatElement(SpecTestsStatElementType.AREA)
|
||||
|
||||
Reference in New Issue
Block a user