Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
# file gets renamed again ...

ChangeLog merge=merge-changelog
*.sh eol=lf
63 changes: 63 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ jobs:
name: install
path: _dest/

- name: Build test programs
shell: msys2 {0}
run: |
make -C x86_64-pc-cygwin/winsup/testsuite -j8 \
CFLAGS="-O2 -pipe -ggdb -std=gnu89 -w" check_programs

- name: Bundle up worktree
shell: msys2 {0}
run: $WINDIR/system32/tar.exe -czf wt.tgz --exclude _dest --exclude .git --exclude wt.tgz .

- name: Upload worktree archive
uses: actions/upload-artifact@v7
with:
name: wt.tgz
path: wt.tgz

generate-msys2-tests-matrix:
runs-on: ubuntu-latest
outputs:
Expand Down Expand Up @@ -93,3 +109,50 @@ jobs:
- name: Run tests
uses: msys2/msys2-tests@main

cygwin-tests:
needs: [build]
runs-on: windows-latest
steps:
- name: setup-msys2
uses: msys2/setup-msys2@v2
with:
msystem: MSYS
update: true
install: msys2-devel base-devel diffutils make perl busybox cygutils

- name: Download worktree archive
uses: actions/download-artifact@v7
with:
name: wt.tgz

- name: Extract worktree
shell: msys2 {0}
run: $WINDIR/system32/tar.exe -xzf wt.tgz

- name: Run the test suite of Cygwin
shell: msys2 {0}
run: |
export PATH=/usr/bin:$WINDIR/system32
export MAKEFLAGS=-j8
export MSYS=winsymlinks:nativestrict
WINSUP=$PWD/x86_64-pc-cygwin/winsup
cp $WINSUP/cygserver/cygserver.exe $WINSUP/testsuite/testinst/usr/bin/
( cd $WINSUP/testsuite/testinst/usr/bin && PATH=$PWD:$WINDIR/system32 "$WINDIR/System32/WindowsPowerShell/v1.0/powershell.exe" -command '& .\cygserver.exe' & )
# cygserver is launched asynchronously; wait for it to come up before
# running the SysV IPC tests (semtest/shmtest/msgtest) that depend on
# it, otherwise they race its startup and fail intermittently.
for i in $(seq 1 60); do
"$WINDIR/System32/tasklist.exe" //FI "IMAGENAME eq cygserver.exe" 2>/dev/null | grep -qi cygserver && break
sleep 1
done
sleep 5
cd $WINSUP && make check AM_COLOR_TESTS=always

- name: Upload testsuite logs
if: always()
uses: actions/upload-artifact@v7
with:
name: cygwin-testsuite-logs
path: |
x86_64-pc-cygwin/winsup/testsuite/**/*.log
x86_64-pc-cygwin/winsup/testsuite/**/*.trs
181 changes: 0 additions & 181 deletions .github/workflows/cygwin.yml

This file was deleted.

4 changes: 2 additions & 2 deletions winsup/cygwin/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,8 @@ $(NEW_DLL_NAME): $(LDSCRIPT) libdll.a $(VERSION_OFILES) $(LIBSERVER)\
$(newlib_build)/libm.a \
$(newlib_build)/libc.a \
-lgcc -lkernel32 -lntdll -Wl,-Map,msys.map
@$(MKDIR_P) ${target_builddir}/winsup/testsuite/testinst/bin/
$(AM_V_at)$(INSTALL_PROGRAM) $(NEW_DLL_NAME) ${target_builddir}/winsup/testsuite/testinst/bin/$(DLL_NAME)
@$(MKDIR_P) ${target_builddir}/winsup/testsuite/testinst/usr/bin/
$(AM_V_at)$(INSTALL_PROGRAM) $(NEW_DLL_NAME) ${target_builddir}/winsup/testsuite/testinst/usr/bin/$(DLL_NAME)

