2

我对 Android 和 gradle 很陌生。我有一个运行良好的应用程序。我现在正在寻找添加测试并让它们在 Jenkins CI 上运行。

我可以在 android studio 中构建和调试应用程序,并从命令行构建。

但是,当我这样做时:

gradle connectedCheck

它说没有找到测试。我有很多当前空的测试,我希望它会运行(有些确实断言为真,只是为了测试测试!)。

我的文件夹结构错了吗?

src
 -instrumentTest
  -java
   -com
    -mycompany
     -myapp
      -test
       -bubbles
        -WindTest.java
       -numberlink
        -NumberLinkLevelsTest.java
       -util
        -SpriteTest.java    
        -Vec3Test.java  
  -main
   -java
    -com
     -mycompany
      -myapp
       -application
        -MainActivity.java  
       -bubbles
        -Wind.java
       -NumberLink
        -NumberLinkLevels.java
       -util
        -Sprite.java    
        -Vec3.java

这是我的 build.gradle:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.5.+'
    }
}
apply plugin: 'android'

dependencies {
    compile files('libs/android-support-v4.jar')
}

android {
    compileSdkVersion 17
    buildToolsVersion "18.0.1"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 16
        testPackageName "com.mycompany.myapp.test"
        testInstrumentationRunner "android.test.InstrumentationTestRunner"
    }
}

感谢您的任何建议。

小号

编辑:

这是 gradle --info clean connectedCheck 的输出:

$ gradle clean connectedCheck --info
Starting Build
Settings evaluated using settings file 'E:\workspace\mycompany\code\trunk\MyAppProject\settings.gradle'.
Projects loaded. Root project using build file 'E:\workspace\mycompany\code\trunk\MyAppProject\build.gradle'.
Included projects: [root project 'MyAppProject', project ':MyApp']
Evaluating root project 'MyAppProject' using build file 'E:\workspace\mycompany\code\trunk\MyAppProject\build.gradle'.
Evaluating project ':MyApp' using build file 'E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build.gradle'.
All projects evaluated.
Selected primary tasks 'clean', 'connectedCheck'
Tasks to be executed: [task ':MyApp:clean', task ':MyApp:prepareDebugDependencies', task ':MyApp:compileDebugAidl', task ':MyApp:generateDebugBuildConfig', task ':MyApp:mergeDebugAssets', task ':MyApp:compileDebugRenderscript', task ':MyApp:mergeDebugResources', task ':MyApp:processDebugManifest', task ':MyApp:processDebugResources', task ':MyApp:compileDebug', task ':MyApp:dexDebug', task ':MyApp:processDebugJavaRes', task ':MyApp:validateDebugSigning', task ':MyApp:packageDebug', task ':MyApp:assembleDebug', task ':MyApp:prepareTestDependencies', task ':MyApp:compileTestAidl', task ':MyApp:processTestTestManifest', task ':MyApp:generateTestBuildConfig', task ':MyApp:mergeTestAssets', task ':MyApp:compileTestRenderscript', task ':MyApp:mergeTestResources', task ':MyApp:processTestResources', task ':MyApp:compileTest', task ':MyApp:dexTest', task ':MyApp:processTestJavaRes', task ':MyApp:packageTest', task ':MyApp:assembleTest', task ':MyApp:connectedInstrumentTest', task ':MyApp:connectedCheck']
:MyApp:clean
Task ':MyApp:clean' has not declared any outputs, assuming that it is out-of-date.
:MyApp:prepareDebugDependencies
Task ':MyApp:prepareDebugDependencies' has not declared any outputs, assuming that it is out-of-date.
:MyApp:compileDebugAidl
Executing task ':MyApp:compileDebugAidl' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\source\aidl\debug has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\aidl\debug has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\aidl\debug\outputs.data has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\aidl\debug\inputs.data has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\aidl\debug\dependency.store has been removed.
No incremental data: full task run
:MyApp:generateDebugBuildConfig
Executing task ':MyApp:generateDebugBuildConfig' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\source\buildConfig\debug has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\source\buildConfig\debug\com\mycompany\myapp\BuildConfig.java has been removed.
:MyApp:mergeDebugAssets
Executing task ':MyApp:mergeDebugAssets' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\mergeAssets\debug has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\assets\debug has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\mergeAssets\debug\inputs.data has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\mergeAssets\debug\outputs.data has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\mergeAssets\debug\merger.xml has been removed.
No incremental data: full task run
:MyApp:compileDebugRenderscript
Executing task ':MyApp:compileDebugRenderscript' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\source\rs\debug has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\rs\debug has changed.
:MyApp:mergeDebugResources
Executing task ':MyApp:mergeDebugResources' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\mergeResources\debug has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\values-v14\values.xml has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\bubble3.png has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\layout\activity_menu.xml has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\mergeResources\debug\merger.xml has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\numbers.png has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\bubble4.png has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\mergeResources\debug\inputs.data has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\hand.png has been removed.
No incremental data: full task run
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\aapt.exe s -i E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\bubble5.png -o E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\bubble5.png
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\aapt.exe s -i E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\bubble3.png -o E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\bubble3.png
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\aapt.exe s -i E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-hdpi\ic_launcher.png -o E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-hdpi\ic_launcher.png
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\aapt.exe s -i E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\bubble4.png -o E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\bubble4.png
Crunching single PNG file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-hdpi\ic_launcher.png
        Output file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-hdpi\ic_launcher.png
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\aapt.exe s -i E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\white.png -o E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\white.png
Crunching single PNG file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\white.png
        Output file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\white.png
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\aapt.exe s -i E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\clouds.png -o E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\clouds.png
Crunching single PNG file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\bubble3.png
        Output file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\bubble3.png
