Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
Rufflewind committed Jul 1, 2024
1 parent e8ee4d5 commit 3621584
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 10 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,9 @@ jobs:
fail-fast: false
matrix:
include:
- { os: macOS-13, stack: lts-12.26, stack-extra-deps: "bytestring-0.11.3.0, filepath-1.4.100.0, unix-2.8.0.0" }
- { os: macos-latest, stack: lts-22.7, stack-extra-deps: "bytestring-0.11.5.3, filepath-1.5.2.0, os-string-2.0.2, unix-2.8.5.1", stack-package-flags: "{directory: {os-string: true}, unix: {os-string: true}}", ghc-flags: -Werror=deprecations }
- { os: ubuntu-latest, ghc: 8.4.4, cabal: 3.0.0.0, overrides: "before_prepare() { sed -i.bak /utimensat/d configure.ac; }" }
- { os: ubuntu-latest, ghc: 8.6.5, cabal: 3.0.0.0, overrides: "before_prepare() { sed -i.bak /utimensat/d configure.ac; }" }
- { os: ubuntu-latest, ghc: 8.10.7, cabal: 3.8.1.0 }
- { os: ubuntu-latest, ghc: 9.0.2, cabal: 3.8.1.0 }
- { os: ubuntu-latest, ghc: 9.2.4, cabal: 3.8.1.0 }
- { os: ubuntu-latest, ghc: 9.4.3, cabal: 3.8.1.0 }
- { os: ubuntu-latest, ghc: latest, cabal: latest, cabal-package-flags: +os-string, ghc-flags: -Werror=deprecations }
- { os: windows-latest, stack: lts-12.26, stack-extra-deps: "bytestring-0.11.3.0, filepath-1.4.100.0, time-1.8.0.2, Win32-2.13.3.0", overrides: "before_prepare() { sed -i.bak -e /CreateSymbolicLinkW/d -e /GetFinalPathNameByHandleW/d configure.ac; }" }
- { os: windows-latest, stack: lts-17.5, stack-extra-deps: "bytestring-0.11.3.0, filepath-1.4.100.0, time-1.9.3, Win32-2.13.3.0", overrides: "before_prepare() { sed -i.bak -e /CreateSymbolicLinkW/d -e /GetFinalPathNameByHandleW/d configure.ac; }" }
- { os: windows-latest, stack: lts-17.5, stack-extra-deps: "bytestring-0.11.3.0, filepath-1.4.100.0, time-1.9.3, Win32-2.13.3.0" }
- { os: windows-latest, stack: lts-22.7, stack-extra-deps: "bytestring-0.11.5.3, filepath-1.5.2.0, os-string-2.0.2, time-1.14, Win32-2.14.0.0", stack-package-flags: "{directory: {os-string: true}, Win32: {os-string: true}}", ghc-flags: -Werror=deprecations }
runs-on: ${{ matrix.os }}
env:
CABAL_PACKAGE_FLAGS: ${{ matrix.cabal-package-flags }}
Expand Down
39 changes: 39 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#include <windows.h>
#include <stdio.h>

const wchar_t *error_string(DWORD code)
{
static wchar_t message[1024];
if (!FormatMessageW(
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, code, 0, message, sizeof(message) / sizeof(*message), NULL)) {
wprintf(L"??? %d\n", GetLastError());
return L"???";
}
return message;
}

static const wchar_t *dir = L"VERYLONGDIRECTORYNAME";

int main(void)
{
wchar_t buf[512], buf2[512];
if (!CreateDirectoryW(dir, NULL)) {
DWORD code = GetLastError();
if (code != ERROR_ALREADY_EXISTS) {
wprintf(L"CreateDirectoryA: %ls\n", error_string(code));
return 1;
}
}
if (!GetShortPathNameW(dir, buf, sizeof(buf) / sizeof(*buf))) {
wprintf(L"GetShortPathNameW: %ls\n", error_string(GetLastError()));
return 1;
}
wprintf(L"short path = %ls\n", buf);
if (!GetLongPathNameW(buf, buf2, sizeof(buf2) / sizeof(*buf2))) {
wprintf(L"GetLongPathNameW: %ls\n", error_string(GetLastError()));
return 1;
}
wprintf(L"short-then-long path = %ls\n", buf2);
return 0;
}
9 changes: 9 additions & 0 deletions tools/testscript
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ before_prepare() {

prepare() {
before_prepare

(
ls /usr/bin/x86_64*
CC=x86_64-w64-mingw32-gcc
$CC -dumpmachine
$CC -Wall main.c
./a.exe
)

if [ -f configure.ac ]; then
autoreconf -i
fi
Expand Down

0 comments on commit 3621584

Please sign in to comment.