diff options
author | Eli Zaretskii <eliz@gnu.org> | 2013-06-01 13:03:29 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2013-06-01 13:03:29 +0300 |
commit | 5482bf19246965d6839fe9df1aec0785f0b1a329 (patch) | |
tree | 818777446f62f531462f2b64b70d9868bcdcaa95 /test | |
parent | a25b9b39ac2c49b822328414240061f6d22ddef2 (diff) | |
download | egawk-5482bf19246965d6839fe9df1aec0785f0b1a329.tar.gz egawk-5482bf19246965d6839fe9df1aec0785f0b1a329.tar.bz2 egawk-5482bf19246965d6839fe9df1aec0785f0b1a329.zip |
Support |& on MS-Windows, both for sockets and for pipes.
io.c (SHUT_RD) [SD_RECEIVE]: Define to SD_RECEIVE.
(SHUT_WR) [SD_SEND]: Define to SD_SEND.
(SHUT_RDWR) [SD_BOTH]: Define to SD_BOTH.
(FD_TO_SOCKET, closemaybesocket) [!FD_TO_SOCKET]: New macros.
(SOCKET_TO_FD, SOCKET) [!SOCKET_TO_FD]: New macros.
(PIPES_SIMULATED): Define only for DJGPP.
(pipe) [__MINGW32__]: Define to call _pipe, unless PIPES_SIMULATED
is defined.
(init_io) [HAVE_SOCKETS]: Call init_sockets.
(iop_close, socketopen): Call closemaybesocket instead of close.
(redirect) [__MINGW32__]: Call wait_any with a non-zero argument.
(devopen) [__EMX__ || __MINGW32__]: Don't call stat on network
pseudo-filenames.
(two_way_open) [HAVE_SOCKETS]: Switch input and output to binary
mode if appropriate.
(two_way_open) [!PIPES_SIMULATED]: Use the __EMX__ code for MinGW
as well.
[__MINGW32__] Call spawnl to invoke $ComSpec and pass it a
suitably quoted command line.
(two_way_open) [__MINGW32__]: Wait only for a specified process
ID. If successful, update the exit status of the exited process.
Don't use signals that are undefined on MinGW.
(two_way_open) [!PIPES_SIMULATED]: Use the __EMX__ code for MinGW
as well.
(min): Define only if not already defined.
(read_with_timeout) [__MINGW32__]: Allow reading from sockets with
timeout.
(gawk_fclose) [__MINGW32__]: Close the underlying socket as well.
getopt.c: Include stdlib.h for MinGW as well.
pc/popen.h (SIGKILL) [__MINGW32__]: Define.
(kill, quote_cmd): New prototypes.
pc/popen.c: Include popen.h and errno.h.
(popen, pclose, system): Undefine macros.
(WIN32_LEAN_AND_MEAN) [__MINGW32__]: Define and include windows.h.
(kill, quote_cmd) [!PIPES_SIMULATED]: New functions.
(os_popen): Make the function definition match its prototype
exactly.
pc/gawkmisc.pc [HAVE_SOCKETS]: Include socket.h and windows.h.
(socket, setsockopt, bind, connect, listen, accept, recvfrom)
(shutdown): Undefine macros.
(os_close_on_exec) [__MINGW32__]: Non-trivial implementation.
(init_sockets, socket_to_fd, w32_socket, w32_setsockopt)
(w32_bind, w32_connect, w32_listen, w32_accept, valid_socket)
(w32_closesocket, w32_recvfrom, w32_shutdown) [HAVE_SOCKETS]: New
functions for MinGW, emulate Posix sockets specified by file
descriptors.
pc/config.h (HAVE_GETADDRINFO, HAVE_SOCKADDR_STORAGE)
(HAVE_SOCKETS) [__MINGW32__]: Define.
pc/config.sed (HAVE_GETADDRINFO, HAVE_SOCKADDR_STORAGE)
(HAVE_SOCKETS) [__MINGW32__]: Define.
pc/Makefile.tst (fmtspcl): Announce expected failure only if not
built with MPFR.
(inetecht, inetdayt): For MinGW, warn about time-outs.
(beginfile1, clos1way, getlndir): Announce expected failure only
with DJGPP.
(exit): Describe the failure on MinGW.
(readdir): Explain why test might fail with bad ls.exe.
pc/Makefile (mingw32, mingw32-readline, mingw32-mpfr)
(mingw32-readline-mpfr): Add -lws2_32 to the link flags.
(gawkmisc$O): Depend on socket.h.
(io$O): Depend on socket.h and in.h.
(popen$O): New dependency.
posix/gawkmisc.c (init_sockets): New dummy function.
extension/filefuncs.c [_WIN32]: Define WIN32_LEAN_AND_MEAN before
including windows.h.
extension/readdir.c [__MINGW32__]: Define WIN32_LEAN_AND_MEAN before
including windows.h.
extension/filefuncs.c [HAVE_GETSYSTEMTIMEASFILETIME]: Define
WIN32_LEAN_AND_MEAN before including windows.h.
test/clos1way.awk: Don't use features of Posix shells, to allow this
test to work on Windows.
test/beginfile2.sh: Leave one blank between the left quote and the
following slash. Use non-absolute name for a non-existent file.
This is to avoid breakage on Windows due to MSYS transformation of
Posix style /foo/bar absolute file names.
test/beginfile2.ok: Adapt to changes in beginfile2.sh.
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 12 | ||||
-rw-r--r-- | test/beginfile2.ok | 10 | ||||
-rwxr-xr-x | test/beginfile2.sh | 40 | ||||
-rw-r--r-- | test/clos1way.awk | 2 |
4 files changed, 38 insertions, 26 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index cb07ba4a..b5726c9d 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,15 @@ +2013-06-01 Eli Zaretskii <eliz@gnu.org> + + * clos1way.awk: Don't use features of Posix shells, to allow this + test to work on Windows. + + * beginfile2.sh: Leave one blank between the left quote and the + following slash. Use non-absolute name for a non-existent file. + This is to avoid breakage on Windows due to MSYS transformation of + Posix style /foo/bar absolute file names. + + * beginfile2.ok: Adapt to changes in beginfile2.sh. + 2013-05-30 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (profile4, profile5): New tests. diff --git a/test/beginfile2.ok b/test/beginfile2.ok index 2d872eae..fed71bb2 100644 --- a/test/beginfile2.ok +++ b/test/beginfile2.ok @@ -5,12 +5,12 @@ In BEGINFILE: beginfile2.in --Test 1b-- In BEGIN In BEGINFILE: beginfile2.in -In BEGINFILE: /file/does/not/exist -gawk: cmd. line:3: fatal: cannot open file `/file/does/not/exist' for reading (No such file or directory) +In BEGINFILE: file/does/not/exist +gawk: cmd. line:3: fatal: cannot open file `file/does/not/exist' for reading (No such file or directory) --Test 2-- In BEGINFILE: beginfile2.in In ENDFILE: beginfile2.in -In BEGINFILE: /file/does/not/exist +In BEGINFILE: file/does/not/exist --Test 3-- In BEGINFILE: beginfile2.in In ENDFILE: beginfile2.in @@ -47,12 +47,12 @@ In ENDFILE: beginfile2.sh beginfile2.in 1 2 --Test 9a-- -Skipping: 1:/file/does/not/exist +Skipping: 1:file/does/not/exist In BEGINFILE: 2:beginfile2.in In Rule: beginfile2.in In ENDFILE: beginfile2.in --Test 9b-- -Skipping: 1:/file/does/not/exist +Skipping: 1:file/does/not/exist Skipping: 2:beginfile2.in In ENDFILE: beginfile2.in --Test 10-- diff --git a/test/beginfile2.sh b/test/beginfile2.sh index 69161200..dffaa88b 100755 --- a/test/beginfile2.sh +++ b/test/beginfile2.sh @@ -13,70 +13,70 @@ then fi echo "--Test 1a--" -prog=`$AWK '/#TEST1#/, /#TEST2#/' $AWKPROG` +prog=`$AWK ' /#TEST1#/, /#TEST2#/' $AWKPROG` $AWK "$prog" $AWKPROG echo "--Test 1b--" -$AWK "$prog" $AWKPROG /file/does/not/exist +$AWK "$prog" $AWKPROG file/does/not/exist echo "--Test 2--" -prog=`$AWK '/#TEST2#/, /#TEST3#/' $AWKPROG` -$AWK "$prog" $AWKPROG /file/does/not/exist +prog=`$AWK ' /#TEST2#/, /#TEST3#/' $AWKPROG` +$AWK "$prog" $AWKPROG file/does/not/exist echo "--Test 3--" -prog=`$AWK '/#TEST3#/, /#TEST4#/' $AWKPROG` +prog=`$AWK ' /#TEST3#/, /#TEST4#/' $AWKPROG` $AWK -vsrc=$SCRIPT "$prog" $AWKPROG echo "--Test 4--" -prog=`$AWK '/#TEST4#/, /#TEST5#/' $AWKPROG` +prog=`$AWK ' /#TEST4#/, /#TEST5#/' $AWKPROG` $AWK -vsrc=$SCRIPT "$prog" $AWKPROG echo "--Test 5--" -prog=`$AWK '/#TEST5#/, /#TEST6#/' $AWKPROG` +prog=`$AWK ' /#TEST5#/, /#TEST6#/' $AWKPROG` $AWK "$prog" $AWKPROG echo "--Test 6--" -prog=`$AWK '/#TEST6#/, /#TEST7#/' $AWKPROG` +prog=`$AWK ' /#TEST6#/, /#TEST7#/' $AWKPROG` $AWK "$prog" $AWKPROG echo "--Test 7--" -prog=`$AWK '/#TEST7#/, /#TEST8#/' $AWKPROG` +prog=`$AWK ' /#TEST7#/, /#TEST8#/' $AWKPROG` $AWK "$prog" $AWKPROG $SCRIPT echo "--Test 8--" -prog=`$AWK '/#TEST8#/, /#TEST9#/' $AWKPROG` +prog=`$AWK ' /#TEST8#/, /#TEST9#/' $AWKPROG` $AWK "$prog" $AWKPROG echo "--Test 9a--" -prog=`$AWK '/#TEST9#/, /#TEST10#/' $AWKPROG` -$AWK "$prog" /file/does/not/exist $AWKPROG +prog=`$AWK ' /#TEST9#/, /#TEST10#/' $AWKPROG` +$AWK "$prog" file/does/not/exist $AWKPROG echo "--Test 9b--" -$AWK -vskip=1 "$prog" /file/does/not/exist $AWKPROG +$AWK -vskip=1 "$prog" file/does/not/exist $AWKPROG echo "--Test 10--" -prog=`$AWK '/#TEST10#/, /#TEST11#/' $AWKPROG` +prog=`$AWK ' /#TEST10#/, /#TEST11#/' $AWKPROG` $AWK "$prog" $AWKPROG $SCRIPT echo "--Test 11--" -prog=`$AWK '/#TEST11#/, /#TEST12#/' $AWKPROG` +prog=`$AWK ' /#TEST11#/, /#TEST12#/' $AWKPROG` $AWK "$prog" $AWKPROG $SCRIPT echo "--Test 12--" -prog=`$AWK '/#TEST12#/, /#TEST13#/' $AWKPROG` +prog=`$AWK ' /#TEST12#/, /#TEST13#/' $AWKPROG` $AWK "$prog" $AWKPROG $SCRIPT echo "--Test 13--" -prog=`$AWK '/#TEST13#/, /#TEST14#/' $AWKPROG` +prog=`$AWK ' /#TEST13#/, /#TEST14#/' $AWKPROG` $AWK "$prog" $AWKPROG $SCRIPT echo "--Test 14--" -prog=`$AWK '/#TEST14#/, /#TEST15#/' $AWKPROG` +prog=`$AWK ' /#TEST14#/, /#TEST15#/' $AWKPROG` $AWK "$prog" $AWKPROG $SCRIPT echo "--Test 15--" -prog=`$AWK '/#TEST15#/, /#TEST16#/' $AWKPROG` +prog=`$AWK ' /#TEST15#/, /#TEST16#/' $AWKPROG` $AWK "$prog" $AWKPROG $SCRIPT echo "--Test 16--" -prog=`$AWK '/#TEST16#/, /#TEST17#/' $AWKPROG` +prog=`$AWK ' /#TEST16#/, /#TEST17#/' $AWKPROG` $AWK "$prog" $AWKPROG $SCRIPT diff --git a/test/clos1way.awk b/test/clos1way.awk index 5bc40684..c9dab09a 100644 --- a/test/clos1way.awk +++ b/test/clos1way.awk @@ -1,5 +1,5 @@ BEGIN { - command = "LC_ALL=C sort" + command = "sort" n = split("abcdefghijklmnopqrstuvwxyz", a, "") for (i = n; i > 0; i--) { |