Skip to content

Add UE 5.7 support and repair the test suite#771

Open
wnddpd01 wants to merge 5 commits into
Tencent:developfrom
wnddpd01:ue5.7-support
Open

Add UE 5.7 support and repair the test suite#771
wnddpd01 wants to merge 5 commits into
Tencent:developfrom
wnddpd01:ue5.7-support

Conversation

@wnddpd01

@wnddpd01 wnddpd01 commented Jul 3, 2026

Copy link
Copy Markdown

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

Test suite fixes (not 5.7-specific)

  • IssueOverridesObject.lua was never committed, so the IssueOverrides test
    always failed on a clean checkout. Reconstructed it from what the C++ test
    expects.
  • The DeadLoopCheck spec deadlocks when it runs right after a PIE-based test:
    UnLua is deactivated on a deferred tick, so Startup() early-returns and
    the timeout never gets applied — this is what froze the editor on full
    suite runs. The spec now calls Shutdown() first.
  • The GetDefaultObject spec read the result with UnLua::GetPointer, which
    returns null for UObject userdata, so it failed even though Lua returned
    the correct CDO. Changed to GetUObject (same as the Load spec) and added
    a null check on LoadClass so 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 only
under nullrhi (it uses UMG), passes in-editor.

Note: loading BP_AIController logs a PawnActionsComponent warning (class
removed from the engine). Left as-is — fixing it requires resaving assets in
5.7, which breaks older engine versions.

wnddpd01 added 5 commits July 3, 2026 23:56
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.
@tencent-adm

tencent-adm commented Jul 3, 2026

Copy link
Copy Markdown
Member

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants