M.A*_*ali 9 android unit-testing android-gradle-plugin android-instrumentation android-junit
在我的 Android 应用程序中,我有几个测试类。如果我运行以下命令,./gradlew connectedAndroidTest
它将运行 android test 文件夹中的所有测试用例并为所有测试类生成测试报告,但我需要测试特定的测试类并为我尝试使用以下命令的测试类生成报告:
./gradlew test --tests com.login.user.UserLoginTest
Run Code Online (Sandbox Code Playgroud)
上面的命令抛出以下异常
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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
My app gradle version is 3.3
Run Code Online (Sandbox Code Playgroud)
Jua*_*nez 17
如果您的项目中有多种风格,您可能会收到此错误。与其使用 just test
,不如尝试一个特定的测试任务:
./gradlew testDebugUnitTest --tests com.login.user.UserLoginTest
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5851 次 |
最近记录: |