Skip to content
This repository was archived by the owner on Jul 25, 2019. It is now read-only.
This repository was archived by the owner on Jul 25, 2019. It is now read-only.

Add default VM options to test runs #35

@wesleym

Description

@wesleym

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.

androidUnitTest {
    testTasks {
        all {
            jvmArgs '-noverify'
        }
    }
}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions