So far this MR is just for experimentation, do not review it.
-- v16: ci: Execute the shader runner on the correct test data on Windows. ci: Deduplicate the CI configuration for Windows. Test. Empty.
From: Giovanni Mascellani gmascellani@codeweavers.com
From: Giovanni Mascellani gmascellani@codeweavers.com
--- Makefile.am | 2 +- gitlab/build.yml | 143 ------------------ ...lerp.shader_test => move_test.shader_test} | 0 3 files changed, 1 insertion(+), 144 deletions(-) rename tests/hlsl/{lerp.shader_test => move_test.shader_test} (100%)
diff --git a/Makefile.am b/Makefile.am index 002746829..8aa01406b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -116,7 +116,7 @@ vkd3d_shader_tests = \ tests/hlsl/is-front-face.shader_test \ tests/hlsl/ldexp.shader_test \ tests/hlsl/length.shader_test \ - tests/hlsl/lerp.shader_test \ + tests/hlsl/move_test.shader_test \ tests/hlsl/lit.shader_test \ tests/hlsl/load-level.shader_test \ tests/hlsl/log.shader_test \ diff --git a/gitlab/build.yml b/gitlab/build.yml index 9695a3042..ed16202d2 100644 --- a/gitlab/build.yml +++ b/gitlab/build.yml @@ -1,66 +1,3 @@ -.build-linux: - stage: build - rules: - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' - image: $CI_REGISTRY/wine/vkd3d:debian-bookworm - interruptible: true - needs: - - job: build-image - optional: true - dependencies: [] - script: - - git config --global --add safe.directory $CI_PROJECT_DIR - - git clean -fdx - - git reset --hard - - rm -fr .git/rebase-merge - - mkdir artifacts - - cat /proc/cpuinfo > artifacts/cpuinfo.txt - - cat /proc/meminfo > artifacts/meminfo.txt - - vulkaninfo > artifacts/vulkaninfo.txt - - git rebase $CI_MERGE_REQUEST_DIFF_BASE_SHA --exec ./gitlab/build-linux - - if [ -f build_failed ] ; then exit 1 ; fi - - if [ -f tests_failed ] ; then exit 2 ; fi - artifacts: - when: always - paths: - - artifacts - -build-radv-64: - extends: .build-linux - tags: - - amd-gpu - variables: - VK_LOADER_DRIVERS_SELECT: 'radeon_*' - VKD3D_SHADER_CONFIG: 'force_validation' - -build-llvmpipe-64: - extends: .build-linux - allow_failure: - exit_codes: - - 2 - variables: - VK_LOADER_DRIVERS_SELECT: 'lvp_*' - VKD3D_SHADER_CONFIG: 'force_validation' - -build-radv-32: - extends: .build-linux - tags: - - amd-gpu - variables: - VK_LOADER_DRIVERS_SELECT: 'radeon_*' - CC: 'gcc -m32' - VKD3D_SHADER_CONFIG: 'force_validation' - -build-llvmpipe-32: - extends: .build-linux - allow_failure: - exit_codes: - - 2 - variables: - VK_LOADER_DRIVERS_SELECT: 'lvp_*' - CC: 'gcc -m32' - VKD3D_SHADER_CONFIG: 'force_validation' - build-crosstest: stage: build rules: @@ -86,83 +23,3 @@ build-crosstest: when: always paths: - artifacts - -.build-mingw: - stage: build - rules: - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' - image: $CI_REGISTRY/wine/vkd3d:debian-bookworm - interruptible: true - needs: - - job: build-image - optional: true - dependencies: [] - script: - - git config --global --add safe.directory $CI_PROJECT_DIR - - git clean -fdx - - git reset --hard - - rm -fr .git/rebase-merge - - mkdir artifacts - - cat /proc/cpuinfo > artifacts/cpuinfo.txt - - cat /proc/meminfo > artifacts/meminfo.txt - - git rebase $CI_MERGE_REQUEST_DIFF_BASE_SHA --exec ./gitlab/build-mingw - - if [ -f pipeline_failed ] ; then exit 1 ; fi - artifacts: - when: always - paths: - - artifacts - -build-mingw-64: - extends: .build-mingw - variables: - HOST: "x86_64-w64-mingw32" - -build-mingw-32: - extends: .build-mingw - variables: - HOST: "i686-w64-mingw32" - -build-mac: - stage: build - rules: - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' - allow_failure: - exit_codes: - - 2 - interruptible: true - needs: [] - dependencies: [] - tags: - - mac - script: - - git config --global --add safe.directory $CI_PROJECT_DIR - - git clean -fdx - - git reset --hard - - rm -fr .git/rebase-merge - # We use a custom ICD which is not marked as a portability driver, - # so that test programs are not confused. - - ./gitlab/patch_moltenvk_icd.sh - - export VK_DRIVER_FILES="$PWD/gitlab/MoltenVK_icd.json" - - mkdir artifacts - - system_profiler SPSoftwareDataType SPHardwareDataType > artifacts/systeminfo.txt - - vulkaninfo > artifacts/vulkaninfo.txt - - export PATH="/usr/local/opt/bison/bin:/usr/local/opt/flex/bin:$PATH" - - git clone --depth 1 --branch wine-3.21 https://gitlab.winehq.org/wine/wine.git - - cd wine - - mkdir build - - cd build - - ../configure --enable-win64 --without-x --without-freetype - - make tools/widl/widl - - cd ../.. - - export PATH="$PWD/wine/build/tools/widl:$PATH" - - git rebase $CI_MERGE_REQUEST_DIFF_BASE_SHA --exec ./gitlab/build-mac - - if [ -f build_failed ] ; then exit 1 ; fi - - if [ -f tests_failed ] ; then exit 2 ; fi - variables: - VKD3D_DISABLE_EXTENSIONS: "VK_EXT_descriptor_indexing" - VKD3D_SHADER_CONFIG: 'force_validation' - MVK_CONFIG_LOG_LEVEL: 1 - artifacts: - when: always - paths: - - artifacts diff --git a/tests/hlsl/lerp.shader_test b/tests/hlsl/move_test.shader_test similarity index 100% rename from tests/hlsl/lerp.shader_test rename to tests/hlsl/move_test.shader_test
From: Giovanni Mascellani gmascellani@codeweavers.com
--- gitlab/test.yml | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/gitlab/test.yml b/gitlab/test.yml index 97bebba53..cfc4906f5 100644 --- a/gitlab/test.yml +++ b/gitlab/test.yml @@ -1,4 +1,4 @@ -test-win-64: +.test-win: stage: test rules: - if: $CI_PIPELINE_SOURCE == 'merge_request_event' @@ -9,27 +9,17 @@ test-win-64: - win10-21h2 script: - ./artifacts/driver.cross64.exe - variables: - TEST_ARCH: "64" artifacts: when: always paths: - artifacts
+test-win-64: + extends: .test-win + variables: + TEST_ARCH: "64" + test-win-32: - stage: test - rules: - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' - interruptible: true - needs: - - job: build-crosstest - tags: - - win10-21h2 - script: - - ./artifacts/driver.cross64.exe + extends: .test-win variables: TEST_ARCH: "32" - artifacts: - when: always - paths: - - artifacts
From: Giovanni Mascellani gmascellani@codeweavers.com
--- gitlab/test.yml | 3 ++- tests/driver.c | 52 ++++++++++++++++++++++++++----------------------- 2 files changed, 30 insertions(+), 25 deletions(-)
diff --git a/gitlab/test.yml b/gitlab/test.yml index cfc4906f5..65a75d0e9 100644 --- a/gitlab/test.yml +++ b/gitlab/test.yml @@ -8,7 +8,8 @@ tags: - win10-21h2 script: - - ./artifacts/driver.cross64.exe + - git rebase $CI_MERGE_REQUEST_DIFF_BASE_SHA --exec './artifacts/driver.cross64.exe $(git cherry $CI_MERGE_REQUEST_DIFF_BASE_SHA HEAD^ | wc -l) $(git rev-parse --short HEAD)' + - if (Test-Path "pipeline_failed") { exit 1 } artifacts: when: always paths: diff --git a/tests/driver.c b/tests/driver.c index 504f51dfb..95f39adbb 100644 --- a/tests/driver.c +++ b/tests/driver.c @@ -18,6 +18,7 @@
#include <stdio.h> #include <stdbool.h> +#include <stdlib.h> #include <windows.h> #include <shlobj.h>
@@ -215,40 +216,43 @@ static bool run_tests_for_directory(const char *commit_dir) printf("# FAIL: %u\n", test_count - success_count);
if (test_count != success_count) - ret = false; + { + HANDLE handle; + + handle = CreateFileA("pipeline_failed", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (handle == INVALID_HANDLE_VALUE) + { + fprintf(stderr, "Cannot create failure file, last error %ld.\n", GetLastError()); + ret = false; + } + else + { + if (!CloseHandle(handle)) + fprintf(stderr, "Cannot close failure file, last error %ld.\n", GetLastError()); + } + }
return ret; }
-int wmain(void) +int wmain(int argc, WCHAR **wargv) { - WIN32_FIND_DATAA find_data; - HANDLE find_handle; - bool ret = true; + char commit_num[16], commit_hash[16], commit_dir[16];
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
- find_handle = FindFirstFileA("artifacts/*-*", &find_data); - if (find_handle == INVALID_HANDLE_VALUE) + if (argc != 3) { - fprintf(stderr, "Cannot list commits, last error %ld.\n", GetLastError()); - ret = false; + fprintf(stderr, "Call with commit number and hash.\n"); + return 1; } - else - { - do - { - ret &= run_tests_for_directory(find_data.cFileName); - } while (FindNextFileA(find_handle, &find_data));
- if (GetLastError() != ERROR_NO_MORE_FILES) - { - fprintf(stderr, "Cannot list tests, last error %ld.\n", GetLastError()); - ret = false; - } - - FindClose(find_handle); - } + WideCharToMultiByte(CP_ACP, 0, wargv[1], -1, commit_num, sizeof(commit_num), NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, wargv[2], -1, commit_hash, sizeof(commit_hash), NULL, NULL); + commit_num[sizeof(commit_num) - 1] = '\0'; + commit_hash[sizeof(commit_hash) - 1] = '\0'; + snprintf(commit_dir, sizeof(commit_dir), "%03d-%s", atoi(commit_num), commit_hash); + commit_dir[sizeof(commit_dir) - 1] = '\0';
- return !ret; + return !run_tests_for_directory(commit_dir); }
I guess you can't do this kind of experimentation inside your own repository?
Well, technically I can, as I can open merge requests to my own repository too. But it requires some more time and work, and I hoped this MR to not to be of little annoyance to anybody.