From 5a1974de343a160d355a680080366210b2c4e1f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Krupi=C5=84ski?= Date: Tue, 28 Jan 2025 19:50:23 +0100 Subject: [PATCH] Move existing tests to Tests/UnitTests directory --- .github/workflows/linux.yml | 2 +- .github/workflows/windows.yml | 2 +- Tests/CMakeLists.txt | 14 +----- Tests/MemoryAllocation/CMakeLists.txt | 3 -- .../MemoryAllocation/MockMemoryAllocator.cpp | 30 ----------- Tests/MemoryAllocation/MockMemoryAllocator.h | 14 ------ Tests/Mocks/MockMemoryAllocator.h | 50 +++++++++++++++++++ Tests/Platform/Windows/CMakeLists.txt | 3 -- Tests/UnitTests/CMakeLists.txt | 12 +++++ .../BombTimerTests/BombSiteIconPanelTests.h | 0 .../BombTimerTests/BombTimerConditionTests.h | 0 .../BombTimerTests/BombTimerPanelTests.h | 0 .../BombTimerTests/BombTimerTests.h | 0 .../BombTimerTests/BombTimerTextPanelTests.h | 0 .../BombTimerTests/BombTimerToggleTests.h | 0 .../HudFeaturesTests/BombTimerTests/Tests.h | 0 .../DefusingAlertConditionTests.h | 0 .../DefusingAlertPanelTests.h | 0 .../DefusingAlertTests/DefusingAlertTests.h | 0 .../DefusingAlertToggleTests.h | 0 .../DefusingCountdownTextPanelTests.h | 0 .../DefusingAlertTests/Tests.h | 0 .../KillfeedPreserveToggleTests.h | 0 .../KillfeedPreserverContextTests.h | 0 .../KillfeedPreserverTests.h | 0 .../KillfeedPreserverTests/Tests.h | 0 .../PostRoundTimerConditionTests.h | 0 .../PostRoundTimerContextTests.h | 0 .../PostRoundTimerPanelFactoryTests.h | 0 .../PostRoundTimerTests/PostRoundTimerTests.h | 0 .../PostRoundTimerTests/Tests.h | 0 .../FeatureTests/HudFeaturesTests/Tests.h | 0 .../{ => UnitTests}/HelpersTests/BitsTests.h | 0 Tests/{ => UnitTests}/HelpersTests/Tests.h | 0 .../BombStatusPanelManagerTests.h | 0 .../BombStatusTests/BombStatusPanelTests.h | 0 .../BytePatternConverterTests.h | 0 .../BytePatternLiteralTests.h | 0 .../BytePatternStorageTests.h | 0 .../MemorySearchTests/BytePatternTests.h | 0 .../PatternFinderSIMDTests.h | 0 .../PatternSearchResultTests.h | 0 .../{ => UnitTests}/MemorySearchTests/Tests.h | 0 .../PlatformTests}/CMakeLists.txt | 0 .../PlatformTests}/Linux/SharedObjectTests.h | 0 .../PlatformTests}/Tests.h | 0 .../PlatformTests/Windows/CMakeLists.txt | 3 ++ .../Windows/MockWindowsPlatformApi.cpp | 0 .../PlatformTests}/Windows/PebLdrBuilder.h | 0 .../PlatformTests}/Windows/PebLdrTests.h | 0 Tests/{ => UnitTests}/UnitTests.cpp | 2 +- .../UtilsTests/FlagsBuilderTests.h | 0 .../UtilsTests/OptionalTests.h | 0 .../UtilsTests/PatternFinderTests.h | 0 .../UtilsTests/RefCountedHookTests.h | 0 .../UtilsTests/ReturnAddressTests.h | 0 .../UtilsTests/SpanSliceTests.h | 0 .../UtilsTests/StringBuilderTests.h | 0 Tests/{ => UnitTests}/UtilsTests/Tests.h | 0 59 files changed, 70 insertions(+), 65 deletions(-) delete mode 100644 Tests/MemoryAllocation/CMakeLists.txt delete mode 100644 Tests/MemoryAllocation/MockMemoryAllocator.cpp delete mode 100644 Tests/MemoryAllocation/MockMemoryAllocator.h create mode 100644 Tests/Mocks/MockMemoryAllocator.h delete mode 100644 Tests/Platform/Windows/CMakeLists.txt create mode 100644 Tests/UnitTests/CMakeLists.txt rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/BombTimerTests/BombSiteIconPanelTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerConditionTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerPanelTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerTextPanelTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerToggleTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/BombTimerTests/Tests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertConditionTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertPanelTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertToggleTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingCountdownTextPanelTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/DefusingAlertTests/Tests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/KillfeedPreserveToggleTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/KillfeedPreserverContextTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/KillfeedPreserverTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/Tests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerConditionTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerContextTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerPanelFactoryTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerTests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/PostRoundTimerTests/Tests.h (100%) rename Tests/{ => UnitTests}/FeatureTests/HudFeaturesTests/Tests.h (100%) rename Tests/{ => UnitTests}/HelpersTests/BitsTests.h (100%) rename Tests/{ => UnitTests}/HelpersTests/Tests.h (100%) rename Tests/{ => UnitTests}/HudTests/BombStatusTests/BombStatusPanelManagerTests.h (100%) rename Tests/{ => UnitTests}/HudTests/BombStatusTests/BombStatusPanelTests.h (100%) rename Tests/{ => UnitTests}/MemorySearchTests/BytePatternConverterTests.h (100%) rename Tests/{ => UnitTests}/MemorySearchTests/BytePatternLiteralTests.h (100%) rename Tests/{ => UnitTests}/MemorySearchTests/BytePatternStorageTests.h (100%) rename Tests/{ => UnitTests}/MemorySearchTests/BytePatternTests.h (100%) rename Tests/{ => UnitTests}/MemorySearchTests/PatternFinderSIMDTests.h (100%) rename Tests/{ => UnitTests}/MemorySearchTests/PatternSearchResultTests.h (100%) rename Tests/{ => UnitTests}/MemorySearchTests/Tests.h (100%) rename Tests/{Platform => UnitTests/PlatformTests}/CMakeLists.txt (100%) rename Tests/{Platform => UnitTests/PlatformTests}/Linux/SharedObjectTests.h (100%) rename Tests/{Platform => UnitTests/PlatformTests}/Tests.h (100%) create mode 100644 Tests/UnitTests/PlatformTests/Windows/CMakeLists.txt rename Tests/{Platform => UnitTests/PlatformTests}/Windows/MockWindowsPlatformApi.cpp (100%) rename Tests/{Platform => UnitTests/PlatformTests}/Windows/PebLdrBuilder.h (100%) rename Tests/{Platform => UnitTests/PlatformTests}/Windows/PebLdrTests.h (100%) rename Tests/{ => UnitTests}/UnitTests.cpp (89%) rename Tests/{ => UnitTests}/UtilsTests/FlagsBuilderTests.h (100%) rename Tests/{ => UnitTests}/UtilsTests/OptionalTests.h (100%) rename Tests/{ => UnitTests}/UtilsTests/PatternFinderTests.h (100%) rename Tests/{ => UnitTests}/UtilsTests/RefCountedHookTests.h (100%) rename Tests/{ => UnitTests}/UtilsTests/ReturnAddressTests.h (100%) rename Tests/{ => UnitTests}/UtilsTests/SpanSliceTests.h (100%) rename Tests/{ => UnitTests}/UtilsTests/StringBuilderTests.h (100%) rename Tests/{ => UnitTests}/UtilsTests/Tests.h (100%) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 00303724b0d..2702c75c3b2 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -41,6 +41,6 @@ jobs: - name: build source run: cmake --build build --target Osiris -j $(nproc --all) - name: build unit tests - run: cmake --build build --target Tests -j $(nproc --all) + run: cmake --build build --target UnitTests -j $(nproc --all) - name: run unit tests run: ctest --test-dir build --output-on-failure --schedule-random -j $(nproc --all) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ee75a394bbd..d1b8b70e75c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -36,6 +36,6 @@ jobs: - name: build source run: cmake --build build --target Osiris --config ${{ matrix.configuration }} - name: build unit tests - run: cmake --build build --target Tests --config ${{ matrix.configuration }} + run: cmake --build build --target UnitTests --config ${{ matrix.configuration }} - name: run unit tests run: ctest --test-dir build --output-on-failure --schedule-random -j $env:NUMBER_OF_PROCESSORS diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 2f97d2aac07..3969ebf14b8 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -11,16 +11,6 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(googletest) -add_executable(Tests UnitTests.cpp) - -if(MSVC) - target_compile_options(Tests PRIVATE /bigobj) -endif() - -add_subdirectory(MemoryAllocation) -add_subdirectory(Platform) -target_link_libraries(Tests gtest_main gmock Threads::Threads) -target_include_directories(Tests PRIVATE . "${CMAKE_SOURCE_DIR}/Source") - include(GoogleTest) -gtest_discover_tests(Tests DISCOVERY_TIMEOUT 60) + +add_subdirectory(UnitTests) diff --git a/Tests/MemoryAllocation/CMakeLists.txt b/Tests/MemoryAllocation/CMakeLists.txt deleted file mode 100644 index 8f09528c477..00000000000 --- a/Tests/MemoryAllocation/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -target_sources(Tests PRIVATE - MockMemoryAllocator.cpp -) diff --git a/Tests/MemoryAllocation/MockMemoryAllocator.cpp b/Tests/MemoryAllocation/MockMemoryAllocator.cpp deleted file mode 100644 index f0d6f5147a5..00000000000 --- a/Tests/MemoryAllocation/MockMemoryAllocator.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "MockMemoryAllocator.h" -#include "MemoryAllocation/MemoryAllocatorBase.h" - -namespace -{ - std::weak_ptr mockMemoryAllocator; -} - -[[nodiscard]] std::shared_ptr MockMemoryAllocator::create() -{ - if (const auto existingMock = mockMemoryAllocator.lock()) - return existingMock; - - auto mock = std::make_shared(); - mockMemoryAllocator = mock; - return mock; -} - -std::byte* MemoryAllocatorBase::allocate(std::size_t size) noexcept -{ - if (const auto mock = mockMemoryAllocator.lock()) - return mock->allocate(size); - return nullptr; -} - -void MemoryAllocatorBase::deallocate(std::byte* memory, std::size_t size) noexcept -{ - if (const auto mock = mockMemoryAllocator.lock()) - mock->deallocate(memory, size); -} diff --git a/Tests/MemoryAllocation/MockMemoryAllocator.h b/Tests/MemoryAllocation/MockMemoryAllocator.h deleted file mode 100644 index 9a04a552e46..00000000000 --- a/Tests/MemoryAllocation/MockMemoryAllocator.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include -#include - -#include - -struct MockMemoryAllocator { - MOCK_METHOD(std::byte*, allocate, (std::size_t size), (noexcept)); - MOCK_METHOD(void, deallocate, (std::byte* memory, std::size_t size), (noexcept)); - - using MockType = testing::StrictMock; - [[nodiscard]] static std::shared_ptr create(); -}; diff --git a/Tests/Mocks/MockMemoryAllocator.h b/Tests/Mocks/MockMemoryAllocator.h new file mode 100644 index 00000000000..48aa5c68466 --- /dev/null +++ b/Tests/Mocks/MockMemoryAllocator.h @@ -0,0 +1,50 @@ +#pragma once + +#include +#include + +#include + +#include + +struct MockMemoryAllocator { + MOCK_METHOD(std::byte*, allocate, (std::size_t size), (noexcept)); + MOCK_METHOD(void, deallocate, (std::byte* memory, std::size_t size), (noexcept)); + + using MockType = testing::StrictMock; + [[nodiscard]] static std::shared_ptr create() + { + if (const auto existingMock = mockMemoryAllocator.lock()) + return existingMock; + + auto mock = std::make_shared(); + mockMemoryAllocator = mock; + return mock; + } + + static std::byte* invokeAllocate(std::size_t size) + { + if (const auto mock = mockMemoryAllocator.lock()) + return mock->allocate(size); + return nullptr; + } + + static void invokeDeallocate(std::byte* memory, std::size_t size) + { + if (const auto mock = mockMemoryAllocator.lock()) + mock->deallocate(memory, size); + } + +private: + inline static std::weak_ptr mockMemoryAllocator; +}; + +std::byte* MemoryAllocatorBase::allocate(std::size_t size) noexcept +{ + return MockMemoryAllocator::invokeAllocate(size); +} + +void MemoryAllocatorBase::deallocate(std::byte* memory, std::size_t size) noexcept +{ + MockMemoryAllocator::invokeDeallocate(memory, size); +} diff --git a/Tests/Platform/Windows/CMakeLists.txt b/Tests/Platform/Windows/CMakeLists.txt deleted file mode 100644 index dc8e7b66821..00000000000 --- a/Tests/Platform/Windows/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -target_sources(Tests PRIVATE - MockWindowsPlatformApi.cpp -) diff --git a/Tests/UnitTests/CMakeLists.txt b/Tests/UnitTests/CMakeLists.txt new file mode 100644 index 00000000000..d430582a291 --- /dev/null +++ b/Tests/UnitTests/CMakeLists.txt @@ -0,0 +1,12 @@ +add_executable(UnitTests UnitTests.cpp) + +if(MSVC) + target_compile_options(UnitTests PRIVATE /bigobj) +endif() + +target_include_directories(UnitTests PRIVATE "${CMAKE_SOURCE_DIR}/Tests" "${CMAKE_SOURCE_DIR}/Source") +target_link_libraries(UnitTests gtest_main gmock Threads::Threads) +set_target_properties(UnitTests PROPERTIES OUTPUT_NAME UnitTestsBin) +gtest_discover_tests(UnitTests DISCOVERY_TIMEOUT 60) + +add_subdirectory(PlatformTests) diff --git a/Tests/FeatureTests/HudFeaturesTests/BombTimerTests/BombSiteIconPanelTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/BombTimerTests/BombSiteIconPanelTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/BombTimerTests/BombSiteIconPanelTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/BombTimerTests/BombSiteIconPanelTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerConditionTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerConditionTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerConditionTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerConditionTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerPanelTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerPanelTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerPanelTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerPanelTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerTextPanelTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerTextPanelTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerTextPanelTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerTextPanelTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerToggleTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerToggleTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerToggleTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/BombTimerTests/BombTimerToggleTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/BombTimerTests/Tests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/BombTimerTests/Tests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/BombTimerTests/Tests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/BombTimerTests/Tests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertConditionTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertConditionTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertConditionTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertConditionTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertPanelTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertPanelTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertPanelTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertPanelTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertToggleTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertToggleTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertToggleTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingAlertToggleTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingCountdownTextPanelTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingCountdownTextPanelTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingCountdownTextPanelTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/DefusingAlertTests/DefusingCountdownTextPanelTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/DefusingAlertTests/Tests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/DefusingAlertTests/Tests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/DefusingAlertTests/Tests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/DefusingAlertTests/Tests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/KillfeedPreserveToggleTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/KillfeedPreserveToggleTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/KillfeedPreserveToggleTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/KillfeedPreserveToggleTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/KillfeedPreserverContextTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/KillfeedPreserverContextTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/KillfeedPreserverContextTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/KillfeedPreserverContextTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/KillfeedPreserverTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/KillfeedPreserverTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/KillfeedPreserverTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/KillfeedPreserverTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/Tests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/Tests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/Tests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/KillfeedPreserverTests/Tests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerConditionTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerConditionTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerConditionTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerConditionTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerContextTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerContextTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerContextTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerContextTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerPanelFactoryTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerPanelFactoryTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerPanelFactoryTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerPanelFactoryTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerTests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerTests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerTests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/PostRoundTimerTests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/Tests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/Tests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/Tests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/PostRoundTimerTests/Tests.h diff --git a/Tests/FeatureTests/HudFeaturesTests/Tests.h b/Tests/UnitTests/FeatureTests/HudFeaturesTests/Tests.h similarity index 100% rename from Tests/FeatureTests/HudFeaturesTests/Tests.h rename to Tests/UnitTests/FeatureTests/HudFeaturesTests/Tests.h diff --git a/Tests/HelpersTests/BitsTests.h b/Tests/UnitTests/HelpersTests/BitsTests.h similarity index 100% rename from Tests/HelpersTests/BitsTests.h rename to Tests/UnitTests/HelpersTests/BitsTests.h diff --git a/Tests/HelpersTests/Tests.h b/Tests/UnitTests/HelpersTests/Tests.h similarity index 100% rename from Tests/HelpersTests/Tests.h rename to Tests/UnitTests/HelpersTests/Tests.h diff --git a/Tests/HudTests/BombStatusTests/BombStatusPanelManagerTests.h b/Tests/UnitTests/HudTests/BombStatusTests/BombStatusPanelManagerTests.h similarity index 100% rename from Tests/HudTests/BombStatusTests/BombStatusPanelManagerTests.h rename to Tests/UnitTests/HudTests/BombStatusTests/BombStatusPanelManagerTests.h diff --git a/Tests/HudTests/BombStatusTests/BombStatusPanelTests.h b/Tests/UnitTests/HudTests/BombStatusTests/BombStatusPanelTests.h similarity index 100% rename from Tests/HudTests/BombStatusTests/BombStatusPanelTests.h rename to Tests/UnitTests/HudTests/BombStatusTests/BombStatusPanelTests.h diff --git a/Tests/MemorySearchTests/BytePatternConverterTests.h b/Tests/UnitTests/MemorySearchTests/BytePatternConverterTests.h similarity index 100% rename from Tests/MemorySearchTests/BytePatternConverterTests.h rename to Tests/UnitTests/MemorySearchTests/BytePatternConverterTests.h diff --git a/Tests/MemorySearchTests/BytePatternLiteralTests.h b/Tests/UnitTests/MemorySearchTests/BytePatternLiteralTests.h similarity index 100% rename from Tests/MemorySearchTests/BytePatternLiteralTests.h rename to Tests/UnitTests/MemorySearchTests/BytePatternLiteralTests.h diff --git a/Tests/MemorySearchTests/BytePatternStorageTests.h b/Tests/UnitTests/MemorySearchTests/BytePatternStorageTests.h similarity index 100% rename from Tests/MemorySearchTests/BytePatternStorageTests.h rename to Tests/UnitTests/MemorySearchTests/BytePatternStorageTests.h diff --git a/Tests/MemorySearchTests/BytePatternTests.h b/Tests/UnitTests/MemorySearchTests/BytePatternTests.h similarity index 100% rename from Tests/MemorySearchTests/BytePatternTests.h rename to Tests/UnitTests/MemorySearchTests/BytePatternTests.h diff --git a/Tests/MemorySearchTests/PatternFinderSIMDTests.h b/Tests/UnitTests/MemorySearchTests/PatternFinderSIMDTests.h similarity index 100% rename from Tests/MemorySearchTests/PatternFinderSIMDTests.h rename to Tests/UnitTests/MemorySearchTests/PatternFinderSIMDTests.h diff --git a/Tests/MemorySearchTests/PatternSearchResultTests.h b/Tests/UnitTests/MemorySearchTests/PatternSearchResultTests.h similarity index 100% rename from Tests/MemorySearchTests/PatternSearchResultTests.h rename to Tests/UnitTests/MemorySearchTests/PatternSearchResultTests.h diff --git a/Tests/MemorySearchTests/Tests.h b/Tests/UnitTests/MemorySearchTests/Tests.h similarity index 100% rename from Tests/MemorySearchTests/Tests.h rename to Tests/UnitTests/MemorySearchTests/Tests.h diff --git a/Tests/Platform/CMakeLists.txt b/Tests/UnitTests/PlatformTests/CMakeLists.txt similarity index 100% rename from Tests/Platform/CMakeLists.txt rename to Tests/UnitTests/PlatformTests/CMakeLists.txt diff --git a/Tests/Platform/Linux/SharedObjectTests.h b/Tests/UnitTests/PlatformTests/Linux/SharedObjectTests.h similarity index 100% rename from Tests/Platform/Linux/SharedObjectTests.h rename to Tests/UnitTests/PlatformTests/Linux/SharedObjectTests.h diff --git a/Tests/Platform/Tests.h b/Tests/UnitTests/PlatformTests/Tests.h similarity index 100% rename from Tests/Platform/Tests.h rename to Tests/UnitTests/PlatformTests/Tests.h diff --git a/Tests/UnitTests/PlatformTests/Windows/CMakeLists.txt b/Tests/UnitTests/PlatformTests/Windows/CMakeLists.txt new file mode 100644 index 00000000000..72a50c95085 --- /dev/null +++ b/Tests/UnitTests/PlatformTests/Windows/CMakeLists.txt @@ -0,0 +1,3 @@ +target_sources(UnitTests PRIVATE + MockWindowsPlatformApi.cpp +) diff --git a/Tests/Platform/Windows/MockWindowsPlatformApi.cpp b/Tests/UnitTests/PlatformTests/Windows/MockWindowsPlatformApi.cpp similarity index 100% rename from Tests/Platform/Windows/MockWindowsPlatformApi.cpp rename to Tests/UnitTests/PlatformTests/Windows/MockWindowsPlatformApi.cpp diff --git a/Tests/Platform/Windows/PebLdrBuilder.h b/Tests/UnitTests/PlatformTests/Windows/PebLdrBuilder.h similarity index 100% rename from Tests/Platform/Windows/PebLdrBuilder.h rename to Tests/UnitTests/PlatformTests/Windows/PebLdrBuilder.h diff --git a/Tests/Platform/Windows/PebLdrTests.h b/Tests/UnitTests/PlatformTests/Windows/PebLdrTests.h similarity index 100% rename from Tests/Platform/Windows/PebLdrTests.h rename to Tests/UnitTests/PlatformTests/Windows/PebLdrTests.h diff --git a/Tests/UnitTests.cpp b/Tests/UnitTests/UnitTests.cpp similarity index 89% rename from Tests/UnitTests.cpp rename to Tests/UnitTests/UnitTests.cpp index ece0b37f50b..f2825b5ea97 100644 --- a/Tests/UnitTests.cpp +++ b/Tests/UnitTests/UnitTests.cpp @@ -1,7 +1,7 @@ #include "FeatureTests/HudFeaturesTests/Tests.h" #include "HelpersTests/Tests.h" #include "MemorySearchTests/Tests.h" -#include "Platform/Tests.h" +#include "PlatformTests/Tests.h" #include "UtilsTests/Tests.h" #include "HudTests/BombStatusTests/BombStatusPanelTests.h" diff --git a/Tests/UtilsTests/FlagsBuilderTests.h b/Tests/UnitTests/UtilsTests/FlagsBuilderTests.h similarity index 100% rename from Tests/UtilsTests/FlagsBuilderTests.h rename to Tests/UnitTests/UtilsTests/FlagsBuilderTests.h diff --git a/Tests/UtilsTests/OptionalTests.h b/Tests/UnitTests/UtilsTests/OptionalTests.h similarity index 100% rename from Tests/UtilsTests/OptionalTests.h rename to Tests/UnitTests/UtilsTests/OptionalTests.h diff --git a/Tests/UtilsTests/PatternFinderTests.h b/Tests/UnitTests/UtilsTests/PatternFinderTests.h similarity index 100% rename from Tests/UtilsTests/PatternFinderTests.h rename to Tests/UnitTests/UtilsTests/PatternFinderTests.h diff --git a/Tests/UtilsTests/RefCountedHookTests.h b/Tests/UnitTests/UtilsTests/RefCountedHookTests.h similarity index 100% rename from Tests/UtilsTests/RefCountedHookTests.h rename to Tests/UnitTests/UtilsTests/RefCountedHookTests.h diff --git a/Tests/UtilsTests/ReturnAddressTests.h b/Tests/UnitTests/UtilsTests/ReturnAddressTests.h similarity index 100% rename from Tests/UtilsTests/ReturnAddressTests.h rename to Tests/UnitTests/UtilsTests/ReturnAddressTests.h diff --git a/Tests/UtilsTests/SpanSliceTests.h b/Tests/UnitTests/UtilsTests/SpanSliceTests.h similarity index 100% rename from Tests/UtilsTests/SpanSliceTests.h rename to Tests/UnitTests/UtilsTests/SpanSliceTests.h diff --git a/Tests/UtilsTests/StringBuilderTests.h b/Tests/UnitTests/UtilsTests/StringBuilderTests.h similarity index 100% rename from Tests/UtilsTests/StringBuilderTests.h rename to Tests/UnitTests/UtilsTests/StringBuilderTests.h diff --git a/Tests/UtilsTests/Tests.h b/Tests/UnitTests/UtilsTests/Tests.h similarity index 100% rename from Tests/UtilsTests/Tests.h rename to Tests/UnitTests/UtilsTests/Tests.h