Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Scala tests automatically either after test change or tested class change

Tags:

testing

scala

I'm wondering if there is any solution to let Scala tests run automatically upon change of test class itself or class under the test (just to test automatically pairs Class <---> ClassTest) would be a good start.

like image 421
Jarek Avatar asked Dec 28 '22 22:12

Jarek


1 Answers

sbt can help you with this. After you setup project, just run

~test

~ means continuous execution. So that sbt will watch file system changes and when changes are detected it recompiles changed classes and tests your code. ~testQuick can be even more suitable for you, because it runs only tests, that were changed (including test class and all it's transitive dependencies). You can read more about this here:

http://code.google.com/p/simple-build-tool/wiki/TriggeredExecution

http://php.jglobal.com/blog/?p=363

By the way, ~ also works with other tasks like ~run.

like image 126
tenshi Avatar answered May 26 '23 17:05

tenshi