Crunching single PNG file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\clouds.png
        Output file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\clouds.png
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\aapt.exe s -i E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-xhdpi\ic_launcher.png -o E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-xhdpi\ic_launcher.png
Crunching single PNG file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\bubble4.png
        Output file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\bubble4.png
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\aapt.exe s -i E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\ic_launcher.png -o E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\ic_launcher.png
Crunching single PNG file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-xhdpi\ic_launcher.png
        Output file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-xhdpi\ic_launcher.png
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\aapt.exe s -i E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\numbers.png -o E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\numbers.png
Crunching single PNG file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\ic_launcher.png
        Output file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\ic_launcher.png
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\aapt.exe s -i E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\hand.png -o E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\hand.png
Crunching single PNG file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\hand.png
        Output file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\hand.png
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\aapt.exe s -i E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\default_256.png -o E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\default_256.png
Crunching single PNG file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\default_256.png
        Output file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\default_256.png
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\aapt.exe s -i E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-xxhdpi\ic_launcher.png -o E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-xxhdpi\ic_launcher.png
Crunching single PNG file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\numbers.png
        Output file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\numbers.png
Crunching single PNG file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-xxhdpi\ic_launcher.png
        Output file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-xxhdpi\ic_launcher.png
Crunching single PNG file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\src\main\res\drawable-mdpi\bubble5.png
        Output file: E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug\drawable-mdpi\bubble5.png
