[Tests] Add spec tests in FIR + LightTree configuration

In some tests PSI and LT differ. Test data was fixed accordingly.

In the following tests I consider that difference is acceptable:
- compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/neg/3.1.kt
- compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/neg/4.1.kt

This is because:
- It only happens when recovering from syntax errors happened above in
code. I was unable to reproduce it in valid code.
- It doesn't break parsing further, the rest of the errors in file are
reported identically.

The rest of the tests will be fixed in subsequent commits.

^KT-62704 Fixed
This commit is contained in:
Roman Efremov
2024-01-25 17:06:57 +01:00
committed by Space Team
parent 18b9cf3bc6
commit 8edb1842a5
11 changed files with 7758 additions and 11 deletions
@@ -15,6 +15,7 @@ import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.SPEC_TEST_PATH
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.TESTS_MAP_FILENAME
import org.jetbrains.kotlin.spec.utils.SectionsJsonMapGenerator
import org.jetbrains.kotlin.spec.utils.TestsJsonMapGenerator
import org.jetbrains.kotlin.test.runners.AbstractFirLightTreeDiagnosticTestSpec
import org.jetbrains.kotlin.test.runners.AbstractFirPsiDiagnosticTestSpec
import org.jetbrains.kotlin.test.utils.CUSTOM_TEST_DATA_EXTENSION_PATTERN
import java.io.File
@@ -72,6 +73,13 @@ fun generateTests() {
excludedPattern = CUSTOM_TEST_DATA_EXTENSION_PATTERN
)
}
testClass<AbstractFirLightTreeDiagnosticTestSpec> {
model(
"diagnostics",
excludeDirs = listOf("helpers") + detectDirsWithTestsMapFileOnly("diagnostics"),
excludedPattern = CUSTOM_TEST_DATA_EXTENSION_PATTERN
)
}
}
}
}