Skip to content

Commit 1493ca0

Browse files
committed
chore: Also add location to failed results
1 parent 974ccd5 commit 1493ca0

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

modules/core/src/main/scala/ch/epfl/scala/debugadapter/testing/TestSuiteEventHandler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ object TestSuiteEventHandler {
4242
failedMsg,
4343
indentSize = 0
4444
)
45-
SingleTestResult.Failed(name, e.duration, formatted, stackTrace)
45+
SingleTestResult.Failed(name, e.duration, formatted, stackTrace, location = null)
4646
case _ =>
4747
SingleTestResult.Skipped(name)
4848
}

modules/core/src/main/scala/ch/epfl/scala/debugadapter/testing/TestSuiteSummary.scala

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ final case class TestSuiteSummary(
1010
tests: java.util.List[SingleTestSummary]
1111
)
1212

13+
final class TestLocation(
14+
val file: String,
15+
val line: Int
16+
)
17+
1318
/**
1419
* Sealed hierarchy that models 3 possible outcomes of single test case.
1520
* I wanted to model this a discriminated union type and due to gson serialization,
@@ -41,10 +46,17 @@ object SingleTestResult {
4146
val testName: String,
4247
val duration: Long,
4348
val error: String,
44-
val stackTrace: String
49+
val stackTrace: String,
50+
val location: TestLocation
4551
) extends SingleTestSummary
4652
object Failed {
47-
def apply(testName: String, duration: Long, error: String, stackTrace: String): Failed =
48-
new Failed("failed", testName, duration, error, stackTrace)
53+
def apply(
54+
testName: String,
55+
duration: Long,
56+
error: String,
57+
stackTrace: String,
58+
location: TestLocation
59+
): Failed =
60+
new Failed("failed", testName, duration, error, stackTrace, location)
4961
}
5062
}

0 commit comments

Comments
 (0)