:MyApp:processDebugManifest
Executing task ':MyApp:processDebugManifest' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\manifests\debug\AndroidManifest.xml has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\manifests\debug\AndroidManifest.xml has been removed.
:MyApp:processDebugResources
Executing task ':MyApp:processDebugResources' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\source\r\debug has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\symbols\debug has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\libs\MyApp-debug.ap_ has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\source\r\debug\com\mycompany\myapp\R.java has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\libs\MyApp-debug.ap_ has been removed.
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\aapt.exe package -f --no-crunch -I E:\3rdParty\Android\sdk\platforms\android-17\android.jar -M E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\manifests\debug\AndroidManifest.xml -S E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\debug -A E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\assets\debug -m -J E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\source\r\debug -F E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\libs\MyApp-debug.ap_ --debug-mode --custom-package com.mycompany.myapp
Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.
:MyApp:compileDebug
Executing task ':MyApp:compileDebug' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\debug has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\dependency-cache\debug has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\debug\com\mycompany\myapp\util\Sprite.class has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\debug\com\mycompany\myapp\R$id.class has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\debug\com\mycompany\myapp\bubbles\Wind.class has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\debug\com\mycompany\myapp\numberlink\NumberLinkActivity.class has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\debug\com\mycompany\myapp\shapes\ShapesActivity.class has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\debug\com\mycompany\myapp\util\Mat3.class has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\debug\com\mycompany\myapp\numberlink\NumberManager$1.class has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\debug\com\mycompany\myapp\util\Vec3.class has been removed.
Compiling with JDK Java compiler API.
:MyApp:dexDebug
Executing task ':MyApp:dexDebug' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\dex\debug has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\libs\MyApp-debug.dex has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\dex\debug\outputs.data has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\dex\debug\inputs.data has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\libs\MyApp-debug.dex has been removed.
No incremental data: full task run
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\dx.bat --dex --output E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\libs\MyApp-debug.dex E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\debug E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\dependency-cache\debug E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\libs\android-support-v4.jar
:MyApp:processDebugJavaRes
Skipping task ':MyApp:processDebugJavaRes' as it has no source files.
:MyApp:processDebugJavaRes UP-TO-DATE
:MyApp:validateDebugSigning
Task ':MyApp:validateDebugSigning' has not declared any outputs, assuming that it is out-of-date.
:MyApp:packageDebug
Executing task ':MyApp:packageDebug' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\apk\MyApp-debug-unaligned.apk has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\apk\MyApp-debug-unaligned.apk has been removed.
:MyApp:assembleDebug
Skipping task ':MyApp:assembleDebug' as it has no actions.
:MyApp:prepareTestDependencies
Task ':MyApp:prepareTestDependencies' has not declared any outputs, assuming that it is out-of-date.
:MyApp:compileTestAidl
Executing task ':MyApp:compileTestAidl' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\aidl\test has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\source\aidl\test has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\aidl\test\dependency.store has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\aidl\test\inputs.data has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\aidl\test\outputs.data has been removed.
No incremental data: full task run
:MyApp:processTestTestManifest
Executing task ':MyApp:processTestTestManifest' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\manifests\test\AndroidManifest.xml has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\manifests\test\AndroidManifest.xml has been removed.
:MyApp:generateTestBuildConfig
Executing task ':MyApp:generateTestBuildConfig' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\source\buildConfig\test has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\source\buildConfig\test\com\mycompany\myapp\test\BuildConfig.java has been removed.
:MyApp:mergeTestAssets
Executing task ':MyApp:mergeTestAssets' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\assets\test has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\mergeAssets\test has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\mergeAssets\test\merger.xml has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\mergeAssets\test\inputs.data has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\mergeAssets\test\outputs.data has been removed.
No incremental data: full task run
:MyApp:compileTestRenderscript
Executing task ':MyApp:compileTestRenderscript' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\source\rs\test has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\rs\test has changed.
:MyApp:mergeTestResources
Executing task ':MyApp:mergeTestResources' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\mergeResources\test has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\test has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\mergeResources\test\outputs.data has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\mergeResources\test\merger.xml has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\mergeResources\test\inputs.data has been removed.
No incremental data: full task run
:MyApp:processTestResources
Executing task ':MyApp:processTestResources' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\symbols\test has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\source\r\test has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\libs\MyApp-test.ap_ has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\libs\MyApp-test.ap_ has been removed.
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\aapt.exe package -f --no-crunch -I E:\3rdParty\Android\sdk\platforms\android-17\android.jar -M E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\manifests\test\AndroidManifest.xml -S E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\res\all\test -A E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\assets\test -m -J E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\source\r\test -F E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\libs\MyApp-test.ap_ --debug-mode
:MyApp:compileTest
Executing task ':MyApp:compileTest' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\test has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\dependency-cache\test has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\test\com\mycompany\myapp\test\bubbles\WindTest.class has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\test\com\mycompany\myapputil\test\Vec3Test.class has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\test\com\mycompany\myappnumberLink\test\NumberLinkLevelsTest.class has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\test\com\mycompany\myapputil\test\SpriteTest.class has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\test\com\mycompany\myapp\test\BuildConfig.class has been removed.
Compiling with JDK Java compiler API.
:MyApp:dexTest
Executing task ':MyApp:dexTest' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\libs\MyApp-test.dex has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\dex\test has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\libs\MyApp-test.dex has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\dex\test\inputs.data has been removed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\incremental\dex\test\outputs.data has been removed.
No incremental data: full task run
command: E:\3rdParty\Android\sdk\build-tools\18.0.1\dx.bat --dex --output E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\libs\MyApp-test.dex E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\classes\test E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\dependency-cache\test
:MyApp:processTestJavaRes
Skipping task ':MyApp:processTestJavaRes' as it has no source files.
:MyApp:processTestJavaRes UP-TO-DATE
:MyApp:packageTest
Executing task ':MyApp:packageTest' due to:
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\apk\MyApp-test-unaligned.apk has changed.
  Output file E:\workspace\mycompany\code\trunk\MyAppProject\MyApp\build\apk\MyApp-test-unaligned.apk has been removed.
:MyApp:assembleTest
Skipping task ':MyApp:assembleTest' as it has no actions.
:MyApp:connectedInstrumentTest
Task ':MyApp:connectedInstrumentTest' has not declared any outputs, assuming that it is out-of-date.
Starting 0 tests on Nexus 4 - 4.3
:MyApp:connectedCheck
Skipping task ':MyApp:connectedCheck' as it has no actions.

BUILD SUCCESSFUL
4

3 回答 3

1

你看到你的测试类被编译了吗?触发时执行哪些任务以及跳过哪些任务

gradle clean connectedTest
于 2013-08-09T23:15:49.893 回答
0

所以我添加了更多测试,并开始运行它们。我真的不知道为什么。

我怀疑其中一个测试顶部的错误包路径导致整个集合失败。如果我有时间我会调查的。

于 2013-08-10T19:26:36.160 回答
0

似乎 Espresso 没有看到没有构造函数的测试:

@SuppressWarnings( "deprecation" )
public YourActivityTest() {
    super(BuildConfig.PACKAGE_NAME, YourActivity.class);
}
于 2014-02-11T08:56:28.843 回答