scala-cli
scala-cli copied to clipboard
scala.NotImplementedError: an implementation is missing when running `scala-cli test .` in a native project
Version(s)
1.2.1
Describe the bug
scala.NotImplementedError: an implementation is missing when running scala-cli test . in a native file.
The stacktrace says:
scala.NotImplementedError: an implementation is missing
scala.Predef$.$qmark$qmark$qmark(Predef.scala:344)
scala.build.testrunner.AsmTestRunner$.matchFingerprints$$anonfun$1(AsmTestRunner.scala:92)
scala.collection.IterableOnceOps.find(IterableOnce.scala:678)
scala.collection.IterableOnceOps.find$(IterableOnce.scala:674)
scala.collection.AbstractIterable.find(Iterable.scala:935)
scala.build.testrunner.AsmTestRunner$.matchFingerprints(AsmTestRunner.scala:93)
scala.build.testrunner.AsmTestRunner$.taskDefs$$anonfun$1(AsmTestRunner.scala:305)
...
so I believe it's coming from here
To Reproduce
With only one file HelloNative.scala:
//> using scala 3.4.1
//> using platform native
//> using nativeVersion 0.5.0-RC3
import scalanative.unsafe.CQuote
import scalanative.libc.stdio
@main
def helloNative: Unit =
stdio.printf(c"hello native %s!\n", c"world")
run scala-cli test . in the same directory.
Expected behaviour
Should finish OK.
It seems the culprit is right around here:
https://github.com/VirtusLab/scala-cli/blob/7767dced75124ff7ade380f6dbdddbe945b0426e/modules/test-runner/src/main/scala/scala/build/testrunner/AsmTestRunner.scala#L84-L92
So this is indeed a missing feature in Scala CLI.