我已经实现了大量的测试用例,我想避免一次运行它们。
我创建了自己的 TestSuite 以便只选择其中的一堆:
package com.mytests;
import junit.framework.Test;
import junit.framework.TestSuite;
import com.mytests.MyTestClass1;
import com.mytests.MyTestClass2;
import com.mytests.MyTestClass3;
public class CustomSuite extends TestSuite {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(createTest(MyTestClass1.class, "test3"));
suite.addTest(createTest(MyTestClass2.class, "test2"));
suite.addTestSuite(MyTestClass3.class);
return suite;
我可以通过 Eclipse (Run As >> Android JUnit Test) 毫无问题地启动它。但我的目标是能够通过 startcts 脚本运行它。
cts_host > start --plan MyPlan -p com.mytests.CustomSuite
The specific test package does not exist: com.mytests.CustomSuite
cts_host > start --plan MyPlan -t com.mytests.CustomSuite#Test
The specific test does not exist: com.mytests.CustomSuite#Test
我的想法不多了。有谁知道这是怎么做到的吗?
谢谢,文森特