This commit fixes test infrastructure issue.
Usage of "COMPILER_ARGUMENTS" test-data-instruction resulted in side
effect. Test cases following the one that used it got broken
LanguageVersionSetting - LanguageFeature.MultiPlatformProjects escaped,
languageVersion could be wrong.
Why it happened
KotlinProjectDescriptorWithFacet defines default values
of (language-version, isMultiplatform) settings for the test-case.
The values themselves are stored in KotlinFacetSettings and passed there
only once. After every test-case (if it uses "COMPILER_ARGUMENTS")
infrastructure calls
KotlinLightCodeInsightFixtureTestCaseKt#rollbackCompilerOptions which
resets mentioned values (among others) in KotlinFacetSettings.
Instances of KotlinProjectDescriptorWithFacet are reused hence facet
settings remained reset.
This is needed to provide ability for declaring new implementations of
test generators, based on existing infrastructure, which won't add
dependency on :compiler:tests-common
Also this commit removes implicit dependency on :compiler:tests-common
from :compiler:tests-common-new
This is needed because of following problem:
- :tests-mutes has `implementation` dependency on khttp library
- khttp has dependency on spek-junit-platform-engine library
- :tests-common had `testCompile` dependency on :tests-mutes which
added spek library as as a dependency to all modules which depend
on :tests-common, including :tests-common-new
Then, if project is configured with JPS then if user tries to run all
tests in directory in module which uses JUnit 5 (like :tests-common-new)
then spek library will be added to classpath and junit runner takes
some platform extension from it which causes NoSuchMethodException
because spek library was compiled against outdated JUnit 5 version
and current version doesn't have some API.
So splitting :tests-mutes for two parts fixes this issue, because common
part (:compiler:tests-mutes) no longer depends on khttp, so spek
library doesn't spreads to all modules
Also minimize scope of DiagnosticUsingJavac tests to
`compiler/testData/diagnostics/tests/javac`. This is fine since
javac compilation mode is still not finished and no one not going to
support it
There was a refactoring of AbstractDiagnosticsTest in 9052ef06 which
contains bug that `setupEnvironment` for AbstractDiagnosticsTestUsingJavac
was not called, so for last year tests `UsingJavac` had no difference
with usual diagnostics tests which causes some contradictions in test data
There is an a optimization in our `projectTest` config which filters
out some compiled test classes if they didn't contain specified test
(if user ran :test task with --tests flag). This optimization for one
tests left only one .class file which contains test. But JUnit 5 for
tests in inner classes (with @Nested annotation) requires not only
target class, but and all it's containers
Test: package.SomeTest$Nested.testMethod
JUnit4: package/SomeTest$Nested.class
JUnit5:
- package/SomeTest.class
- package/SomeTest$Nested.class
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive