unit testing - Why do the tests not run using this gradle script -


using: android studio 1.1.0; gradle (in built)

i'm trying create unit tests , run them. created example project (calculator type deal) tests. ran tests ide , worked correctly. tried same console because ultimate aim run these on integration server, tests don't run. why tests not run console? gradle script have errors?

sorry long post. better give excess data less. i'm total of 1 day old in gradle. , yes, jacoco task because want coverage next. of see empty reports because tests not running suppose.

build.gradle

buildscript {     repositories {         jcenter()     }     dependencies {         classpath 'com.android.tools.build:gradle:1.1.0'          // note: not place application dependencies here; belong         // in individual module build.gradle files     } }  apply plugin: 'java' apply plugin: 'jacoco'  test {     testlogging {         events 'started', 'passed'     } }  jacocotestreport {     reports {         xml.enabled false         csv.enabled false         html.destination "${builddir}/reports"     } }  allprojects {     repositories {         jcenter()     } } 

i use command start test

./gradlew test 

this report get

:compilejava up-to-date :processresources up-to-date :classes up-to-date :compiletestjava up-to-date :processtestresources up-to-date :testclasses up-to-date :test up-to-date :app:prebuild up-to-date :app:predebugbuild up-to-date :app:checkdebugmanifest :app:prereleasebuild up-to-date :app:preparecomandroidsupportappcompatv72200library up-to-date :app:preparecomandroidsupportsupportv42200library up-to-date :app:preparedebugdependencies :app:compiledebugaidl up-to-date :app:compiledebugrenderscript up-to-date :app:generatedebugbuildconfig up-to-date :app:generatedebugassets up-to-date :app:mergedebugassets up-to-date :app:generatedebugresvalues up-to-date :app:generatedebugresources up-to-date :app:mergedebugresources up-to-date :app:processdebugmanifest up-to-date :app:processdebugresources up-to-date :app:generatedebugsources up-to-date :app:compiledebugjava up-to-date :app:precompiledebugunittestjava :app:compiledebugunittestjava up-to-date :app:compiledebugunittestsources up-to-date :app:mockableandroidjar up-to-date :app:assembledebugunittest up-to-date :app:testdebug up-to-date :app:checkreleasemanifest :app:preparereleasedependencies :app:compilereleaseaidl up-to-date :app:compilereleaserenderscript up-to-date :app:generatereleasebuildconfig up-to-date :app:generatereleaseassets up-to-date :app:mergereleaseassets up-to-date :app:generatereleaseresvalues up-to-date :app:generatereleaseresources up-to-date :app:mergereleaseresources up-to-date :app:processreleasemanifest up-to-date :app:processreleaseresources up-to-date :app:generatereleasesources up-to-date :app:compilereleasejava up-to-date :app:precompilereleaseunittestjava :app:compilereleaseunittestjava up-to-date :app:compilereleaseunittestsources up-to-date :app:assemblereleaseunittest up-to-date :app:testrelease up-to-date :app:test up-to-date  build successful  total time: 10.288 secs 

:<module>:test up-to-date because there have been no changes in inputs/outputs of project trigger rebuild.

if want force test run, can cleanup test results before run tests. clean<task> special task cleans output of task.

./gradlew cleantest test

there other options, if want tests always run, can force them never up date modifying task's configuration. in build.gradle file, try:

test {   outputs.uptodatewhen { false } } 

Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -