-
Notifications
You must be signed in to change notification settings - Fork 17
Add default VM options to test runs #35
Comments
I seem to be able to set the VM options in the Run/Debug Configurations dialog fine but they reset whenever the project syncs / reloads. |
Yep, that's an issue. Maybe a quick way to solve this would be to detect and change only the generated java options instead of blowing them away. Even better would be to read the gradle config, but I'm not sure that's possible since as far as I know, there is no way to pass it to the IDE using the standard android model. |
Can you just add -noverify option by default to work around the Java 1.7 +
|
I don't feel comfortable hard-coding that option since it really shouldn't be something you should be passing all the time. I think making it possible to specify it yourself should be good enough and more flexible. |
+1 to not blowing away custom VM options. We run into OutOfMemory issues with our tests so need to tweak -Xms, -Xmx, -XX:MaxPermSize, etc. I also want to check the run configuration into source control for all our devs. |
Is there any way to programmatically check, if I thought it would be useful for other as well, so I asked the question on StackOverflow |
I have a project set up with android-unit-test and android-studio-unit-test-plugin. When I right-click on a Robolectric test class and run it as a JUnit test, the test fails with a VerifyError. See robolectric/robolectric#1186.
The current workaround is to add
-noverify
as a VM argument. I've been able to do this with the following block in my build.gradle file. When I run tests on the command line (./gradlew test
), the tests work properly.This configuration doesn't translate to the automatically generated run configurations in Android Studio when I run a single test class. I also haven't had any luck modifying the default JUnit configuration in the Edit Configurations dialog. Instead, my workaround is to try to run a test, modify the automatically generated run configuration to add
-noverify
to the VM options, then run the test again.As a feature request, I'd like a way to set default VM options to be added to every test run.
The text was updated successfully, but these errors were encountered: