Kaynağa Gözat

tests

Signed-off-by: byrcolin <[email protected]>
byrcolin 3 yıl önce
ebeveyn
işleme
e51da657b4
27 değiştirilmiş dosya ile 200 ekleme ve 11 silme
  1. 2 0
      Gems/OpenXRVk/Code/CMakeLists.txt
  2. 2 0
      Gems/OpenXRVk/Code/Source/Platform/Android/OpenXRVk_Traits_Android.h
  3. 11 0
      Gems/OpenXRVk/Code/Source/Platform/Android/platform_test_android_files.cmake
  4. 24 0
      Gems/OpenXRVk/Code/Source/Platform/Common/Unimplemented/OpenXRVkTest_Unimplemented.cpp
  5. 2 0
      Gems/OpenXRVk/Code/Source/Platform/Linux/OpenXRVk_Traits_Linux.h
  6. 11 0
      Gems/OpenXRVk/Code/Source/Platform/Linux/platform_test_linux_files.cmake
  7. 10 0
      Gems/OpenXRVk/Code/Source/Platform/Mac/OpenXRVk_Traits_Mac.h
  8. 10 0
      Gems/OpenXRVk/Code/Source/Platform/Mac/OpenXRVk_Traits_Platform.h
  9. 12 0
      Gems/OpenXRVk/Code/Source/Platform/Mac/platform_private_mac_files.cmake
  10. 8 0
      Gems/OpenXRVk/Code/Source/Platform/Mac/platform_private_static_mac.cmake
  11. 11 0
      Gems/OpenXRVk/Code/Source/Platform/Mac/platform_test_mac_files.cmake
  12. 2 0
      Gems/OpenXRVk/Code/Source/Platform/Windows/OpenXRVk_Traits_Windows.h
  13. 11 0
      Gems/OpenXRVk/Code/Source/Platform/Windows/platform_test_windows_files.cmake
  14. 10 0
      Gems/OpenXRVk/Code/Source/Platform/iOS/OpenXRVk_Traits_Platform.h
  15. 10 0
      Gems/OpenXRVk/Code/Source/Platform/iOS/OpenXRVk_Traits_iOS.h
  16. 12 0
      Gems/OpenXRVk/Code/Source/Platform/iOS/platform_private_ios_files.cmake
  17. 8 0
      Gems/OpenXRVk/Code/Source/Platform/iOS/platform_private_static_ios.cmake
  18. 11 0
      Gems/OpenXRVk/Code/Source/Platform/iOS/platform_test_ios_files.cmake
  19. 11 7
      Gems/OpenXRVk/Code/Tests/OpenXRVkTests.cpp
  20. 4 2
      Gems/OpenXRVk/Code/Tests/OpenXRVkTests.h
  21. 1 0
      Gems/XR/Code/CMakeLists.txt
  22. 1 0
      Gems/XR/Code/Source/Platform/Android/XR_Traits_Android.h
  23. 1 0
      Gems/XR/Code/Source/Platform/Linux/XR_Traits_Linux.h
  24. 1 0
      Gems/XR/Code/Source/Platform/Mac/XR_Traits_Mac.h
  25. 2 0
      Gems/XR/Code/Source/Platform/Windows/XR_Traits_Windows.h
  26. 1 0
      Gems/XR/Code/Source/Platform/iOS/XR_Traits_iOS.h
  27. 11 2
      Gems/XR/Code/Tests/XRTest.cpp

+ 2 - 0
Gems/OpenXRVk/Code/CMakeLists.txt

@@ -94,11 +94,13 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
         OUTPUT_NAME OpenXRVk.Tests.Gem
         FILES_CMAKE
             openxrvk_tests_files.cmake
+            ${pal_source_dir}/platform_test_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
         INCLUDE_DIRECTORIES
             PRIVATE
                 Tests
                 .
                 Source
+                ${pal_source_dir}
         BUILD_DEPENDENCIES
             PRIVATE
                 AZ::AzTestShared

+ 2 - 0
Gems/OpenXRVk/Code/Source/Platform/Android/OpenXRVk_Traits_Android.h

@@ -9,4 +9,6 @@
 
 #define OPENXRVK_TRAIT_NEEDS_INITIALIZE_XR_LOADER 1
 
+#define O3DE_TRAIT_DISABLE_FAILED_OPENXRVK_TESTS
+
 #include <OpenXRInitializeLoader_Android.h>

+ 11 - 0
Gems/OpenXRVk/Code/Source/Platform/Android/platform_test_android_files.cmake

@@ -0,0 +1,11 @@
+#
+# 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
+#
+#
+
+set(FILES
+    ../Common/Unimplemented/OpenXRVkTest_Unimplemented.cpp
+)

