Well, right now, the plugin forces all tests to go into androidTest, 'test' and 'android:test' both run out of that directory, the difference is behavior, the latter treats it as an instrumented test run, the former just runs normal jvm tests.
The hard part is getting all the robolectric stuff to be seen, etc. On Wed, Oct 15, 2014 at 3:48 PM, Daniel Skinner <dan...@dasa.cc> wrote: > I'm mildly curious about this. As for what perry stated, I assumed that > would be for isolated java tests such as junit tests for java code, no > android dependencies. I'd imagine the folder layout would follow the maven > style which last I read is what the recommended layout was for sbt > projects. That would incline me to think that such tests would not be > located at androidTest. > > Don't take this as I know what I'm talking about though. I have some old > code that implements HttpLive to spec that has no android dependencies so > my curiosity arises from running the junit tests I wrote and running those > via `sbt test`, assuming I ported building of this over to sbt of which I > have not currently. > > On Wed, Oct 15, 2014 at 1:44 AM, David Pérez < > david.perez.ingeni...@gmail.com> wrote: > >> Thanks Perry, as always so helpful. :-) >> >> By using "sbt test", and the tests in src/androidTest, I'm still having >> the problem of not loading in the classpath the test dependencies. :-( >> >> Am Dienstag, 14. Oktober 2014 17:46:31 UTC+2 schrieb pfn: >>> >>> by default, all tests in android projects are set to be instrumented. >>> there isn't a really easy way to make it non-instrumented, use 'test' not >>> 'android:test'; and test dependencies should be picked up. you'll probably >>> also want to unset 'android:debug-includes-tests' >>> >>> On Tue, Oct 14, 2014 at 8:41 AM, David Pérez <david.pere...@gmail.com> >>> wrote: >>> >>>> Hi, >>>> >>>> I would like to be able to run my unit tests that use Robolectric from >>>> SBT, and also in IDEA. >>>> I'm using the wonderful android-sdk-plugin. >>>> >>>> I've placed all my tests in src/androidTest/scala. >>>> >>>> The problem I have is that when I try to compile my test code with SBT, >>>> it doesn't find junit, or any other test lib. >>>> >>>> [error] >>>> /home/david/des/android/BiblS/src/androidTest/scala/es/fcc/bibl/bd/TestBd.scala:4: >>>> object junit is not a member of package org >>>> [error] import org.junit.Before >>>> [error] ^ >>>> [error] >>>> /home/david/des/android/BiblS/src/androidTest/scala/es/fcc/bibl/bd/TestBd.scala:5: >>>> object robolectric is not a member of package org >>>> [error] import org.robolectric.Robolectric >>>> >>>> >>>> All the tests belong to a library project: >>>> >>>> My dependencies are as follows: >>>> >>>> libraryDependencies ++= Seq( >>>> "com.novocode" % "junit-interface" % "0.9" % "test", >>>> "junit" % "junit" % "4.11" % "test", >>>> "org.scalatest" %% "scalatest" % "2.1.4" % "test", >>>> "org.robolectric" % "robolectric" % "2.3" % "test" >>>> ) >>>> >>>> >>>> I've tried to find working examples, but found none, except this one: >>>> https://gist.github.com/pfn/5872909 >>>> >>>> I've seen these options that I don't fully understand: >>>> >>>> managedClasspath in Test <++= (platformJars in Android, baseDirectory) >>>> map { >>>> case ((j,_), b) => >>>> Seq(Attributed.blank(b / "bin" / "classes"), >>>> Attributed.blank(file(j))) >>>> }, >>>> exportJars in Test := false, >>>> fullClasspath in Test ~= ( _ filter ( _.data.getName != "classes.jar" >>>> ) ), >>>> fullClasspath in Test <+= (sourceDirectory in Test) map { s => >>>> Attributed.blank(s / "resources") >>>> }, >>>> testOptions in Test += Tests.Argument("-oD"), >>>> javacOptions += "-Xlint:unchecked" >>>> >>>> >>>> but adding this options doesn't help much. >>>> >>>> Any help, please? >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "scala-on-android" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to scala-on-andro...@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "scala-on-android" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to scala-on-android+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "scala-on-android" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scala-on-android+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "scala-on-android" group. To unsubscribe from this group and stop receiving emails from it, send an email to scala-on-android+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.