我正在尝试完全理解从我的单元测试生成的最终控制台输出:
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。它不能是平均值,因为每个测试都会显示如下输出:
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)代表什么?
发布于 2013-02-22 07:34:57
0.034是“testDuration”;0.052是“totalDuration”。
以下是SenTestingKit的源代码(旧版本):
+ (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]]);
}不幸的是,对代码的进一步检查并没有揭示两者之间的差异。
https://stackoverflow.com/questions/15014091
复制相似问题