+ 24 - 0
Gems/OpenXRVk/Code/Source/Platform/Common/Unimplemented/OpenXRVkTest_Unimplemented.cpp

@@ -0,0 +1,24 @@
+/*
+ * 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
+ *
+ */
+
+#include <AzTest/AzTest.h>
+
+#include "OpenXRVk_Traits_Platform.h"
+#include "OpenXRVkTests.h"
+
+void OpenXRVkTest::SetupInternal()
+{
+
+}
+
+void OpenXRVkTest::TearDownInternal()
+{
+
+}
+
+

+ 2 - 0
Gems/OpenXRVk/Code/Source/Platform/Linux/OpenXRVk_Traits_Linux.h

@@ -8,3 +8,5 @@
 #pragma once
 
 #define OPENXRVK_TRAIT_NEEDS_INITIALIZE_XR_LOADER 0
+
+#define O3DE_TRAIT_DISABLE_FAILED_OPENXRVK_TESTS

+ 11 - 0
Gems/OpenXRVk/Code/Source/Platform/Linux/platform_test_linux_files.cmake

@@ -0,0 +1,11 @@
+#
+# 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
+#
+#
+
+set(FILES
+    ../Common/Unimplemented/OpenXRVkTest_Unimplemented.cpp
+)

+ 10 - 0
Gems/OpenXRVk/Code/Source/Platform/Mac/OpenXRVk_Traits_Mac.h

@@ -0,0 +1,10 @@
+/*
+ * 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
+
+#define O3DE_TRAIT_DISABLE_FAILED_OPENXRVK_TESTS

+ 10 - 0
Gems/OpenXRVk/Code/Source/Platform/Mac/OpenXRVk_Traits_Platform.h

@@ -0,0 +1,10 @@
+/*
+ * 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 <OpenXRVk_Traits_Mac.h>

+ 12 - 0
Gems/OpenXRVk/Code/Source/Platform/Mac/platform_private_mac_files.cmake

@@ -0,0 +1,12 @@
+#
+# 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
+#
+#
+
+set(FILES
+    OpenXRVk_Traits_Mac.h
+    OpenXRVk_Traits_Platform.h
+)

+ 8 - 0
Gems/OpenXRVk/Code/Source/Platform/Mac/platform_private_static_mac.cmake

@@ -0,0 +1,8 @@
+#
+# 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
+#
+#
+

+ 11 - 0
Gems/OpenXRVk/Code/Source/Platform/Mac/platform_test_mac_files.cmake

@@ -0,0 +1,11 @@
+#
+# 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
+#
+#
+
+set(FILES
+    ../Common/Unimplemented/OpenXRVkTest_Unimplemented.cpp
+)

+ 2 - 0
Gems/OpenXRVk/Code/Source/Platform/Windows/OpenXRVk_Traits_Windows.h

@@ -8,3 +8,5 @@
 #pragma once
 
 #define OPENXRVK_TRAIT_NEEDS_INITIALIZE_XR_LOADER 0
+
+#define O3DE_TRAIT_DISABLE_FAILED_OPENXRVK_TESTS

+ 11 - 0
Gems/OpenXRVk/Code/Source/Platform/Windows/platform_test_windows_files.cmake

@@ -0,0 +1,11 @@
+#
+# 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
+#
+#
+
+set(FILES
+    ../Common/Unimplemented/OpenXRVkTest_Unimplemented.cpp
+)

+ 10 - 0
Gems/OpenXRVk/Code/Source/Platform/iOS/OpenXRVk_Traits_Platform.h

@@ -0,0 +1,10 @@
+/*
+ * 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 <OpenXRVk_Traits_iOS.h>

+ 10 - 0
Gems/OpenXRVk/Code/Source/Platform/iOS/OpenXRVk_Traits_iOS.h

@@ -0,0 +1,10 @@
+/*
+ * 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
+
+#define O3DE_TRAIT_DISABLE_FAILED_OPENXRVK_TESTS

+ 12 - 0
Gems/OpenXRVk/Code/Source/Platform/iOS/platform_private_ios_files.cmake

@@ -0,0 +1,12 @@
+#
+# 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
+#
+#
+
+set(FILES
+    OpenXRVk_Traits_iOS.h
+    OpenXRVk_Traits_Platform.h
+)

+ 8 - 0
Gems/OpenXRVk/Code/Source/Platform/iOS/platform_private_static_ios.cmake

@@ -0,0 +1,8 @@
+#
+# 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
+#
+#
+

+ 11 - 0
Gems/OpenXRVk/Code/Source/Platform/iOS/platform_test_ios_files.cmake

@@ -0,0 +1,11 @@
+#
+# 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
+#
+#
+
+set(FILES
+    ../Common/Unimplemented/OpenXRVkTest_Unimplemented.cpp
+)

+ 11 - 7
Gems/OpenXRVk/Code/Tests/OpenXRVkTests.cpp

@@ -7,25 +7,29 @@
  */
 
 #include <AzTest/AzTest.h>
