Skip to content

Commit

Permalink
Macos run test script
Browse files Browse the repository at this point in the history
  • Loading branch information
beau-lunarg committed Jan 22, 2025
1 parent e3af6bc commit 22ec7bd
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ jobs:
sudo mkdir -p /Users/test
sudo chown -R test:staff /Users/test
sudo chmod -R g+w ${{matrix.config.build_dir}}/darwin/universal/output/test
sudo su - test -c "cd $WORKING_PATH && ./run-tests.sh"
sudo su - test -c "cd $WORKING_PATH && ./run-tests_macos.sh"
- name: Upload test failure artifacts
uses: actions/upload-artifact@v4
if: ${{ failure() && steps.test_apps.conclusion == 'failure' }}
Expand Down
6 changes: 4 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ if (NOT DEFINED ENV{GFXRECON_NO_TEST_APPS})

install(TARGETS gfxrecon-testapp-runner RUNTIME DESTINATION ${GFXRECON_INSTALL_TESTDIR})
install(DIRECTORY known_good DESTINATION ${GFXRECON_INSTALL_TESTDIR})
install(PROGRAMS run-tests.sh DESTINATION ${GFXRECON_INSTALL_TESTDIR})
install(PROGRAMS run-tests.ps1 DESTINATION ${GFXRECON_INSTALL_TESTDIR})
install(TARGETS gfxrecon-convert RUNTIME DESTINATION ${GFXRECON_INSTALL_TESTDIR})
if (UNIX)
install(PROGRAMS run-tests.sh DESTINATION ${GFXRECON_INSTALL_TESTDIR})
install(FILES $<TARGET_FILE_DIR:VkLayer_gfxreconstruct>/staging-json/VkLayer_gfxreconstruct.json DESTINATION ${GFXRECON_INSTALL_TESTDIR}/vulkan/explicit_layer.d)
install(TARGETS VkLayer_gfxreconstruct RUNTIME DESTINATION ${GFXRECON_INSTALL_TESTDIR}/vulkan/explicit_layer.d LIBRARY DESTINATION ${GFXRECON_INSTALL_TESTDIR}/vulkan/explicit_layer.d)
elseif (APPLE)
install(PROGRAMS run-tests_macos.sh DESTINATION ${GFXRECON_INSTALL_TESTDIR})
else ()
install(PROGRAMS run-tests.ps1 DESTINATION ${GFXRECON_INSTALL_TESTDIR})
install(FILES $<TARGET_FILE_DIR:VkLayer_gfxreconstruct>/VkLayer_gfxreconstruct.json DESTINATION ${GFXRECON_INSTALL_TESTDIR})
install(TARGETS VkLayer_gfxreconstruct RUNTIME DESTINATION ${GFXRECON_INSTALL_TESTDIR} LIBRARY DESTINATION ${GFXRECON_INSTALL_TESTDIR})
endif ()
Expand Down
65 changes: 65 additions & 0 deletions test/CMakeLists.txt~
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
###############################################################################
# Copyright (c) 2018-2024 LunarG, Inc.
# All rights reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Author: LunarG Team
# Description: CMake script for gfxrecon tests
###############################################################################

if (NOT DEFINED ENV{GFXRECON_NO_TEST_APPS})
set(GFXRECON_INSTALL_TESTDIR ${CMAKE_INSTALL_PREFIX}/test)

add_subdirectory(icd)
add_subdirectory(test_apps)

