UE 自定义的 Automated Tests 没有显示在会话前端 Session FrontEnd 的原因

在看大象无形,我直接拷贝它的代码的,但是我没有看到自定义的测试出现在会话前端

cpp 复制代码
#include "CoreMinimal.h"
#include "Misc/AutomationTest.h"
#include "Logging/LogMacros.h"

#include "TestModulePrivatePCH.h"

DEFINE_LOG_CATEGORY_STATIC(TestLog, Log, All);
IMPLEMENT_SIMPLE_AUTOMATION_TEST(FMultiThreadTest, "MyTest.PublicTest.MultiThreadTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter)

bool FMultiThreadTest::RunTest(const FString& Parameters)
{
	UE_LOG(TestLog, Log, TEXT("FMultiThreadTest begin"));
	return true;
}

之后调好之后发现需要注意两个地方,一个是 UE 里面关于 Test 的插件需要都打开,第二个是需要确保你的定义自动测试的代码所在的模块是被 uproject 包含的

如果确实是被 uproject 包含的,但是仍然没有显示,可能是需要重新编译

可以用 UBT 重新编译

https://forums.unrealengine.com/t/generate-cpp-project-couldnt-find-unrealbuildtool/231288/15?page=3

相关推荐
雾岛听蓝4 小时前
C++11新特性(lambda、包装器)
c++·经验分享·笔记
散峰而望5 小时前
C++ 启程:从历史到实战,揭开命名空间的神秘面纱
c语言·开发语言·数据结构·c++·算法·github·visual studio
PingdiGuo_guo6 小时前
C++数据类型、变量常量
开发语言·c++
水饺编程6 小时前
第4章,[标签 Win32] :TextOut 测试案例3代码改编
c语言·c++·windows·visual studio
Darkwanderor6 小时前
数据结构 - 并查集的应用
数据结构·c++·并查集
多恩Stone6 小时前
【C++ debug】在 VS Code 中无 Attach 调试 Python 调用的 C++ 扩展
开发语言·c++·python
PingdiGuo_guo7 小时前
C++联合体详解!
开发语言·c++
浅念-7 小时前
C++ 继承
开发语言·c++·经验分享·笔记·学习·算法·继承
王老师青少年编程7 小时前
csp信奥赛C++之反素数
数据结构·c++·数学·算法·csp·信奥赛·反素数
YxVoyager9 小时前
基于 X-Macro 宏的手动 RTTI 实现模式
c++