Note that there are some explanatory texts on larger screens.

plurals
  1. POGradle Android testing
    primarykey
    data
    text
    <p>I'm new to gradle and Android Studio, and I'm trying to figure out how to run tests. I followed instructions in <a href="http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Testing" rel="noreferrer">http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Testing</a> and I'm able to run Instrument Tests but only executing <code>/gradlew connectedInstrumentTest</code>. I'm having troubles understanding the other <code>check</code> tasks, that don't execute any code in my app. This is what <code>./gradlew tasks prints</code></p> <pre><code>... Verification tasks ------------------ check - Runs all checks. connectedCheck - Runs all device checks on currently connected devices. connectedInstrumentTest - Installs and runs the tests for Build 'Debug' on connected devices. deviceCheck - Runs all device checks using Device Providers and Test Servers. ... </code></pre> <p>If <code>check</code> runs all checks... shouldn't it run the ones I get from <code>connectedInstrumentTest</code>?</p> <p>Also, how can I run tests that don't need the Android environment? Should I place them under /test/java ? If so, what command should I run to execute them?</p> <p>Sorry if these questions seem very obvious, but I just haven't been able to find any answer to these questions in the docs. </p> <p>Thank you!</p> <p><strong>Edit:</strong></p> <p>So I have made some progress here. It looks like <code>check</code> is not doing anything. It would be (right now) up the developer to add dependant tasks to <code>check</code> to run some JUnit tests. You will need to have to create a task, make it find the sources, compile them and run them. </p> <p><code>connectedCheck</code>and <code>connectedInstrumentTest</code>: runs instrumentationTest in the device. (this always worked).</p> <p><code>deviceCheck</code>: This is useful, as the docs say, for Continuos integration testing.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload