Created
April 26, 2012 21:46
-
-
Save pfn/2503441 to your computer and use it in GitHub Desktop.
sbt configuration for testing with robolectric
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AndroidKeys._ | |
libraryDependencies ++= Seq( | |
"com.pivotallabs" % "robolectric" % "1.1" % "test", | |
"junit" % "junit" % "4.8.2" % "test", | |
"xpp3" % "xpp3" % "1.1.4c" % "test", | |
"org.scalatest" %% "scalatest" % "1.7.1" % "test" | |
) | |
seq(androidBuildSettings: _*) | |
managedClasspath in Test <++= (platformJar in Android, baseDirectory) map { | |
(j, b) => | |
Seq(Attributed.blank(b / "bin" / "classes"), Attributed.blank(file(j))) | |
} | |
exportJars in Test := false |
Shouldn't need an example project, just put any junit or scalatest case in test/ of an existing android project; run sbt test to execute the test case, see the robolectric docs for how to write a test case with robolectric.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Where can I find example project with "robolectric"?
Thanks!
Roman