0

我已经实现了大量的测试用例,我想避免一次运行它们。

我创建了自己的 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

我的想法不多了。有谁知道这是怎么做到的吗?

谢谢,文森特

4

1 回答 1

0

我不是这方面的专家,但我有一件事要建议。在 CTS 中,有一个包含 xml 文件的计划目录。它们包含用于 startcts 的 CTS 测试列表。你的测试是否在其中任何一个中?

于 2012-02-24T05:37:17.427 回答