Address PR comments

This commit is contained in:
John
2021-06-10 14:54:46 +01:00
parent fdbc15b195
commit 169d4da288
32 changed files with 1631 additions and 164 deletions
@@ -9,5 +9,4 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
add_subdirectory(Executable)
add_subdirectory(Static)
add_subdirectory(Code)
@@ -24,27 +24,42 @@ ly_add_target(
AZ::TestImpact.Runtime.Static
)
ly_add_target(
NAME TestImpact.Frontend.Console EXECUTABLE
OUTPUT_NAME tiaf
NAMESPACE AZ
FILES_CMAKE
testimpactframework_frontend_console_files.cmake
INCLUDE_DIRECTORIES
PRIVATE
Source
BUILD_DEPENDENCIES
PRIVATE
AZ::TestImpact.Frontend.Console.Static
)
################################################################################
# Tests
################################################################################
ly_add_target(
NAME TestImpact.Frontend.Console.Static.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
NAMESPACE AZ
FILES_CMAKE
testimpactframework_frontend_console_static_tests_files.cmake
INCLUDE_DIRECTORIES
PRIVATE
Include
Source
Tests
BUILD_DEPENDENCIES
PRIVATE
AZ::AzTestShared
AZ::AzTest
AZ::TestImpact.Frontend.Console.Static
)
ly_add_googletest(
NAME AZ::TestImpact.Frontend.Console.Static.Tests
)
# Disbled:SPEC-7246
#ly_add_target(
# NAME TestImpact.Frontend.Console.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
# NAMESPACE AZ
# FILES_CMAKE
# testimpactframework_frontend_console_static_tests_files.cmake
# INCLUDE_DIRECTORIES
# PRIVATE
# Include
# Source
# Tests
# BUILD_DEPENDENCIES
# PRIVATE
# AZ::AzTestShared
# AZ::AzTest
# AZ::TestImpact.Frontend.Console.Static
#)
#
#ly_add_googletest(
# NAME AZ::TestImpact.Frontend.Console.Static.Tests
#)
@@ -0,0 +1,42 @@
///*
// * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
// * its licensors.
// *
// * For complete copyright and license terms please see the LICENSE at the root of this
// * distribution (the "License"). All use of this software is governed by the License,
// * or, if provided, by the license below or the license accompanying this file. Do not
// * remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// *
// */
//
//#include <TestImpactFramework/TestImpactClientTestSelection.h>
//#include <TestImpactFramework/TestImpactClientTestRun.h>
//
//#include <TestImpactConsoleTestSequenceEventHandler.h>
//
//#include <AzCore/std/containers/vector.h>
//#include <AzCore/std/smart_ptr/unique_ptr.h>
//#include <AzCore/UnitTest/TestTypes.h>
//#include <AzTest/AzTest.h>
//
//namespace UnitTest
//{
// class ConsoleTestSequenceTestFixture
// : public AllocatorsTestFixture
// {
// };
//
// TEST_F(ConsoleTestSequenceTestFixture, CheckEmptyArgs_ExpectDefaultValues)
// {
// AZStd::unordered_set<AZStd::string> suites = { "PERIODIC","MAIN" };
// TestImpact::Console::TestSequenceEventHandler seq(&suites);
// AZStd::vector<AZStd::string> selectedTests = { "Test1", "Test2", "Test3", "Test4", "Test5" };
// seq.operator()(TestImpact::Client::TestRunSelection(selectedTests, {"Test6"}));
//
// for (auto i = 0; i < selectedTests.size(); i++)
// {
// seq.operator()(TestImpact::Client::TestRun(selectedTests[i], (TestImpact::Client::TestRunResult)i, AZStd::chrono::milliseconds(i)));
// }
// }
//}
@@ -0,0 +1,34 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include <AzCore/Memory/OSAllocator.h>
#include <AzCore/Memory/SystemAllocator.h>
#include <AzTest/AzTest.h>
class TestImpactTestEnvironment
: public AZ::Test::ITestEnvironment
{
protected:
void SetupEnvironment() override
{
AZ::AllocatorInstance<AZ::OSAllocator>::Create();
AZ::AllocatorInstance<AZ::SystemAllocator>::Create();
}
void TeardownEnvironment() override
{
AZ::AllocatorInstance<AZ::OSAllocator>::Destroy();
AZ::AllocatorInstance<AZ::SystemAllocator>::Destroy();
}
};
AZ_UNIT_TEST_HOOK(new TestImpactTestEnvironment);
@@ -0,0 +1,27 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include <TestImpactRuntimeConfigurationFactory.h>
#include <AzTest/AzTest.h>
#include <fstream>
namespace UnitTest
{
//TEST(FOO, BAR)
//{
// std::ifstream configFile("C:\\o3de_TIF_Feature\\windows_vs2019\\bin\\debug\\tiaf.debug.json");
// AZStd::string configData((std::istreambuf_iterator<char>(configFile)), std::istreambuf_iterator<char>());
// const auto configuration = TestImpact::ConfigurationFactory(configData);
//}
}
@@ -10,4 +10,9 @@
#
set(FILES
Tests/TestImpactCommandLineOptionsTest.cpp
Tests/TestImpactRuntimeConfigurationFactoryTest.cpp
Tests/TestImpactFrontendConsoleStaticTestMain.cpp
Tests/TestImpactConsoleMainTest.cpp
Tests/TestImpactConsoleTestSequenceEventHandlerTest.cpp
)
@@ -1,12 +0,0 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
add_subdirectory(Code)
@@ -1,25 +0,0 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
ly_add_target(
NAME TestImpact.Frontend.Console EXECUTABLE
OUTPUT_NAME tiaf
NAMESPACE AZ
FILES_CMAKE
testimpactframework_frontend_console_files.cmake
INCLUDE_DIRECTORIES
PRIVATE
Source
BUILD_DEPENDENCIES
PRIVATE
AZ::TestImpact.Frontend.Console.Static
)
@@ -1,12 +0,0 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
add_subdirectory(Code)
@@ -40,48 +40,49 @@ ly_add_target(
# Tests
################################################################################
ly_add_target(
NAME TestImpact.Runtime.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
NAMESPACE AZ
FILES_CMAKE
testimpactframework_runtime_tests_files.cmake
INCLUDE_DIRECTORIES
PRIVATE
Include
Source
Tests
BUILD_DEPENDENCIES
PRIVATE
AZ::AzTestShared
AZ::AzTest
AZ::TestImpact.Runtime.Static
RUNTIME_DEPENDENCIES
AZ::AzTestRunner
AZ::TestImpact.TestProcess.Console
AZ::TestImpact.TestTargetA.Tests
AZ::TestImpact.TestTargetB.Tests
AZ::TestImpact.TestTargetC.Tests
AZ::TestImpact.TestTargetD.Tests
COMPILE_DEFINITIONS
PRIVATE
LY_TEST_IMPACT_AZ_TESTRUNNER_BIN="$<TARGET_FILE:AzTestRunner>"
LY_TEST_IMPACT_TEST_PROCESS_BIN="$<TARGET_FILE:TestImpact.TestProcess.Console>"
LY_TEST_IMPACT_TEST_TARGET_A_BIN="$<TARGET_FILE:TestImpact.TestTargetA.Tests>"
LY_TEST_IMPACT_TEST_TARGET_B_BIN="$<TARGET_FILE:TestImpact.TestTargetB.Tests>"
LY_TEST_IMPACT_TEST_TARGET_C_BIN="$<TARGET_FILE:TestImpact.TestTargetC.Tests>"
LY_TEST_IMPACT_TEST_TARGET_D_BIN="$<TARGET_FILE:TestImpact.TestTargetD.Tests>"
LY_TEST_IMPACT_TEST_TARGET_A_BASE_NAME="$<TARGET_FILE_BASE_NAME:TestImpact.TestTargetA.Tests>"
LY_TEST_IMPACT_TEST_TARGET_B_BASE_NAME="$<TARGET_FILE_BASE_NAME:TestImpact.TestTargetB.Tests>"
LY_TEST_IMPACT_TEST_TARGET_C_BASE_NAME="$<TARGET_FILE_BASE_NAME:TestImpact.TestTargetC.Tests>"
LY_TEST_IMPACT_TEST_TARGET_D_BASE_NAME="$<TARGET_FILE_BASE_NAME:TestImpact.TestTargetD.Tests>"
LY_TEST_IMPACT_TEST_TARGET_ENUMERATION_DIR="${GTEST_XML_OUTPUT_DIR}/TestImpact/Temp/Exclusive/Enum"
LY_TEST_IMPACT_TEST_TARGET_RESULTS_DIR="${GTEST_XML_OUTPUT_DIR}/TestImpact/Temp/Exclusive/Result"
LY_TEST_IMPACT_TEST_TARGET_COVERAGE_DIR="${GTEST_XML_OUTPUT_DIR}/TestImpact/Temp/Exclusive/Coverage"
LY_TEST_IMPACT_INSTRUMENTATION_BIN="${LY_TEST_IMPACT_INSTRUMENTATION_BIN}"
LY_TEST_IMPACT_MODULES_DIR="${CMAKE_BINARY_DIR}"
LY_TEST_IMPACT_COVERAGE_SOURCES_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
)
ly_add_googletest(
NAME AZ::TestImpact.Runtime.Tests
)
# Disabled: SPEC-7246
#ly_add_target(
# NAME TestImpact.Runtime.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
# NAMESPACE AZ
# FILES_CMAKE
# testimpactframework_runtime_tests_files.cmake
# INCLUDE_DIRECTORIES
# PRIVATE
# Include
# Source
# Tests
# BUILD_DEPENDENCIES
# PRIVATE
# AZ::AzTestShared
# AZ::AzTest
# AZ::TestImpact.Runtime.Static
# RUNTIME_DEPENDENCIES
# AZ::AzTestRunner
# AZ::TestImpact.TestProcess.Console
# AZ::TestImpact.TestTargetA.Tests
# AZ::TestImpact.TestTargetB.Tests
# AZ::TestImpact.TestTargetC.Tests
# AZ::TestImpact.TestTargetD.Tests
# COMPILE_DEFINITIONS
# PRIVATE
# LY_TEST_IMPACT_AZ_TESTRUNNER_BIN="$<TARGET_FILE:AzTestRunner>"
# LY_TEST_IMPACT_TEST_PROCESS_BIN="$<TARGET_FILE:TestImpact.TestProcess.Console>"
# LY_TEST_IMPACT_TEST_TARGET_A_BIN="$<TARGET_FILE:TestImpact.TestTargetA.Tests>"
# LY_TEST_IMPACT_TEST_TARGET_B_BIN="$<TARGET_FILE:TestImpact.TestTargetB.Tests>"
# LY_TEST_IMPACT_TEST_TARGET_C_BIN="$<TARGET_FILE:TestImpact.TestTargetC.Tests>"
# LY_TEST_IMPACT_TEST_TARGET_D_BIN="$<TARGET_FILE:TestImpact.TestTargetD.Tests>"
# LY_TEST_IMPACT_TEST_TARGET_A_BASE_NAME="$<TARGET_FILE_BASE_NAME:TestImpact.TestTargetA.Tests>"
# LY_TEST_IMPACT_TEST_TARGET_B_BASE_NAME="$<TARGET_FILE_BASE_NAME:TestImpact.TestTargetB.Tests>"
# LY_TEST_IMPACT_TEST_TARGET_C_BASE_NAME="$<TARGET_FILE_BASE_NAME:TestImpact.TestTargetC.Tests>"
# LY_TEST_IMPACT_TEST_TARGET_D_BASE_NAME="$<TARGET_FILE_BASE_NAME:TestImpact.TestTargetD.Tests>"
# LY_TEST_IMPACT_TEST_TARGET_ENUMERATION_DIR="${GTEST_XML_OUTPUT_DIR}/TestImpact/Temp/Exclusive/Enum"
# LY_TEST_IMPACT_TEST_TARGET_RESULTS_DIR="${GTEST_XML_OUTPUT_DIR}/TestImpact/Temp/Exclusive/Result"
# LY_TEST_IMPACT_TEST_TARGET_COVERAGE_DIR="${GTEST_XML_OUTPUT_DIR}/TestImpact/Temp/Exclusive/Coverage"
# LY_TEST_IMPACT_INSTRUMENTATION_BIN="${LY_TEST_IMPACT_INSTRUMENTATION_BIN}"
# LY_TEST_IMPACT_MODULES_DIR="${CMAKE_BINARY_DIR}"
# LY_TEST_IMPACT_COVERAGE_SOURCES_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
#)
#
#ly_add_googletest(
# NAME AZ::TestImpact.Runtime.Tests
#)