Unity3D - 无法 运行 通过命令行进行测试

Unity3D - Unable to run test thru command line

我正在尝试使用以下命令 运行 我的 Unity 单元测试:

"C:\Program Files\Unity\Hub\Editor19.4.3f1\Editor\Unity.exe" -runTests -quit -batchmode -projectPath "X:\MyProject" -logFile ./log.txt -testResults ./results.xml

但是没有生成任何报告,也没有向 CMD 控制台发送消息。

这是我在 log.txt 中的内容:

https://pastebin.com/aaZBkmUT

为什么我不能 运行 测试?我做错了什么?

P.S。 ERROR Failed to connect to local IPC 是什么意思?这可能是我出现问题的原因吗?

没有-quit

也可以试试

example 中没有。问题是 afaik 测试 运行 异步所以你可能只是在结果可用之前关闭 Unity


或者我认为您可以添加 -runSynchronously

If included, the test run will run tests synchronously, guaranteeing that all tests runs in one editor update call. Note that this is only supported for EditMode tests, and that tests which take multiple frames (i.e. [UnityTest] tests, or tests with [UnitySetUp] or [UnityTearDown] scaffolding) will be filtered out.

确保您的编辑器在同步完成测试之前保持活动状态