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

相关推荐
hPw0eKIqD9 小时前
C++ 模板参数推导问题小记(非推导上下文)
开发语言·c++
程序员爱德华9 小时前
Python与C++:异同点对比
c++·python
888CC++13 小时前
C语言与C++的区别:从面向过程到面向对象
java·c语言·c++
Darkwanderor14 小时前
Linux系统编程实战项目:模拟实现shell
linux·c++
himobrinehacken14 小时前
揭秘Windows程序启动的神秘之旅
c++·安全
库玛西15 小时前
C++ 运行时多态 :核心总结与原理图解
c语言·c++·笔记
Byron Loong16 小时前
【C++】重定向是什么
开发语言·c++
hansang_IR16 小时前
【题解】LC:Z 算法(Z Algorithm)
c++·算法·字符串
霍霍的袁18 小时前
【C++】模板从入门到进阶(函数模板 + 类模板 + 特化 + 分离编译)
开发语言·c++·visual studio
海清河晏11118 小时前
Qt 实战:信号与槽+事件系统
开发语言·c++·qt