2019-12-26 15:32:37 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
Copying //UE4/Dev-Automation to //UE4/Dev-Main (Source: //UE4/Dev-Automation @ 3448586)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3383163 on 2017/04/06 by james.fox
Enabling Overlap automation tests.
Change 3387240 on 2017/04/10 by James.Fox
Enabling ProcMesh automation tests. Made minor changes to in-level object names.
Change 3397994 on 2017/04/18 by Nick.Darnell
Automation - Adding some areas for future extension to allow transmission of data, and performance information between controller and client. The next step is to expose a way in blueprints, or via C++ to hook these events and send these messages.
Change 3401903 on 2017/04/20 by samuel.proctor
Test map for blueprint bitwise operators
Change 3405592 on 2017/04/24 by Benjamin.Hyder
Updated Roughness only example to be more visible in Decals test map
Change 3405625 on 2017/04/24 by Benjamin.Hyder
Re-Saving material in decals map to remove log spam
Change 3406256 on 2017/04/24 by Mason.Seay
Show Collision tests, with Ground Truth Screenshots
Change 3410179 on 2017/04/26 by mason.seay
Beginning of Math test map
Change 3412646 on 2017/04/27 by mason.seay
More math tests
Change 3413556 on 2017/04/28 by Adric.Worley
Add support for expected errors in automation tests
Automation tests can now define expected errors/warnings that will not prevent
the test from succeeding. If expected messages are not encountered, the test
will fail. The intent is to allow unit tests to verify negative or error cases
while keeping the test pass report green. It is not intended as an error
suppression system.
#tests new automation tests
Change 3414217 on 2017/04/28 by mason.seay
Wake Event functional test map
Disabled Collision tests that still need review.
Change 3414605 on 2017/04/28 by mason.seay
Added more tests to Math map
Change 3415806 on 2017/05/01 by Adric.Worley
Suspend log parsing during tests with expected errors
Electric Commander was failing successful test passes that have expected errors
because of its log parsing. BenM added markers to temporarily disable error
parsing in CL 3414237, which this implements usage of.
#tests preflight
Change 3416022 on 2017/05/01 by Mason.Seay
Physics/ChildTransform tests
Change 3420820 on 2017/05/03 by Nick.Darnell
Automation - Allowing users to control the delay from the quick getter functions for Default Game/Rendering settings for screenshots. Avoids needing to add more delay nodes to your graph.
Improving the Box Drop example to use the new delay options.
The FunctionalTest actor now ticks even when the game is paused.
Change 3422013 on 2017/05/03 by Nick.Darnell
Automation - Adding an initial version of a ground truth storge mechanism that will only run in the editor. Users can use special runs of their tests to store the ground truth, then rewire things to then in the future read that ground truth. Added an example map showing the usage.
Change 3422802 on 2017/05/04 by Nick.Darnell
Automation - Fixing a crash in the curve asset actions that assumes there will always be import data.
Change 3422803 on 2017/05/04 by Nick.Darnell
Automation - Adding some comments to the ground truth function.
Change 3423739 on 2017/05/04 by Nick.Darnell
Automation - Introducing a way for people to provide Ground Truth for their tests.
Change 3423768 on 2017/05/04 by Nick.Darnell
Automation - GTD can no longer be modified on the build machine. Unchecking modifiable on the example GTD.
Change 3425226 on 2017/05/05 by Nick.Darnell
Automation - Fixing the FinishLoading code to only force shader compilation on platforms that don't require cooking.
#jira UE-44669
Change 3428140 on 2017/05/08 by Ori.Cohen
Added ground truth for scene query testing.
Change 3441024 on 2017/05/16 by Nick.Darnell
Automation - Ground truth pass, improving system based on feedback. Ditching the bCanModify, there's now a way to reset the data, and if it's been filled, you've got to reset it to save over it.
Change 3443894 on 2017/05/17 by Nick.Darnell
Automation - Automation tweaking some logging.
Change 3446426 on 2017/05/18 by Nick.Darnell
Automation - Adding additional logging and attempting to fix the warning on the build machine.
Change 3447617 on 2017/05/18 by Nick.Darnell
Automation - Found an issue with the automation system keeping an old map around if the names were similar enough, and one contained the entirety of the other map's name. This should fix the overlap warnings on the build machine. Also cleaned up several places in the functional test manager that looked like they could cause confusion and problems with cleaning them up.
[CL 3449079 by Nick Darnell in Main branch]
2017-05-19 15:08:55 -04:00
|
|
|
|
|
|
|
|
#include "FunctionalTestUtilityLibrary.h"
|
|
|
|
|
#include "TraceQueryTestResults.h"
|
|
|
|
|
|
|
|
|
|
UTraceQueryTestResults* UFunctionalTestUtilityLibrary::TraceChannelTestUtil(UObject* WorldContextObject, const FTraceChannelTestBatchOptions& BatchOptions, const FVector Start, const FVector End, float SphereCapsuleRadius, float CapsuleHalfHeight, FVector BoxHalfSize, const FRotator Orientation, ETraceTypeQuery TraceChannel, TArray<TEnumAsByte<EObjectTypeQuery> > ObjectTypes, FName ProfileName, bool bTraceComplex, const TArray<AActor*>& ActorsToIgnore, bool bIgnoreSelf, EDrawDebugTrace::Type DrawDebugType, FLinearColor TraceColor, FLinearColor TraceHitColor, float DrawTime)
|
|
|
|
|
{
|
|
|
|
|
UTraceQueryTestResults* Results = NewObject<UTraceQueryTestResults>();
|
|
|
|
|
if(Results)
|
|
|
|
|
{
|
|
|
|
|
//line
|
|
|
|
|
Results->BatchOptions = BatchOptions;
|
|
|
|
|
if(BatchOptions.bLineTrace)
|
|
|
|
|
{
|
|
|
|
|
if(BatchOptions.bChannelTrace)
|
|
|
|
|
{
|
|
|
|
|
Results->ChannelResults.LineResults.bSingleResult = UKismetSystemLibrary::LineTraceSingle(WorldContextObject, Start, End, TraceChannel, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ChannelResults.LineResults.SingleHit, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
Results->ChannelResults.LineResults.bMultiResult = UKismetSystemLibrary::LineTraceMulti(WorldContextObject, Start, End, TraceChannel, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ChannelResults.LineResults.MultiHits, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(BatchOptions.bObjectsTrace)
|
|
|
|
|
{
|
|
|
|
|
Results->ObjectResults.LineResults.bSingleResult = UKismetSystemLibrary::LineTraceSingleForObjects(WorldContextObject, Start, End, ObjectTypes, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ObjectResults.LineResults.SingleHit, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
Results->ObjectResults.LineResults.bMultiResult = UKismetSystemLibrary::LineTraceMultiForObjects(WorldContextObject, Start, End, ObjectTypes, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ObjectResults.LineResults.MultiHits, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(BatchOptions.bProfileTrace)
|
|
|
|
|
{
|
|
|
|
|
Results->ProfileResults.LineResults.bSingleResult = UKismetSystemLibrary::LineTraceSingleByProfile(WorldContextObject, Start, End, ProfileName, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ProfileResults.LineResults.SingleHit, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
Results->ProfileResults.LineResults.bMultiResult = UKismetSystemLibrary::LineTraceMultiByProfile(WorldContextObject, Start, End, ProfileName, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ProfileResults.LineResults.MultiHits, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//sphere
|
|
|
|
|
if(BatchOptions.bSphereTrace)
|
|
|
|
|
{
|
|
|
|
|
if (BatchOptions.bChannelTrace)
|
|
|
|
|
{
|
|
|
|
|
Results->ChannelResults.SphereResults.bSingleResult = UKismetSystemLibrary::SphereTraceSingle(WorldContextObject, Start, End, SphereCapsuleRadius, TraceChannel, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ChannelResults.SphereResults.SingleHit, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
Results->ChannelResults.SphereResults.bMultiResult = UKismetSystemLibrary::SphereTraceMulti(WorldContextObject, Start, End, SphereCapsuleRadius, TraceChannel, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ChannelResults.SphereResults.MultiHits, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (BatchOptions.bObjectsTrace)
|
|
|
|
|
{
|
|
|
|
|
Results->ObjectResults.SphereResults.bSingleResult = UKismetSystemLibrary::SphereTraceSingleForObjects(WorldContextObject, Start, End, SphereCapsuleRadius, ObjectTypes, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ObjectResults.SphereResults.SingleHit, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
Results->ObjectResults.SphereResults.bMultiResult = UKismetSystemLibrary::SphereTraceMultiForObjects(WorldContextObject, Start, End, SphereCapsuleRadius, ObjectTypes, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ObjectResults.SphereResults.MultiHits, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (BatchOptions.bProfileTrace)
|
|
|
|
|
{
|
|
|
|
|
Results->ProfileResults.SphereResults.bSingleResult = UKismetSystemLibrary::SphereTraceSingleByProfile(WorldContextObject, Start, End, SphereCapsuleRadius, ProfileName, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ProfileResults.SphereResults.SingleHit, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
Results->ProfileResults.SphereResults.bMultiResult = UKismetSystemLibrary::SphereTraceMultiByProfile(WorldContextObject, Start, End, SphereCapsuleRadius, ProfileName, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ProfileResults.SphereResults.MultiHits, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//capsule
|
|
|
|
|
if(BatchOptions.bCapsuleTrace)
|
|
|
|
|
{
|
|
|
|
|
if (BatchOptions.bChannelTrace)
|
|
|
|
|
{
|
|
|
|
|
Results->ChannelResults.CapsuleResults.bSingleResult = UKismetSystemLibrary::CapsuleTraceSingle(WorldContextObject, Start, End, SphereCapsuleRadius, CapsuleHalfHeight, TraceChannel, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ChannelResults.CapsuleResults.SingleHit, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
Results->ChannelResults.CapsuleResults.bMultiResult = UKismetSystemLibrary::CapsuleTraceMulti(WorldContextObject, Start, End, SphereCapsuleRadius, CapsuleHalfHeight, TraceChannel, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ChannelResults.CapsuleResults.MultiHits, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (BatchOptions.bObjectsTrace)
|
|
|
|
|
{
|
|
|
|
|
Results->ObjectResults.CapsuleResults.bSingleResult = UKismetSystemLibrary::CapsuleTraceSingleForObjects(WorldContextObject, Start, End, SphereCapsuleRadius, CapsuleHalfHeight, ObjectTypes, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ObjectResults.CapsuleResults.SingleHit, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
Results->ObjectResults.CapsuleResults.bMultiResult = UKismetSystemLibrary::CapsuleTraceMultiForObjects(WorldContextObject, Start, End, SphereCapsuleRadius, CapsuleHalfHeight, ObjectTypes, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ObjectResults.CapsuleResults.MultiHits, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (BatchOptions.bProfileTrace)
|
|
|
|
|
{
|
|
|
|
|
Results->ProfileResults.CapsuleResults.bSingleResult = UKismetSystemLibrary::CapsuleTraceSingleByProfile(WorldContextObject, Start, End, SphereCapsuleRadius, CapsuleHalfHeight, ProfileName, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ProfileResults.CapsuleResults.SingleHit, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
Results->ProfileResults.CapsuleResults.bMultiResult = UKismetSystemLibrary::CapsuleTraceMultiByProfile(WorldContextObject, Start, End, SphereCapsuleRadius, CapsuleHalfHeight, ProfileName, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ProfileResults.CapsuleResults.MultiHits, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//box
|
|
|
|
|
if(BatchOptions.bBoxTrace)
|
|
|
|
|
{
|
|
|
|
|
if (BatchOptions.bChannelTrace)
|
|
|
|
|
{
|
|
|
|
|
Results->ChannelResults.BoxResults.bSingleResult = UKismetSystemLibrary::BoxTraceSingle(WorldContextObject, Start, End, BoxHalfSize, Orientation, TraceChannel, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ChannelResults.BoxResults.SingleHit, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
Results->ChannelResults.BoxResults.bMultiResult = UKismetSystemLibrary::BoxTraceMulti(WorldContextObject, Start, End, BoxHalfSize, Orientation, TraceChannel, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ChannelResults.BoxResults.MultiHits, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (BatchOptions.bObjectsTrace)
|
|
|
|
|
{
|
|
|
|
|
Results->ObjectResults.BoxResults.bSingleResult = UKismetSystemLibrary::BoxTraceSingleForObjects(WorldContextObject, Start, End, BoxHalfSize, Orientation, ObjectTypes, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ObjectResults.BoxResults.SingleHit, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
Results->ObjectResults.BoxResults.bMultiResult = UKismetSystemLibrary::BoxTraceMultiForObjects(WorldContextObject, Start, End, BoxHalfSize, Orientation, ObjectTypes, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ObjectResults.BoxResults.MultiHits, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (BatchOptions.bProfileTrace)
|
|
|
|
|
{
|
|
|
|
|
Results->ProfileResults.BoxResults.bSingleResult = UKismetSystemLibrary::BoxTraceSingleByProfile(WorldContextObject, Start, End, BoxHalfSize, Orientation, ProfileName, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ProfileResults.BoxResults.SingleHit, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
Results->ProfileResults.BoxResults.bMultiResult = UKismetSystemLibrary::BoxTraceMultiByProfile(WorldContextObject, Start, End, BoxHalfSize, Orientation, ProfileName, bTraceComplex, ActorsToIgnore, DrawDebugType, Results->ProfileResults.BoxResults.MultiHits, bIgnoreSelf, TraceColor, TraceHitColor, DrawTime);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Results->CaptureNames();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Results;
|
|
|
|
|
}
|