enable_testing()
set(INSTALL_GTEST OFF)
find_package(GoogleTest REQUIRED)
include(GoogleTest)
add_executable(gfxrecon-testapp-runner
test_cases/triangle.cpp
test_cases/multisample-depth.cpp
test_cases/shader-objects.cpp
test_cases/pipeline-binaries.cpp
verify-gfxr.cpp
)
add_dependencies(gfxrecon-testapp-runner gfxrecon-testapps VkICD_mock_icd gfxrecon-convert VkLayer_gfxreconstruct)
target_include_directories(gfxrecon-testapp-runner PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(gfxrecon-testapp-runner
nlohmann_json::nlohmann_json
GTest::gtest GTest::gtest_main)
gtest_discover_tests(gfxrecon-testapp-runner)

install(TARGETS gfxrecon-testapp-runner RUNTIME DESTINATION ${GFXRECON_INSTALL_TESTDIR})
install(DIRECTORY known_good DESTINATION ${GFXRECON_INSTALL_TESTDIR})
install(PROGRAMS run-tests.sh DESTINATION ${GFXRECON_INSTALL_TESTDIR})
install(PROGRAMS run-tests_macos.sh DESTINATION ${GFXRECON_INSTALL_TESTDIR})
install(PROGRAMS run-tests.ps1 DESTINATION ${GFXRECON_INSTALL_TESTDIR})
install(TARGETS gfxrecon-convert RUNTIME DESTINATION ${GFXRECON_INSTALL_TESTDIR})
if (UNIX)
install(FILES $<TARGET_FILE_DIR:VkLayer_gfxreconstruct>/staging-json/VkLayer_gfxreconstruct.json DESTINATION ${GFXRECON_INSTALL_TESTDIR}/vulkan/explicit_layer.d)
install(TARGETS VkLayer_gfxreconstruct RUNTIME DESTINATION ${GFXRECON_INSTALL_TESTDIR}/vulkan/explicit_layer.d LIBRARY DESTINATION ${GFXRECON_INSTALL_TESTDIR}/vulkan/explicit_layer.d)
else ()
install(FILES $<TARGET_FILE_DIR:VkLayer_gfxreconstruct>/VkLayer_gfxreconstruct.json DESTINATION ${GFXRECON_INSTALL_TESTDIR})
install(TARGETS VkLayer_gfxreconstruct RUNTIME DESTINATION ${GFXRECON_INSTALL_TESTDIR} LIBRARY DESTINATION ${GFXRECON_INSTALL_TESTDIR})
endif ()

endif ()
16 changes: 16 additions & 0 deletions test/run-tests_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
VK_LAYER_PATH="$PWD/vulkan/explicit_layer.d" \
VK_IMPLICIT_LAYER_PATH="" \
LD_LIBRARY_PATH="$PWD/vulkan/explicit_layer.d:$PWD/test_apps" \
VK_DRIVER_FILES="$PWD/test_apps/VkICD_mock_icd.json" \
VK_ICD_FILENAMES="$PWD/test_apps/VkICD_mock_icd.json" \
VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_gfxreconstruct \
GFXRECON_CAPTURE_FILE_TIMESTAMP=false \
GFXRECON_CAPTURE_FILE=actual.gfxr \
VK_LOADER_LAYERS_DISABLE=~all~ \
VK_LOADER_LAYERS_ENABLE=*gfxreconstruct* \
DISPLAY=:0 \
GFXRECON_TESTAPP_HEADLESS=true \
GFXRECON_TESTAPP_MOCK_ICD="$PWD/test_apps/libVkICD_mock_icd.dylib" \
GFXRECON_LOG_LEVEL="info" \
VK_LOADER_DEBUG="all" \
./gfxrecon-testapp-runner
1 change: 1 addition & 0 deletions test/test_apps/common/test_app_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2922,6 +2922,7 @@ InitInfo device_initialization(const std::string& window_name)

device_initialization_phase_1(window_name, init);

std::cout << "loading test config" << std::endl;
init.test_config = try_load_test_config();

InstanceBuilder instance_builder;
Expand Down
1 change: 0 additions & 1 deletion test/test_apps/triangle/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ int main(int argc, char* argv[])
{
try
{
std::cout << "starting" << std::endl;
gfxrecon::test_app::triangle::App app{};
app.run("triangle");
return 0;
Expand Down

0 comments on commit 22ec7bd

Please sign in to comment.