首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >了解SenTestingKit日志输出

了解SenTestingKit日志输出
EN

Stack Overflow用户
提问于 2013-02-22 07:16:55
回答 1查看 120关注 0票数 0

我正在尝试完全理解从我的单元测试生成的最终控制台输出:

代码语言:javascript
复制
Test Suite 'Multiple Selected Tests' finished at 2013-02-21 22:54:57 +0000.
Executed 6 tests, with 0 failures (0 unexpected) in 0.034 (0.052) seconds

其中大部分是不言而喻的,但最后一点我不确定。特别是in 0.034 (0.052) seconds。它不能是平均值,因为每个测试都会显示如下输出:

代码语言:javascript
复制
Test Suite 'MMProductLogicTests' started at 2013-02-21 22:54:57 +0000 Test Case
-[MMProductLogicTests testProductMissingFormURL]' started.
Test Case '-[MMProductLogicTests testProductMissingFormURL]' passed (0.005 seconds).
Test Suite 'MMProductLogicTests' finished at 2013-02-21 22:54:57 +0000.

所有六个测试都显示passed (0.005 seconds),所以平均值没有意义。0.034似乎是执行的总时间,我搞不懂(0.052)代表什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-02-22 07:34:57

0.034是“testDuration”;0.052是“totalDuration”。

以下是SenTestingKit的源代码(旧版本):

代码语言:javascript
复制
   + (void) testSuiteDidStop:(NSNotification *) aNotification
    {
        SenTestRun *run = [aNotification run];
        testlog ([NSString stringWithFormat:@"Test Suite '%@' finished at %@.\nPassed %d test%s, with %d failure%s (%d unexpected) in %.3f (%.3f) seconds\n",
            [run test],
            [run stopDate],
            [run testCaseCount], ([run testCaseCount] != 1 ? "s" : ""),
            [run totalFailureCount], ([run totalFailureCount] != 1 ? "s" : ""),
            [run unexpectedExceptionCount],
            [run testDuration],
            [run totalDuration]]);
    }

不幸的是,对代码的进一步检查并没有揭示两者之间的差异。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15014091

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档