If your project requires any special options to the JVM to run, these can be passed to Diffblue Cover using the JVM_ARG environment variable.
This page outlines how to set particular parameters required by your application using JVM environment variables, project environment variables or system properties.
If your project requires any particular JVM options to, these can be passed to Cover using the
JVM_ARGSenvironment variable. This is useful if you need to pass the details of a user id, or which database to use, as properties to the JVM. The two examples below show passing a user_id with an authentication token:
set JVM_ARGS="-Duser_id=Sue -Duser_auth_token=1234"
export JVM_ARGS="-Duser_id=Sue -Duser_auth_token=1234"
Any environment variables that your project requires at runtime should be set in the environment in which you are running Cover. If this is not possible then the
--environment KEY=VALUEcommand line option can be used to configure additional environment variables.
Note that if tests are created using environment variables you should ensure that those same environment variables are available to test execution. Therefore you may need to configure your build tool (
Gradle) to supply your environment variables to your tests.
--defineoption allows the user to pass additional system properties to
dcoverfor test creation and execution.
Any created tests may depend upon these user-specified system properties and may not execute successfully without them.
Therefore you will need to configure test execution in your build script to supply any user-specified system properties when executing those tests outside