Files
o3de/Gems/FastNoise/Code/Tests/FastNoiseTest.h
T
Mike Balfour 2b43ad8029 FastNoise GetValues() specialization (#7009)
* Add comparison operator for use from unit tests.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* First version of FastNoise benchmarks.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Simplified unit tests and added initial benchmarks.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Add GetValue vs GetValues unit test.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Moved Gradient test code into helper files for use from FastNoise.
Also added benchmarks for each type of FastNoise so that we can have some comparative values handy.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Specialization for GetValues().

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
2022-01-19 17:10:37 -06:00

61 lines
1.8 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzFramework/Components/TransformComponent.h>
#include <AzTest/GemTestEnvironment.h>
#include <FastNoiseGradientComponent.h>
#include <FastNoiseSystemComponent.h>
namespace UnitTest
{
// The FastNoise unit tests need to use the GemTestEnvironment to load the GradientSignal and LmbrCentral Gems so that
// GradientTransform components can be used in the unit tests and benchmarks.
class FastNoiseTestEnvironment
: public AZ::Test::GemTestEnvironment
{
public:
void AddGemsAndComponents() override
{
AddDynamicModulePaths({ "GradientSignal" });
AddDynamicModulePaths({ "LmbrCentral" });
AddComponentDescriptors({
AzFramework::TransformComponent::CreateDescriptor(),
FastNoiseGem::FastNoiseSystemComponent::CreateDescriptor(),
FastNoiseGem::FastNoiseGradientComponent::CreateDescriptor()
});
AddRequiredComponents({ FastNoiseGem::FastNoiseSystemComponent::TYPEINFO_Uuid() });
}
};
#ifdef HAVE_BENCHMARK
//! The Benchmark environment is used for one time setup and tear down of shared resources
class FastNoiseBenchmarkEnvironment
: public AZ::Test::BenchmarkEnvironmentBase
, public FastNoiseTestEnvironment
{
protected:
void SetUpBenchmark() override
{
SetupEnvironment();
}
void TearDownBenchmark() override
{
TeardownEnvironment();
}
};
#endif
} // namespace UnitTest