Skip to content

Commit 061e3c0

Browse files
committed
(#308) Debugger: enable trace logging in tests
1 parent 692ce78 commit 061e3c0

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/test/kotlin/com/intellij/plugin/powershell/testFramework/DebuggerTestBase.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,25 @@ package com.intellij.plugin.powershell.testFramework
33
import com.intellij.openapi.command.WriteCommandAction
44
import com.intellij.openapi.util.ThrowableComputable
55
import com.intellij.openapi.vfs.VfsUtil
6+
import com.intellij.plugin.powershell.lang.debugger.PSDebugClient
67
import com.intellij.psi.PsiFile
78
import com.intellij.psi.PsiManager
9+
import com.intellij.testFramework.TestLoggerFactory
10+
import com.intellij.testFramework.junit5.fixture.disposableFixture
11+
import org.junit.jupiter.api.BeforeEach
812
import kotlin.io.path.Path
913
import kotlin.io.path.createDirectories
1014

11-
abstract class DebuggerTestBase: PowerShellTestBase() {
15+
abstract class DebuggerTestBase : PowerShellTestBase() {
1216

17+
private val disposable = disposableFixture()
1318
private val testData = "testData"
1419

20+
@BeforeEach
21+
fun setUpDebuggerTestBase() {
22+
TestLoggerFactory.enableTraceLogging(disposable.get(), PSDebugClient::class.java)
23+
}
24+
1525
protected fun copyAndOpenFile(nameRelativeToTestData: String): PsiFile {
1626
val fullName = "$testData/$nameRelativeToTestData"
1727
val original = DebuggerTestBase::class.java.classLoader.getResource(fullName)

src/test/kotlin/com/intellij/plugin/powershell/testFramework/PowerShellTestBase.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,10 @@ abstract class PowerShellTestBase {
1616
get() = Path(project.basePath!!)
1717

1818
@BeforeEach
19-
open fun setUp() {
19+
fun setUp() {
2020
project = projectFixture.get()
2121
}
2222

23-
@AfterEach
24-
open fun tearDown() {
25-
}
26-
2723
@AfterEach
2824
fun tearDownEdt() {
2925
runInEdt {

0 commit comments

Comments
 (0)