K2: Support binary library dependencies between test modules

The test infrastructure for analysis supports binary module tests, but
the binary build does not use another binary module as a dependency when
it passes the class path. As a result, each binary module build does not
work when they have dependency on each other.

This commit fixes the issue by
1. Topological sort in the order of dependency graph for test modules.
2. Pass module paths as extra class paths when they have dependency on
   each other.

^KT-64994
This commit is contained in:
Jaebaek Seo
2024-02-08 15:28:42 -08:00
committed by Space Cloud
parent 407448d8e3
commit 512efb9649
17 changed files with 164 additions and 16 deletions
@@ -100,18 +100,22 @@ internal fun AnalysisApiTestGroup.generateAnalysisApiTests() {
component(
"compilerFacility",
filter = testModuleKindIs(TestModuleKind.Source, TestModuleKind.LibrarySource)
filter = testModuleKindIs(TestModuleKind.Source, TestModuleKind.LibrarySource, TestModuleKind.LibraryBinary)
and frontendIs(FrontendKind.Fir)
and analysisSessionModeIs(AnalysisSessionMode.Normal)
and analysisApiModeIs(AnalysisApiMode.Ide)
) {
test(AbstractCompilerFacilityTest::class) {
test(AbstractCompilerFacilityTest::class, filter = testModuleKindIs(TestModuleKind.Source, TestModuleKind.LibrarySource)) {
model("compilation", pattern = TestGeneratorUtil.KT)
}
test(AbstractMultiModuleCompilerFacilityTest::class, filter = testModuleKindIs(TestModuleKind.Source)) {
model("compilationMultiModule", pattern = TestGeneratorUtil.KT)
}
test(AbstractMultiModuleCompilerFacilityTest::class, filter = testModuleKindIs(TestModuleKind.LibraryBinary)) {
model("compilationMultiBinaryModule", pattern = TestGeneratorUtil.KT)
}
}
group(filter = testModuleKindIs(TestModuleKind.Source, TestModuleKind.ScriptSource)) {