stevedlawrence commented on code in PR #1375:
URL: https://github.com/apache/daffodil/pull/1375#discussion_r1846997931
##########
daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/RunnerFactory.scala:
##########
@@ -196,6 +196,15 @@ class Runner private (
def this(elem: scala.xml.Elem) =
this(Left(elem))
+ /**
+ * Uses sourcecode library to capture method name
+ * and use it as the test name.
+ *
+ * @param methodName implicitly computed name of method calling this method.
+ */
+ def doTest(implicit methodName: sourcecode.Enclosing): Unit =
+ runOneTest(methodName.value.split("#").last)
Review Comment:
Have you noticed any slowdowns in complication speed? This library seems to
add a bunch of implicits, which I thought could cause issues with compilation
performance?
I also wonder if there's any value in adding our own implementation of this
of this? I always perfer to avoid adding dependencies where possible. And it
looks like Scala already has an `enclosingMethod` macro variable, so I imagine
it's just a matter of writing a macro.
##########
project/Dependencies.scala:
##########
@@ -53,7 +53,8 @@ object Dependencies {
lazy val test = Seq(
"junit" % "junit" % "4.13.2" % "test",
"com.github.sbt" % "junit-interface" % "0.13.3" % "test",
- "org.scalacheck" %% "scalacheck" % "1.18.1" % "test"
+ "org.scalacheck" %% "scalacheck" % "1.18.1" % "test",
+ "com.lihaoyi" %% "sourcecode" % "0.4.1"
Review Comment:
Should this be a "test" dependency? I think we've also been sorting these
alphabetically.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]