[PL][tests] K/JS: Run compiler through CLI interface

This commit is contained in:
Dmitriy Dolovov
2023-07-11 16:58:12 +02:00
committed by Space Team
parent 19c6208cc0
commit 715aba3d18
2 changed files with 128 additions and 279 deletions
@@ -21,7 +21,7 @@ object PartialLinkageTestUtils {
val testModeConstructorParameters: Map<String, String>
// Customize the source code of a module before compiling it to a KLIB.
fun customizeModuleSources(moduleName: String, moduleSourceDir: File) = Unit
fun customizeModuleSources(moduleName: String, moduleSourceDir: File)
// Build a KLIB from a module.
fun buildKlib(moduleName: String, buildDirs: ModuleBuildDirs, dependencies: Dependencies, klibFile: File)
@@ -93,6 +93,9 @@ object PartialLinkageTestUtils {
// Populate the source dir with *.kt files.
copySources(from = moduleTestDir, to = moduleBuildDirs.sourceDir)
// Customize the source dir if necessary.
customizeModuleSources(moduleName, moduleBuildDirs.sourceDir)
// Include PL utils into the main module.
if (moduleName == MAIN_MODULE_NAME) {
val utilsDir = testDir.parentFile.resolve(PL_UTILS_DIR)
@@ -110,8 +113,6 @@ object PartialLinkageTestUtils {
}
}
customizeModuleSources(moduleName, moduleBuildDirs.sourceDir)
moduleBuildDirs.outputDir.apply { mkdirs() }
this[moduleName] = ModuleUnderTest(