# msys-2.0 import library
toolopts=--cpu=@target_cpu@ --ar=@AR@ --as=@AS@ --nm=@NM@ --objcopy=@OBJCOPY@
Expand Down
18 changes: 13 additions & 5 deletions winsup/testsuite/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ check_PROGRAMS = \
# flags for linking against the just built implib
# TODO: use -nostdinc and to-be-installed headers as well?
LDFLAGS_FOR_TESTDLL = -nodefaultlibs
LDADD_FOR_TESTDLL = $(builddir)/../cygwin/libcygwin.a -lgcc -lkernel32 -luser32
LDADD_FOR_TESTDLL = $(builddir)/../cygwin/libmsys-2.0.a -lgcc -lkernel32 -luser32

# flags for test executables
AM_CPPFLAGS = -I$(srcdir)/libltp/include
Expand All @@ -334,16 +334,24 @@ TESTS = $(check_PROGRAMS) \

# expected fail tests
XFAIL_TESTS = \
winsup.api/ltp/access01 \
winsup.api/ltp/access05 \
winsup.api/ltp/chmod01 \
winsup.api/ltp/setgroups01 \
winsup.api/ltp/setuid02 \
winsup.api/ltp/stat02 \
winsup.api/ltp/symlink01 \
winsup.api/ltp/symlink03 \
winsup.api/ltp/symlink05 \
winsup.api/ltp/ulimit01 \
winsup.api/ltp/umask03 \
winsup.api/ltp/unlink08 \
winsup.api/samples/sample-fail

# cygrun.sh test-runner script, and variables used by it:
LOG_COMPILER = $(srcdir)/cygrun.sh

export runtime_root=$(abs_builddir)/testinst/bin
export runtime_root=$(abs_builddir)/testinst/usr/bin
export cygrun=$(builddir)/mingw/cygrun

# Set up things in the Cygwin 'installation' at testsuite/testinst/ to provide
Expand All @@ -365,9 +373,9 @@ export cygrun=$(builddir)/mingw/cygrun

check-local:
$(MKDIR_P) ${builddir}/testinst/tmp
cd ${builddir}/testinst/bin && cp /usr/libexec/busybox/bin/busybox.exe sh.exe
cd ${builddir}/testinst/bin && cp /usr/libexec/busybox/bin/busybox.exe sleep.exe
cd ${builddir}/testinst/bin && cp /usr/libexec/busybox/bin/busybox.exe ls.exe
cd ${builddir}/testinst/usr/bin && cp /usr/bin/busybox.exe sh.exe
cd ${builddir}/testinst/usr/bin && cp /usr/bin/busybox.exe sleep.exe
cd ${builddir}/testinst/usr/bin && cp /usr/bin/busybox.exe ls.exe

# target to build all the programs needed by check, without running check
check_programs: $(check_PROGRAMS)
Expand Down
2 changes: 1 addition & 1 deletion winsup/testsuite/cygrun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export PATH="$runtime_root:${PATH}"
if [ "$1" = "./mingw/cygload" ]
then
windows_runtime_root=$(cygpath -m $runtime_root)
$cygrun "$exe -v -cygwin $windows_runtime_root/cygwin1.dll"
MSYS_NO_PATHCONV=1 $cygrun "$exe -v -cygwin $windows_runtime_root/msys-2.0.dll"
else
cygdrop $cygrun $exe
fi
9 changes: 7 additions & 2 deletions winsup/testsuite/libltp/lib/search_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ printf("search_path: cmd = %s, access_mode = %d, fullpath = %d\n", cmd, access_m
PATH_MAX);
return -1;
}
sprintf(res_path, "%s/%s", curpath, cmd);
/* Avoid a leading "//": on Cygwin/MSYS2 a path starting with
"//" denotes a UNC network path. When cwd is the root "/"
(as in the MSYS2 testsuite install-root) "%s/%s" would yield
"//cmd"; collapse curpath to "" so we emit "/cmd" instead. */
sprintf(res_path, "%s/%s", strcmp(curpath, "/") ? curpath : "", cmd);
}
else
strcpy(res_path, cmd);
Expand Down Expand Up @@ -202,7 +206,8 @@ printf("search_path: tmppath = %s\n", tmppath);
continue;
}

sprintf(res_path, "%s/%s", tmppath, cmd);
/* Same UNC-path guard as above for the PATH-scan branch. */
sprintf(res_path, "%s/%s", strcmp(tmppath, "/") ? tmppath : "", cmd);
#if DEBUG
printf("search_path: res_path = '%s'\n", res_path);
#endif
Expand Down
Loading