utest icon indicating copy to clipboard operation
utest copied to clipboard

Expose SBT Test Args to tests in the TestSuite

Open russwyte opened this issue 8 years ago • 1 comments

It would be helpful to allow developers to have access to configuration details which are passed to the test Framework via args.

in SBT: testOptions in Test += Tests.Argument(file("").toURI.toString)

Example: def runner(args: Array[String], remoteArgs: Array[String], testClassLoader: ClassLoader) could forward the args array to the test suite and make it available - perhaps via an implicit similar to utest.framework.TestPath

This would allow tests to utilize values that come from SBT itself. Such as a URI to directory of the current project as above. The can be very handy when you need to functionally test things that require AJAX requests to a project file within a scala.js project.

Thanks

russwyte avatar Mar 18 '16 20:03 russwyte

One way to do this would be to expose a config map driven by -D{key}={val} args similar to the way scalatest does here:

http://www.artima.com/docs-scalatest-3.0.0-M15/#org.scalatest.ConfigMap

http://www.scalatest.org/user_guide/using_the_runner

russwyte avatar Mar 18 '16 21:03 russwyte