3
0

RHIValidation_Vulkan_DefaultLevel.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. """
  2. Copyright (c) Contributors to the Open 3D Engine Project.
  3. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. SPDX-License-Identifier: Apache-2.0 OR MIT
  5. """
  6. class Checks:
  7. enter_game_mode = ("Entered game mode", "Failed to enter game mode")
  8. no_rhi_validation_errors_found = ("No RHI validation errors found", "Found RHI validation errors")
  9. exit_game_mode = ("Exited game mode", "Failed to exit game mode")
  10. def RHIValidation_Vulkan_DefaultLevel():
  11. import azlmbr.legacy.general as general
  12. from editor_python_test_tools.utils import Report
  13. from editor_python_test_tools.utils import TestHelper as helper
  14. from editor_python_test_tools.utils import Tracer
  15. from vulkan_skip_errors import VulkanValidationErrors
  16. # Constants
  17. FRAMES_IN_GAME_MODE = 200
  18. # 1) Start the Tracer to catch any errors and warnings
  19. with Tracer() as section_tracer:
  20. helper.init_idle()
  21. # 2) Load the level
  22. helper.open_level("", "DefaultLevel")
  23. # 3) Enter game mode
  24. helper.enter_game_mode(Checks.enter_game_mode)
  25. # 4) Wait in game mode some frames to let cloth simulation run
  26. general.idle_wait_frames(FRAMES_IN_GAME_MODE)
  27. # 5) Exit game mode
  28. helper.exit_game_mode(Checks.exit_game_mode)
  29. # 5) Verify there are no rhi validation errors in the logs
  30. has_rhi_validation_errors = False
  31. for error_msg in section_tracer.errors:
  32. if VulkanValidationErrors.CheckError(error_msg.window, f"{error_msg}"):
  33. has_rhi_validation_errors = True
  34. Report.info(f"RHI Validation error found: {error_msg}")
  35. Report.result(Checks.no_rhi_validation_errors_found, not has_rhi_validation_errors)
  36. if __name__ == "__main__":
  37. from editor_python_test_tools.utils import Report
  38. Report.start_test(RHIValidation_Vulkan_DefaultLevel)