From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id 4C8813858CDA; Tue, 10 Jan 2023 10:29:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C8813858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673346556; bh=S6fmgTx/WzC7ufjQO27mPjOIkXxlJBJ+8ulOzdz8JgQ=; h=From:To:Subject:Date:From; b=ePAWhexTTZ49jBmvpzwUoIx13vQP3YjtObnlbopWdeQ5BZziDZp2Kaoyny9R4V9Bp kcFZwSsWvlvoHm73/LmWj5Zh/zd/xTiLc0Yi6oDSOqPfOexSOV+6mIJH+KzhPGDZT0 qRcwXBTVbEJM0qXazUdNShrM3SythaDlSBhp01L8= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jon Turney To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: Run testsuite against the just-built DLL X-Act-Checkin: newlib-cygwin X-Git-Author: Jon Turney X-Git-Refname: refs/heads/master X-Git-Oldrev: 13a7b16ea3ad64794b1cd7651ecfef9c258f3a6c X-Git-Newrev: 1a9f95d8941d58385fb76ec20fac143c035cec85 Message-Id: <20230110102916.4C8813858CDA@sourceware.org> Date: Tue, 10 Jan 2023 10:29:16 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D1a9f95d8941= d58385fb76ec20fac143c035cec85 commit 1a9f95d8941d58385fb76ec20fac143c035cec85 Author: Jon Turney Date: Fri Dec 23 13:05:34 2022 +0000 Cygwin: Run testsuite against the just-built DLL =20 Since 4e7817498efc, we're just running the tests against the installed DLL. We're arranging to put the build directory on the path, but since it doesn't contain cygwin1.dll (since it's built with a different name and renamed on installation), that doesn't have any effect. =20 Arrange to place the just-built DLL into a directory which the testsuite can place on it's path (while running the test, but not while compiling it). =20 Also fix any remaining references to cygwin0.dll in testsuite, documentation and comments. =20 Fixes: 4e7817498efc ("Cygwin: Makefile: Drop all the "test dll" conside= rations") Diff: --- winsup/cygwin/Makefile.am | 8 +++++--- winsup/cygwin/scripts/analyze_sigfe | 2 +- winsup/testsuite/Makefile.am | 3 ++- winsup/testsuite/README | 9 +++------ winsup/testsuite/config/default.exp | 2 +- winsup/testsuite/winsup.api/cygload.exp | 2 +- winsup/testsuite/winsup.api/winsup.exp | 8 +++++--- 7 files changed, 18 insertions(+), 16 deletions(-) diff --git a/winsup/cygwin/Makefile.am b/winsup/cygwin/Makefile.am index 2faa867f9..125358b4b 100644 --- a/winsup/cygwin/Makefile.am +++ b/winsup/cygwin/Makefile.am @@ -577,9 +577,9 @@ LIBSERVER =3D $(cygserver_blddir)/libcygserver.a $(LIBSERVER): $(MAKE) -C $(cygserver_blddir) libcygserver.a =20 -# We build as cygwin0.dll and rename at install time to overcome native +# We build as new-cygwin1.dll and rename at install time to overcome native # rebuilding issues (we don't want the build tools to see a partially built -# cygwin.dll and attempt to use it instead of the old one). +# cygwin1.dll and attempt to use it instead of the old one). =20 # linker script LDSCRIPT=3Dcygwin.sc @@ -601,6 +601,8 @@ $(NEW_DLL_NAME): $(LDSCRIPT) libdll.a $(VERSION_OFILES)= $(LIBSERVER)\ $(newlib_build)/libm.a \ $(newlib_build)/libc.a \ -lgcc -lkernel32 -lntdll -Wl,-Map,cygwin.map + @$(MKDIR_P) ${target_builddir}/winsup/testsuite/runtime/ + $(AM_V_at)$(INSTALL_PROGRAM) $(NEW_DLL_NAME) ${target_builddir}/winsup/te= stsuite/runtime/$(DLL_NAME) =20 # cygwin import library toolopts=3D--cpu=3D@target_cpu@ --ar=3D@AR@ --as=3D@AS@ --nm=3D@NM@ --objc= opy=3D@OBJCOPY@ @@ -712,7 +714,7 @@ install-ldif: uninstall-hook: uninstall-headers uninstall-ldif uninstall-libs =20 uninstall-libs: - rm -f $(DESTDIR)$(bindir)/cygwin1.dll + rm -f $(DESTDIR)$(bindir)/$(DLL_NAME) rm -f $(DESTDIR)$(toollibdir)/libg.a =20 uninstall-headers: diff --git a/winsup/cygwin/scripts/analyze_sigfe b/winsup/cygwin/scripts/an= alyze_sigfe index 8704eea48..f6bda2355 100755 --- a/winsup/cygwin/scripts/analyze_sigfe +++ b/winsup/cygwin/scripts/analyze_sigfe @@ -9,7 +9,7 @@ # This will do a crude test to see if the (NO)?SIGFE stuff is used properly # in cygwin.din. It is not perfect so do not use it to do a wholesale rep= lacement. # -# Input is the output of 'objdump --disassemble --demangle cygwin0.dll'. +# Input is the output of 'objdump --disassemble --demangle new-cygwin1.dll= '. # use strict; use vars qw'$v'; diff --git a/winsup/testsuite/Makefile.am b/winsup/testsuite/Makefile.am index ac68934d0..a7b435c46 100644 --- a/winsup/testsuite/Makefile.am +++ b/winsup/testsuite/Makefile.am @@ -45,7 +45,8 @@ testdll_tmpdir =3D $(shell cygpath -ma $(tmpdir) | sed -e= 's#^\([A-Z]\):#/cygdrive =20 site-extra.exp: ../config.status Makefile @rm -f ./tmp0 - @echo "set runtime_root \"`pwd`/../cygwin\"" >> ./tmp0 + @echo "set runtime_root \"`pwd`/runtime\"" >> ./tmp0 + @echo "set libdir \"`pwd`/../cygwin\"" >> ./tmp0 @echo "set CC \"$(CC)\"" >> ./tmp0 @echo "set CFLAGS \"\"" >> ./tmp0 @echo "set MINGW_CXX \"$(MINGW_CXX)\"" >> ./tmp0 diff --git a/winsup/testsuite/README b/winsup/testsuite/README index 2f6749bb8..c22b06594 100644 --- a/winsup/testsuite/README +++ b/winsup/testsuite/README @@ -2,10 +2,9 @@ =20 Here are some notes about adding and using this testsuite. =20 -First, all the programs are linked with libcygwin0.a, which is just -like libcygwin.a, except that it wants cygwin0.dll, not -cygwin1.dll. The testsuite adds the winsup build directory to the -PATH so that cygwin0.dll can be found by windows during testing. +The testsuite adds a directory containing the just built cygwin1.dll to th= e PATH +(during the run step) so that it can be found by the Windows loader during +testing. =20 Because we'll probably run into complaints about using two DLLs, we run cygrun.exe for each test. All this does is run the test with @@ -36,5 +35,3 @@ Cross-checking is not supported. =20 To test a subset of the test-suite, use $ make check CYGWIN_TESTSUITE_TESTS=3Dregexp - - diff --git a/winsup/testsuite/config/default.exp b/winsup/testsuite/config/= default.exp index 7ef16ee6a..ad91caa03 100644 --- a/winsup/testsuite/config/default.exp +++ b/winsup/testsuite/config/default.exp @@ -1,7 +1,7 @@ proc winsup_version {} { global env global runtime_root - clone_output "\n[exec grep -a ^%%% $runtime_root/cygwin0.dll]\n" + clone_output "\n[exec grep -a ^%%% $runtime_root/cygwin1.dll]\n" if { [info exists env(CYGWIN)] } { clone_output "CYGWIN=3D$env(CYGWIN)\n" } else { diff --git a/winsup/testsuite/winsup.api/cygload.exp b/winsup/testsuite/win= sup.api/cygload.exp index 8ba8249bb..e378820ad 100644 --- a/winsup/testsuite/winsup.api/cygload.exp +++ b/winsup/testsuite/winsup.api/cygload.exp @@ -32,7 +32,7 @@ if { $rv !=3D {0 {}} } { set redirect_output /dev/null } set windows_runtime_root [exec cygpath -m $runtime_root] - ws_spawn "./mingw-cygload.exe -cygwin $windows_runtime_root/cygwin0.dl= l > $redirect_output" + ws_spawn "./mingw-cygload.exe -cygwin $windows_runtime_root/cygwin1.dl= l > $redirect_output" if { $rv !=3D {0 {}} } { verbose -log "cygload: $rv" fail "cygload (execute)" diff --git a/winsup/testsuite/winsup.api/winsup.exp b/winsup/testsuite/wins= up.api/winsup.exp index f755c82d9..e81ead304 100644 --- a/winsup/testsuite/winsup.api/winsup.exp +++ b/winsup/testsuite/winsup.api/winsup.exp @@ -14,9 +14,9 @@ set ltp_libs "$ltp_libs" set add_includes $ltp_includes set add_libs $ltp_libs =20 -set test_filter "" +set orig_path "$env(PATH)" =20 -set env(PATH) "$runtime_root:$env(PATH)" +set test_filter "" =20 if { [info exists env(CYGWIN_TESTSUITE_TESTS)] } { set test_filter "$env(CYGWIN_TESTSUITE_TESTS)" @@ -61,7 +61,7 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c = $srcdir/$subdir/*/*.{cc if [ file exists "$srcdir/$subdir/$basename.exp" ] then { source "$srcdir/$subdir/$basename.exp" } else { - ws_spawn "$CC -nodefaultlibs -mwin32 $CFLAGS $src $add_includes $add_libs= $runtime_root/binmode.o -lgcc $runtime_root/libcygwin.a -lkernel32 -luser3= 2 -o $base.exe" + ws_spawn "$CC -nodefaultlibs -mwin32 $CFLAGS $src $add_includes $add_libs= $libdir/binmode.o -lgcc $libdir/libcygwin.a -lkernel32 -luser32 -o $base.e= xe" if { $rv } { fail "$testcase (compile)" } else { @@ -71,8 +71,10 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c= $srcdir/$subdir/*/*.{cc set redirect_output /dev/null } file mkdir $tmpdir/$base + set env(PATH) "$runtime_root:$env(PATH)" ws_spawn "$cygrun ./$base.exe $testdll_tmpdir/$base > $redirect_outpu= t" file delete -force $tmpdir/$base + set env(PATH) "$orig_path" if { $rv } { fail "$testcase (execute)" if { $xfail_expected } {