[LL] Add test for KmpModuleSorter

KTIJ-27569
This commit is contained in:
Pavel Kirpichenkov
2023-12-07 20:42:57 +02:00
committed by Space Team
parent ce3c05500e
commit 24b19e3c32
4 changed files with 137 additions and 0 deletions
@@ -0,0 +1,30 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.test.framework
import com.intellij.mock.MockProject
import com.intellij.openapi.project.Project
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.BeforeEach
/**
* Note that the project created by this class is a completely non-functional stub.
* It is only useful in tests that don't depend on Project's functionality.
*/
abstract class TestWithMockProject : TestWithDisposable() {
private var _project: Project? = null
protected val project: Project get() = _project!!
@BeforeEach
fun initProject() {
_project = MockProject(null, disposable)
}
@AfterEach
fun cleanup() {
_project = null
}
}
@@ -25,4 +25,8 @@ class KtSourceModuleImpl(
override val directRegularDependencies: MutableList<KtModule> = mutableListOf()
override val directDependsOnDependencies: MutableList<KtModule> = mutableListOf()
override val directFriendDependencies: MutableList<KtModule> = mutableListOf()
override fun toString(): String {
return moduleName
}
}