launch main/tests with debugging

495 views
Skip to first unread message

Sam Halliday

unread,
Jan 20, 2015, 4:29:13 PM1/20/15
to sbt...@googlegroups.com
Hi all,

I asked this on SO and it's gathering moss: http://stackoverflow.com/questions/26851495

I find it incredibly awkward to have to restart sbt with special flags if I want to run the tests (or a main) with debug enabled. It's also a pain if the main or test is usually in a forked JVM:

How to set fork in Test when -jvm-debug given on command line?

Is there any simple way to conditionally do a runtesttest-quick or test-only and ask for debugging to be enabled in the forked process? e.g. with syntax like test-only -jdb

I don't really want to have to write my own Tasks to do this... maintaining them is going to be a nightmare. But I guess that would allow syntax like module/jdb:test-only

eugene yokota

unread,
Jan 20, 2015, 6:47:13 PM1/20/15
to sbt...@googlegroups.com
Just added an answer there:

> I don't think there's any simple feature that enables debugging out of the box.

> As you mentioned on sbt-dev list, making a custom configuration like 'debug:testOnly' sounds like a good strategy.

If you can implement an AutoPlugin that does this, I think we should accept it as a PR and merge it into our code base.

-eugene


--
You received this message because you are subscribed to the Google Groups "sbt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sbt-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sbt-dev/bde1d5c2-f84a-4ec9-aee7-30c91c34324a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Josh Suereth

unread,
Jan 21, 2015, 8:45:11 AM1/21/15
to sbt...@googlegroups.com
It's actualyl not too hard to add, although having a -debug option in the test input tasks seems like a nice idea.

For now, check out my answer: http://stackoverflow.com/questions/26851495/how-to-run-sbt-tests-with-debugging-enabled/28068751#28068751

That should get you up and running right now.

Sam Halliday

unread,
Jan 22, 2015, 4:13:38 PM1/22/15
to sbt...@googlegroups.com

Thanks both, I'll try to knock something up prior to the ensime 1.0 release and include it as part of our sbt plugin (next 6 months sometime ). Keep me posted if you add it to stock sbt.

You received this message because you are subscribed to a topic in the Google Groups "sbt-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sbt-dev/bHOwIVKB9gM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sbt-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sbt-dev/CAFLqJkwt60OJ2J3Sx67aZ4iTa%2B4FyZ38D8WdDynA_W1gWD4bNw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages