带有 ctest "Unexpected format: " 错误的 googletest

googletest with ctest "Unexpected format: " error

我有一个使用 googletest 实现的 c++ 测试 class,因此它可以完美地传递 Xcode 并具有以下输出:

[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from test_fixture
[ RUN      ] test_fixture.test_name
[       OK ] test_fixture.test_name (65609 ms)
[----------] 1 test from test_fixture (65609 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (65609 ms total)
[  PASSED  ] 1 test.

但是当我尝试使用 ctest 命令在终端上 运行 相同的测试时,它给出了一个奇怪的错误 Unexpected format:,输出如下:

[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from test_fixture
[ RUN      ] test_fixture.test_name
Unexpected format: [ RUN      ] test_fixture.test_name (it is always printing the above line)

<end of output>
Test time =  29.72 sec

对于Xcode和ctest,使用相同的iOS模拟器,我不明白为什么测试输出给出的结论是"FAILED"或"PASSED"。我已经为这个错误搜索了很多,但找不到任何合理的答案,所以请帮忙。

更新:
事实证明 ios 模拟器工具 ios-sim 对于 运行 超过 30 秒的应用程序有问题(我尝试使用具有三个空函数的 googletest class它们之间延迟 15 秒,应用程序在第二个时崩溃),模拟器使应用程序崩溃但尚未找到原因。

原来 iOS 我使用的是模拟器工具 https://github.com/phonegap/ios-sim
我已经清空了我们的测试 类 并添加了 3 个测试函数,它们之间有 15 秒的延迟,如果应用程序运行时间超过 30 秒,ios-sim 会崩溃。

此案例的解决方案是使用具有类似项目的真实设备:https://github.com/phonegap/ios-deploy