Sử dụng Android studio với phiên bản wrapper gradle 2.2.1, tôi đang cố gắng chạy tất cả các bài kiểm tra trong một lớp thử nghiệm duy nhất, cũng như một bài kiểm tra cụ thể bên trong lớp đó và đã cố gắng sử dụng:Làm thế nào để chạy một thử nghiệm đơn vị bằng cách sử dụng wrapper gradle 2.2.1 từ dòng lệnh
./gradlew test --tests DownloadsActivityTest
như các tài liệu cho thấy, cũng như
-DandroidTest.single=DownloadsActivityTest
Nhưng không ai trong số các phiên bản làm việc.
Làm cách nào để chạy một lớp thử nghiệm duy nhất và một thử nghiệm đơn lẻ từ dòng lệnh bằng cách sử dụng trình bao bọc gradle?
./gradlew --version
------------------------------------------------------------
Gradle 2.2.1
------------------------------------------------------------
Build time: 2014-11-24 09:45:35 UTC
Build number: none
Revision: 6fcb59c06f43a4e6b1bcb401f7686a8601a1fb4a
Groovy: 2.3.6
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.7.0_51 (Oracle Corporation 24.51-b03)
OS: Linux 3.17.6-200.fc20.x86_64 amd64
[16:33][[email protected]:~/myHomeDir]$ ./gradlew test --tests DownloadsActivityTest
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for debugTest as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.3 is ignored for debugTest as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
FAILURE: Build failed with an exception.
* What went wrong:
Problem configuring task :app:test from command line.
> Unknown command-line option '--tests'.
* Try:
Run gradlew help --task :app:test to get task usage details. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4.466 secs
anh ấy đang cố gắng chạy một lớp thử nghiệm duy nhất. mà plugin android studio gradle không hỗ trợ đó là vấn đề – ZakTaccardi