guchenbo / simple-build-tool

Automatically exported from code.google.com/p/simple-build-tool
Other
0 stars 0 forks source link

test.run does not run tests #148

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem (please be specific)?

Using DefaultWebProject, I have the following task:

  lazy val runTheTests = task {
    test.run
  }

What is the expected behavior? What do you see instead?

When I run `sbt test`, it runs a whole bunch of specs tests. But when I run 
`sbt run-the-tests`, it just does compilation:

[info] == run-the-tests ==
[info]   Source analysis: 0 new/modified, 0 indirectly invalidated, 0 removed.
[info] Compiling main sources...
[info] Nothing to compile.
[info]   Post-analysis: 108 classes.
[info]   Source analysis: 0 new/modified, 0 indirectly invalidated, 0 removed.
[info] Compiling test sources...
[info] Nothing to compile.
[info]   Post-analysis: 253 classes.
[info] == run-the-tests ==
[success] Successful.

What versions of the following are you using?

Java: $ java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)

Scala: My app's Scala is 2.8.1 but running sbt under 2.7.7
sbt: sbt 0.7.4 and Scala 2.7.7
Operating system: Ubuntu 10.10

Perhaps I am missing something and should not be running `run`, but I can't see 
anything else on the Task class that looks relevant.

Original issue reported on code.google.com by gfxm...@gmail.com on 22 Feb 2011 at 3:41

GoogleCodeExporter commented 9 years ago
Please use the mailng list for questions.  Thanks!

-Mark

Original comment by dmhar...@gmail.com on 22 Feb 2011 at 11:44

GoogleCodeExporter commented 9 years ago
Thanks for the tip - I asked about this in the mailing list, and was presented 
with a number of useful workarounds. But I still don't see why this is not a 
bug - as far as I know, there is still no way to run the test task from scala 
code without using workarounds.

Original comment by gfxm...@gmail.com on 25 Feb 2011 at 2:47