Files
o3de/Gems/SurfaceData/Code/Tests/SurfaceDataTestFixtures.h
T
Mike Balfour b975111a93 Add benchmarks and unit tests for GetSurfacePoints*. (#7216)
* Add benchmarks and unit tests for GetSurfacePoints*.
The benchmarks are very enlightening - the existing implementation of GetSurfacePointsFromRegion (and GetSurfacePointsFromList) is currently measurably *slower* than just calling GetSurfacePoints() many times in a loop.  This is due to all of the extra allocation overhead that's currently happening with the way these data structures are built.

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

* Small syntax improvement

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

* Small update to the benchmark to use filtered results.

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

* Removed accidental extra include.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
2022-01-31 12:54:16 -06:00

44 lines
1.1 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 <AzTest/GemTestEnvironment.h>
namespace UnitTest
{
// SurfaceData needs to use the GemTestEnvironment to load the LmbrCentral Gem so that Shape components can be used
// in the unit tests and benchmarks.
class SurfaceDataTestEnvironment
: public AZ::Test::GemTestEnvironment
{
public:
void AddGemsAndComponents() override;
};
#ifdef HAVE_BENCHMARK
//! The Benchmark environment is used for one time setup and tear down of shared resources
class SurfaceDataBenchmarkEnvironment
: public AZ::Test::BenchmarkEnvironmentBase
, public SurfaceDataTestEnvironment
{
protected:
void SetUpBenchmark() override
{
SetupEnvironment();
}
void TearDownBenchmark() override
{
TeardownEnvironment();
}
};
#endif
}