Add UE 5.7 support and repair the test suite#771
Open
wnddpd01 wants to merge 5 commits into
Open
Conversation
UField::Next became TObjectPtr<UField> in UE 5.7, so walking the Children chain through UField** in ULuaOverridesClass::AddToOwner / RemoveFromOwner no longer compiles (C2440). The Children.Get() local-copy workaround is only needed on 5.3~5.6, where Children is TObjectPtr but Next is still a raw pointer. On 5.7+ both are TObjectPtr again, so scope the workaround to that range and let every other version walk the chain in place (as UField** before 5.3, as TObjectPtr<UField>* on 5.7+). Walking in place also means inserting into an empty chain and removing the head update the real class instead of a local copy. Fixes Tencent#763
UE 5.7 installed builds validate the shared build environment and reject targets whose BuildSettingsVersion computes settings that differ from the engine defaults (UndefinedIdentifierWarningLevel: Off != Error), failing before compilation starts. Use BuildSettingsVersion.V6 on 5.7+ for all three TPSProject targets and bump EngineAssociation to 5.7, mirroring how V4/5.6 was adopted.
UIssueOverridesObject binds to the Lua module Tests.Regression.IssueOverrides.IssueOverridesObject, but that file was never committed, so the IssueOverrides regression test always failed its require with "module not found". Reconstruct the script from the C++ test contract: CollectInfo is overridden to return the native result plus one (expected 2), while GetConfig stays unoverridden (expected 1).
PIE-based tests deactivate UnLua on a deferred tick via the EndPlayMap delegate. When the DeadLoopCheck spec runs before that tick, UnLua::Startup() early-returns without applying the DeadLoopCheck setting to FDeadLoopCheck::Timeout, so the spec's intentionally infinite Lua chunk runs without a guard and deadlocks the game thread. Running the full suite reliably froze the editor at this spec. Force Shutdown() first so Startup() always applies the setting.
The spec read the Lua return value with UnLua::GetPointer, which returns null for UObject userdata managed by FObjectRegistry, so the comparison always failed even though Lua returned the correct CDO. Use UnLua::GetUObject like the sibling Load spec. Also guard the LoadClass result: in projects without the BP_Game asset the spec dereferenced null and crashed the whole run.
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds UE 5.7 support. Two changes are needed for 5.7 itself; the other three
commits fix test suite problems I hit while verifying on a clean checkout.
5.7 support
UField::NextisTObjectPtr<UField>in 5.7, so theUField**chain walkin
ULuaOverridesClassno longer compiles (fixes UE5.7 compilation error C2440: “=”: 无法从“TObjectPtr<UField> *”转换为“T **” #763). TheChildren.Get()copy workaround is now limited to 5.3~5.6; other versions walk the chain
in place.
BuildSettingsVersion.V6on 5.7+. Installed 5.7builds reject the V4 profile before compiling
(
UndefinedIdentifierWarningLevel: Off != Error).Test suite fixes (not 5.7-specific)
IssueOverridesObject.luawas never committed, so the IssueOverrides testalways failed on a clean checkout. Reconstructed it from what the C++ test
expects.
UnLua is deactivated on a deferred tick, so
Startup()early-returns andthe timeout never gets applied — this is what froze the editor on full
suite runs. The spec now calls
Shutdown()first.UnLua::GetPointer, whichreturns null for UObject userdata, so it failed even though Lua returned
the correct CDO. Changed to
GetUObject(same as the Load spec) and addeda null check on
LoadClassso a missing asset doesn't crash the run.Tests: full UnLua suite on UE 5.7.4, Win64.
In-editor: 327/327. Headless (
-nullrhi): 326/327 — Issue434 fails onlyunder nullrhi (it uses UMG), passes in-editor.
Note: loading
BP_AIControllerlogs aPawnActionsComponentwarning (classremoved from the engine). Left as-is — fixing it requires resaving assets in
5.7, which breaks older engine versions.