So far this MR is just for experimentation, do not review it.
-- v11: ci: Execute the shader runner on the correct test data on Windows. ci: Deduplicate the CI configuration for Windows. Test.
From: Giovanni Mascellani gmascellani@codeweavers.com
--- Makefile.am | 2 +- tests/hlsl/{lerp.shader_test => move_test.shader_test} | 0 2 files changed, 1 insertion(+), 1 deletion(-) 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/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 | 2 +- tests/driver.c | 36 +++++++++++++----------------------- 2 files changed, 14 insertions(+), 24 deletions(-)
diff --git a/gitlab/test.yml b/gitlab/test.yml index cfc4906f5..76df1be4e 100644 --- a/gitlab/test.yml +++ b/gitlab/test.yml @@ -8,7 +8,7 @@ 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)' artifacts: when: always paths: diff --git a/tests/driver.c b/tests/driver.c index 504f51dfb..99860f51d 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>
@@ -220,35 +221,24 @@ static bool run_tests_for_directory(const char *commit_dir) 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); }