_FullTestSuite_.bv.lua 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. ----------------------------------------------------------------------------------------------------
  2. --
  3. -- Copyright (c) Contributors to the Open 3D Engine Project.
  4. -- For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. --
  6. -- SPDX-License-Identifier: Apache-2.0 OR MIT
  7. --
  8. --
  9. --
  10. ----------------------------------------------------------------------------------------------------
  11. -- "Full" suite of tests that need to be run locally by developers before opening a pull request.
  12. -- This suite of tests is NOT part of the automated review process.
  13. -- This test suite is capable of randomly shuffling the order of the tests below if a random seed is provided that is not ZERO.
  14. -- NOTE: If the random seed is zero, then the order is not shuffled at all.
  15. -- The seed can be provided either in imGui or via commandline switch --randomtestseed
  16. -- Fast check for a sample which doesn't have a dedicated test script
  17. function FastCheckSample(sampleName)
  18. return function()
  19. Print("========= Begin Fast-check " .. sampleName .. " =========")
  20. OpenSample(sampleName)
  21. IdleSeconds(2)
  22. OpenSample(nil)
  23. Print("========= End Fast-check " .. sampleName .. " =========")
  24. end
  25. end
  26. -- Test helper functions
  27. function random_shuffle(list)
  28. for i = #list, 2, -1 do
  29. local j = math.random(i)
  30. list[i], list[j] = list[j], list[i]
  31. end
  32. end
  33. -- A helper wrapper to create a lambda-like behavior in Lua, this allows us to create a table of functions that call various tests
  34. function RunScriptWrapper(name)
  35. return function() RunScript(name) end
  36. end
  37. -- A table of lambda-like functions that invoke various tests. This table is shuffled if a random seed is provided below.
  38. tests= {
  39. RunScriptWrapper('scripts/decals.bv.luac'),
  40. RunScriptWrapper('scripts/dynamicdraw.bv.luac'),
  41. RunScriptWrapper('scripts/dynamicmaterialtest.bv.luac'),
  42. RunScriptWrapper('scripts/EyeMaterialTest.bv.luac'),
  43. RunScriptWrapper('scripts/materialscreenshottests.bv.luac'),
  44. RunScriptWrapper('scripts/msaa_rpi_test.bv.luac'),
  45. RunScriptWrapper('scripts/cullingandlod.bv.luac'),
  46. RunScriptWrapper('scripts/multirenderpipeline.bv.luac'),
  47. RunScriptWrapper('scripts/lightculling.bv.luac'),
  48. RunScriptWrapper('scripts/transparenttest.bv.luac'),
  49. RunScriptWrapper('scripts/streamingimagetest.bv.luac'),
  50. RunScriptWrapper('scripts/parallaxtest.bv.luac'),
  51. RunScriptWrapper('scripts/parallaxdepthartifacts.bv.luac'),
  52. -- Disable checkerboard pipeline as it's quite out of date and currently a maintenance burden
  53. -- https://github.com/o3de/o3de-atom-sampleviewer/issues/456
  54. -- RunScriptWrapper('scripts/checkerboardtest.bv.luac'),
  55. RunScriptWrapper('scripts/scenereloadsoaktest.bv.luac'),
  56. RunScriptWrapper('scripts/diffusegitest.bv.luac'),
  57. RunScriptWrapper('scripts/arealighttest.bv.luac'),
  58. RunScriptWrapper('scripts/multiscene.bv.luac'),
  59. RunScriptWrapper('scripts/shadowtest.bv.luac'),
  60. RunScriptWrapper('scripts/shadowedsponzatest.bv.luac'),
  61. RunScriptWrapper('scripts/skinnedmesh.bv.luac'),
  62. RunScriptWrapper('scripts/RenderTargetTexture.bv.luac'),
  63. RunScriptWrapper('scripts/PassTree.bv.luac'),
  64. RunScriptWrapper('scripts/ReadbackTest.bv.luac'),
  65. RunScriptWrapper('scripts/depthoffieldtest.bv.luac'),
  66. RunScriptWrapper('scripts/exposuretest.bv.luac'),
  67. --Fast checking for the samples which don't have a test. Samples should be removed from this list once they have their own tests
  68. FastCheckSample('RHI/AlphaToCoverage'),
  69. FastCheckSample('RHI/AsyncCompute'),
  70. FastCheckSample('RHI/AuxGeom'),
  71. FastCheckSample('RHI/BindlessPrototype'),
  72. FastCheckSample('RHI/Compute'),
  73. FastCheckSample('RHI/CopyQueue'),
  74. FastCheckSample('RHI/DualSourceBlending'),
  75. FastCheckSample('RHI/IndirectRendering'),
  76. FastCheckSample('RHI/InputAssembly'),
  77. FastCheckSample('RHI/MSAA'),
  78. FastCheckSample('RHI/MultipleViews'),
  79. FastCheckSample('RHI/MultiRenderTarget'),
  80. FastCheckSample('RHI/MultiThread'),
  81. FastCheckSample('RHI/Queries'),
  82. FastCheckSample('RHI/SphericalHarmonics'),
  83. FastCheckSample('RHI/Stencil'),
  84. FastCheckSample('RHI/Swapchain'),
  85. FastCheckSample('RHI/Texture'),
  86. FastCheckSample('RHI/Texture3d'),
  87. FastCheckSample('RHI/TextureArray'),
  88. FastCheckSample('RHI/TextureMap'),
  89. FastCheckSample('RHI/Triangle'),
  90. FastCheckSample('RHI/TrianglesConstantBuffer'),
  91. FastCheckSample('RPI/AssetLoadTest'),
  92. FastCheckSample('RPI/AuxGeom'),
  93. FastCheckSample('RPI/SponzaBenchmark'),
  94. FastCheckSample('RPI/MultiViewSingleSceneAuxGeom'),
  95. FastCheckSample('RPI/RootConstants'),
  96. FastCheckSample('Features/Bloom'),
  97. FastCheckSample('Features/SkinnedMesh'),
  98. FastCheckSample('Features/SSAO'),
  99. FastCheckSample('Features/SSR'),
  100. FastCheckSample('Features/Tonemapping'),
  101. }
  102. if (GetRenderApiName() == "dx12") then
  103. table.insert(tests, FastCheckSample('RHI/RayTracing'))
  104. end
  105. if (GetRenderApiName() ~= "dx12") then
  106. table.insert(tests, FastCheckSample('RHI/Subpass'))
  107. end
  108. seed = GetRandomTestSeed()
  109. if (seed == 0) then
  110. Print("========= A random seed was not provided, running the tests in the original order =========")
  111. else
  112. Print("========= Using " .. seed .. " as a random seed to sort the tests =========")
  113. math.randomseed(seed)
  114. random_shuffle(tests)
  115. end
  116. for k,test in pairs(tests) do
  117. test()
  118. end