New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose SBT Test Args to tests in the TestSuite #87

Open
russwyte opened this Issue Mar 18, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@russwyte
Copy link

russwyte commented Mar 18, 2016

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

This comment has been minimized.

Copy link

russwyte commented Mar 18, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment