mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-09-13 09:16:14 -07:00
ci: Execute the shader runner on the correct test data on Windows.
This commit is contained in:
parent
50a56f6aeb
commit
f0a16d84ce
Notes:
Alexandre Julliard
2023-11-23 22:49:33 +01:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/474
@ -8,7 +8,8 @@
|
|||||||
tags:
|
tags:
|
||||||
- win10-21h2
|
- win10-21h2
|
||||||
script:
|
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:
|
artifacts:
|
||||||
when: always
|
when: always
|
||||||
paths:
|
paths:
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <shlobj.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);
|
printf("# FAIL: %u\n", test_count - success_count);
|
||||||
|
|
||||||
if (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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wmain(void)
|
int wmain(int argc, WCHAR **wargv)
|
||||||
{
|
{
|
||||||
WIN32_FIND_DATAA find_data;
|
char commit_num[16], commit_hash[16], commit_dir[16];
|
||||||
HANDLE find_handle;
|
|
||||||
bool ret = true;
|
|
||||||
|
|
||||||
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
|
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
|
||||||
|
|
||||||
find_handle = FindFirstFileA("artifacts/*-*", &find_data);
|
if (argc != 3)
|
||||||
if (find_handle == INVALID_HANDLE_VALUE)
|
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Cannot list commits, last error %ld.\n", GetLastError());
|
fprintf(stderr, "Call with commit number and hash.\n");
|
||||||
ret = false;
|
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return !ret;
|
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 !run_tests_for_directory(commit_dir);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user