Haxe的代码覆盖率

问题描述 投票:4回答:1

我们假设我有一个像这样的单元测试:

import haxe.unit.TestRunner;
import haxe.unit.TestCase;

class MyTests extends haxe.unit.TestCase {
    public function testSomething():Void {
        // ...
    }
    public function testSomethingElse():Void {
        // ...
    }
    public static function main():Void {
        var tr = new TestRunner();
        tr.add(new MyTests());
        tr.run();
    }
}

现在,在运行我的测试之后,我想分析,我的代码的哪些行经过了测试,哪些不是(代码覆盖率)......或者至少看看在测试运行期间某个类的哪些函数已被执行(只是为了防止这种情况)我没有忘记测试任何功能)。我怎样才能做到这一点?

code-coverage haxe
1个回答
3
投票

MCover目前是目前唯一真正的选择。还有一种叫做coverme,但它还不适合公众使用。

© www.soinside.com 2019 - 2024. All rights reserved.