mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 09:00:17 +02:00
Thunks: Adds functional thunk testing to CI
This is the bare minimum, it only tests glxinfo and vulkaninfo with and without thunks. Nothing more special than that. Already found the .1 bug with libvulkan host library loading.
This commit is contained in:
1 parent
790447115c
commit
1c580ec92c
5 files changed
+103
-1
No files matched your search
@@ -188,6 +188,40 @@ jobs:
|
||||
working-directory: ${{runner.workspace}}/build
|
||||
run: mv ${{runner.workspace}}/build/Testing/Temporary/LastTest.log ${{runner.workspace}}/build/Testing/Temporary/LastTest_ThunkgenTests.log || true
|
||||
|
||||
- name: Install
|
||||
if: matrix.arch[1] == 'x64'
|
||||
working-directory: ${{runner.workspace}}/build
|
||||
shell: bash
|
||||
run: cmake --build . --config $BUILD_TYPE --target install
|
||||
|
||||
- name: Test GL No-Thunks
|
||||
if: matrix.arch[1] == 'x64'
|
||||
working-directory: ${{runner.workspace}}/build
|
||||
shell: bash
|
||||
env:
|
||||
DISPLAY: ":0"
|
||||
run: cmake --build . --config $BUILD_TYPE --target thunk_functional_tests_nothunks
|
||||
|
||||
- name: No thunks Results move
|
||||
if: ${{ always() }}
|
||||
shell: bash
|
||||
working-directory: ${{runner.workspace}}/build
|
||||
run: mv ${{runner.workspace}}/build/Testing/Temporary/LastTest.log ${{runner.workspace}}/build/Testing/Temporary/LastTest_NoThunkResults.log || true
|
||||
|
||||
- name: Test GL Thunks
|
||||
if: matrix.arch[1] == 'x64'
|
||||
working-directory: ${{runner.workspace}}/build
|
||||
shell: bash
|
||||
env:
|
||||
DISPLAY: ":0"
|
||||
run: cmake --build . --config $BUILD_TYPE --target thunk_functional_tests_thunks
|
||||
|
||||
- name: Thunks Results move
|
||||
if: ${{ always() }}
|
||||
shell: bash
|
||||
working-directory: ${{runner.workspace}}/build
|
||||
run: mv ${{runner.workspace}}/build/Testing/Temporary/LastTest.log ${{runner.workspace}}/build/Testing/Temporary/LastTest_ThunkResults.log || true
|
||||
|
||||
- name: Truncate test results
|
||||
if: ${{ always() }}
|
||||
shell: bash
|
||||
@@ -207,4 +241,3 @@ jobs:
|
||||
name: Results-${{ env.runner_name }}
|
||||
path: ${{runner.workspace}}/build/Testing/Temporary/LastTest_*.log
|
||||
retention-days: 3
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"ThunksDB": {
|
||||
"GL": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"ThunksDB": {
|
||||
"Vulkan": 1
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,10 @@ add_subdirectory(POSIX/)
|
||||
add_subdirectory(gvisor-tests/)
|
||||
add_subdirectory(gcc-target-tests-32/)
|
||||
add_subdirectory(gcc-target-tests-64/)
|
||||
|
||||
if (BUILD_THUNKS)
|
||||
add_subdirectory(ThunkLibs)
|
||||
add_subdirectory(ThunkFunctionalTests)
|
||||
endif()
|
||||
|
||||
if (BUILD_FEX_LINUX_TESTS)
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
set(FUNCTIONAL_DEPENDS "")
|
||||
|
||||
function(AddThunksTest Bin ThunksFile)
|
||||
set (ARGS
|
||||
"-t" "${CMAKE_INSTALL_PREFIX}/lib/fex-emu/HostThunks"
|
||||
"-j" "${CMAKE_INSTALL_PREFIX}/share/fex-emu/GuestThunks"
|
||||
"-o" "stderr" "--no-silent" "-c" "irjit" "-n" "500"
|
||||
)
|
||||
if (NOT ThunksFile)
|
||||
set (TEST_NAME ThunkFunctionalTest-NoThunks-${Bin})
|
||||
else()
|
||||
set (TEST_NAME ThunkFunctionalTest-Thunks-${Bin})
|
||||
list (APPEND ARGS
|
||||
"-k" "${CMAKE_SOURCE_DIR}/CI/${ThunksFile}")
|
||||
endif()
|
||||
|
||||
add_test(NAME ${TEST_NAME}
|
||||
COMMAND "$<TARGET_FILE:FEXLoader>"
|
||||
${ARGS}
|
||||
"--"
|
||||
${Bin})
|
||||
set_property(TEST ${TEST_NAME} APPEND PROPERTY DEPENDS "${Bin}")
|
||||
|
||||
list(APPEND FUNCTIONAL_DEPENDS "${TEST_NAME}")
|
||||
endfunction()
|
||||
|
||||
function(AddTest Bin ThunksFile)
|
||||
AddThunksTest("${Bin}" "")
|
||||
AddThunksTest("${Bin}" "${ThunksFile}")
|
||||
endfunction()
|
||||
|
||||
AddTest("/usr/bin/glxinfo" "GLThunks.json")
|
||||
AddTest("/usr/bin/vulkaninfo" "VulkanThunks.json")
|
||||
|
||||
execute_process(COMMAND "nproc" OUTPUT_VARIABLE CORES)
|
||||
string(STRIP ${CORES} CORES)
|
||||
|
||||
add_custom_target(
|
||||
thunk_functional_tests_nothunks
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||
USES_TERMINAL
|
||||
COMMAND "ctest" "--timeout" "302" "-j${CORES}" "-R" "ThunkFunctionalTest-NoThunks-\.*"
|
||||
DEPENDS "${FUNCTIONAL_DEPENDS}")
|
||||
|
||||
add_custom_target(
|
||||
thunk_functional_tests_thunks
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||
USES_TERMINAL
|
||||
COMMAND "ctest" "--timeout" "302" "-j${CORES}" "-R" "ThunkFunctionalTest-Thunks-\.*"
|
||||
DEPENDS "${FUNCTIONAL_DEPENDS}")
|
||||
|
||||
add_custom_target(
|
||||
thunk_functional_tests
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||
USES_TERMINAL
|
||||
COMMAND "ctest" "--timeout" "302" "-j${CORES}" "-R" "ThunkFunctionalTest\.*"
|
||||
DEPENDS "${FUNCTIONAL_DEPENDS}")
|
||||
Reference in new issue
Block a user