File tree Expand file tree Collapse file tree 3 files changed +6
-15
lines changed
js/src/main/scala/scoverage
jvm/src/main/scala/scoverage
shared/src/main/scala/scoverage Expand file tree Collapse file tree 3 files changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -18,5 +18,4 @@ object Platform {
1818
1919 lazy val Source = SupportSource
2020
21- val isJvm = false
2221}
Original file line number Diff line number Diff line change @@ -17,6 +17,4 @@ object Platform {
1717 type FileFilter = SupportFileFilter
1818
1919 lazy val Source = SupportSource
20-
21- val isJvm = true
2220}
Original file line number Diff line number Diff line change @@ -56,23 +56,17 @@ object Invoker {
5656 }
5757 val writer = files.getOrElseUpdate(dataDir, new FileWriter (measurementFile(dataDir), true ))
5858
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()
6160 else writer.append(Integer .toString(id)).append(" \n " ).flush()
6261 ids.put(id, ())
6362 }
6463 }
6564
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(" " )
7670
7771 def measurementFile (dataDir : File ): File = measurementFile(dataDir.getAbsolutePath)
7872 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