Created MathCore module, a module meant to regroup all math utils that are not generic enough that they should be in Core (in order not to bloat it) or owned by the foundation team :

* Moved directed graph utils from audio to core, in namespace UE::MathCore::Graph
* Renamed Depth/BreadthFirstTraversal to Depth/BreadthFirstNodeTraversal and added Depth/BreadthFirstEdgeTraversal to traverse the graph edges
* Added FindLeaves method to retrieve graph nodes with no children from a starting node

Created MathCoreTests low-level test executable :
* Moved directed graph unit tests there
* Enabled on CIS on all platforms

#tests low-level tests
#rb chris.constantinescu, danny.couture, phil.popp, johan.torp

[CL 31680629 by jonathan bard in ue5-main branch]
This commit is contained in:
jonathan bard
2024-02-21 09:41:51 -05:00
parent 3d7fe5373c
commit cbdc9b3e1c
13 changed files with 1531 additions and 24 deletions

View File

@@ -0,0 +1,48 @@
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
public class MathCoreTests : TestModuleRules
{
protected Metadata MathCoreTestsMetadata = new Metadata() {
TestName = "MathCore",
TestShortName = "MathCore",
ReportType = "xml",
SupportedPlatforms = {
UnrealTargetPlatform.Win64,
UnrealTargetPlatform.Linux,
UnrealTargetPlatform.Mac,
UnrealTargetPlatform.Android,
UnrealTargetPlatform.IOS } };
/// <summary>
/// Test metadata to be used with BuildGraph
/// </summary>
public Metadata TestMetadata
{
get { return MathCoreTestsMetadata; }
}
public MathCoreTests(ReadOnlyTargetRules Target) : base(Target, InUsesCatch2:true)
{
PrivateDependencyModuleNames.AddRange(
new string[] {
"Core",
"MathCore",
});
string PlatformCompilationArgs;
foreach (var Platform in UnrealTargetPlatform.GetValidPlatforms())
{
if (Platform == UnrealTargetPlatform.Android)
{
PlatformCompilationArgs = "-allmodules -architectures=arm64";
}
else
{
PlatformCompilationArgs = "-allmodules";
}
TestMetadata.PlatformCompilationExtraArgs.Add(Platform, PlatformCompilationArgs);
}
UpdateBuildGraphPropertiesFile(TestMetadata);
}
}

View File

@@ -0,0 +1,15 @@
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
[SupportedPlatforms(UnrealPlatformClass.All)]
public class MathCoreTestsTarget : TestTargetRules
{
public MathCoreTestsTarget(TargetInfo Target) : base(Target)
{
// Collects all tests decorated with #if WITH_LOW_LEVELTESTS from dependencies
// TODO [jonathan.bard] : disabled for now : we can enable this (and move the tests in MathCoreTests to a Tests sub-folder alongside the code they're validating), when https://jira.it.epicgames.com/browse/UE-205189 is implemented :
// Without this, the tests from all linked modules (i.e. Core) would be run as part of this executable, which would be wasteful :
// bWithLowLevelTestsOverride = true;
}
}