File tree 3 files changed +6
-15
lines changed
js/src/main/scala/scoverage
jvm/src/main/scala/scoverage
shared/src/main/scala/scoverage
3 files changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -18,5 +18,4 @@ object Platform {
18
18
19
19
lazy val Source = SupportSource
20
20
21
- val isJvm = false
22
21
}
Original file line number Diff line number Diff line change @@ -17,6 +17,4 @@ object Platform {
17
17
type FileFilter = SupportFileFilter
18
18
19
19
lazy val Source = SupportSource
20
-
21
- val isJvm = true
22
20
}
Original file line number Diff line number Diff line change @@ -56,23 +56,17 @@ object Invoker {
56
56
}
57
57
val writer = files.getOrElseUpdate(dataDir, new FileWriter (measurementFile(dataDir), true ))
58
58
59
- // For some reason, the JS build does not print the output the correct way. I will look into this later.
60
- if (isJvm && reportTestName) writer.append(Integer .toString(id)).append(" " ).append(getCallingScalaTest).append(" \n " ).flush()
59
+ if (reportTestName) writer.append(Integer .toString(id)).append(" " ).append(getCallingScalaTest).append(" \n " ).flush()
61
60
else writer.append(Integer .toString(id)).append(" \n " ).flush()
62
61
ids.put(id, ())
63
62
}
64
63
}
65
64
66
- def getCallingScalaTest : String = {
67
- val st = Thread .currentThread.getStackTrace
68
- val idx = st.indexWhere{
69
- ste => {
70
- val name = ste.getClassName.toLowerCase()
71
- name.endsWith(" suite" ) || name.endsWith(" spec" ) || name.endsWith(" test" )
72
- }
73
- }
74
- if (idx > 0 ) st(idx).getClassName else " "
75
- }
65
+ def getCallingScalaTest : String =
66
+ Thread .currentThread.getStackTrace
67
+ .map(_.getClassName.toLowerCase)
68
+ .find(name => name.endsWith(" suite" ) || name.endsWith(" spec" ) || name.endsWith(" test" ))
69
+ .getOrElse(" " )
76
70
77
71
def measurementFile (dataDir : File ): File = measurementFile(dataDir.getAbsolutePath)
78
72
def measurementFile (dataDir : String ): File = new File (dataDir, MeasurementsPrefix + runtimeUUID + " ." + Thread .currentThread.getId)
You can’t perform that action at this time.
0 commit comments