-
-#include "OpemXRVkTest.h"
+#include "OpenXRVkTests.h"
 
 #if !O3DE_TRAIT_DISABLE_ALL_OPENXRVK_TESTS
 
-void OpenXRVkTestFixture::SetUp()
+void OpenXRVkTest::SetUp()
 {
-
+    SetupInternal();
 }
 
-void OpenXRVkTestFixture::TearDown()
+void OpenXRVkTest::TearDown()
 {
+    TearDownInternal();
+}
 
+TEST_F(OpenXRVkTest, PassThisTest)
+{
+    EXPECT_TRUE(true);
 }
 
 #if O3DE_TRAIT_DISABLE_FAILED_OPENXRVK_TESTS
-TEST_F(OpenXRVkTestFixture, DISABLED_ExpectTrue)
+TEST_F(OpenXRVkTest, DISABLED_ExpectTrue)
 #else
-TEST_F(OpenXRVkTestFixture, ExpectTrue)
+TEST_F(OpenXRVkTest, ExpectTrue)
 #endif // O3DE_TRAIT_DISABLE_FAILED_OPENXRVK_TESTS
 {
     EXPECT_TRUE(false);

+ 4 - 2
Gems/OpenXRVk/Code/Tests/OpenXRVkTests.h

@@ -9,13 +9,15 @@
 #pragma once
 
 #include <AzTest/AzTest.h>
-#include <AzCore/UnitTest/TestTypes.h>
 
-class OpenXRVkTestFixture
+class OpenXRVkTest
     : public ::testing::Test
 {
 protected:
     void SetUp() override;
     void TearDown() override;
+
+    void SetupInternal();
+    void TearDownInternal();
 };
 

+ 1 - 0
Gems/XR/Code/CMakeLists.txt

@@ -70,6 +70,7 @@ ly_add_target(
             ${pal_source_dir}
         PUBLIC
             Include
+            ${pal_include_dir}
     BUILD_DEPENDENCIES
         PRIVATE
             Gem::XR.Static

+ 1 - 0
Gems/XR/Code/Source/Platform/Android/XR_Traits_Android.h

@@ -7,3 +7,4 @@
  */
 #pragma once
 
+#define O3DE_TRAIT_DISABLE_FAILED_XR_TESTS

+ 1 - 0
Gems/XR/Code/Source/Platform/Linux/XR_Traits_Linux.h

@@ -7,3 +7,4 @@
  */
 #pragma once
 
+#define O3DE_TRAIT_DISABLE_FAILED_XR_TESTS

+ 1 - 0
Gems/XR/Code/Source/Platform/Mac/XR_Traits_Mac.h

@@ -7,3 +7,4 @@
  */
 #pragma once
 
+#define O3DE_TRAIT_DISABLE_FAILED_XR_TESTS

+ 2 - 0
Gems/XR/Code/Source/Platform/Windows/XR_Traits_Windows.h

@@ -7,3 +7,5 @@
  */
 #pragma once
 
+#define O3DE_TRAIT_DISABLE_FAILED_XR_TESTS
+

+ 1 - 0
Gems/XR/Code/Source/Platform/iOS/XR_Traits_iOS.h

@@ -7,3 +7,4 @@
  */
 #pragma once
 
+#define O3DE_TRAIT_DISABLE_FAILED_XR_TESTS

+ 11 - 2
Gems/XR/Code/Tests/XRTest.cpp

@@ -9,7 +9,7 @@
 #include <AzTest/AzTest.h>
 #include "XRTest.h"
 
-#if !AZ_TRAIT_DISABLE_ALL_XR_TESTS
+#if !O3DE_TRAIT_DISABLE_ALL_XR_TESTS
 
 void XRTest::SetUp()
 {
@@ -26,6 +26,15 @@ TEST_F(XRTest, PassThisTest)
     EXPECT_TRUE(true);
 }
 
-#endif // !AZ_TRAIT_DISABLE_ALL_XR_TESTS
+#if O3DE_TRAIT_DISABLE_FAILED_XR_TESTS
+TEST_F(XRTest, DISABLED_ExpectTrue)
+#else
+TEST_F(XRTest, ExpectTrue)
+#endif // O3DE_TRAIT_DISABLE_FAILED_XR_TESTS
+{
+    EXPECT_TRUE(false);
+}
+
+#endif // !O3DE_TRAIT_DISABLE_ALL_XR_TESTS
 
 AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV);