1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

15 commits

Author SHA1 Message Date
Eli Zaretskii
317f6a2370 Unconditionally build and test the ice-9/popen module.
* module/Makefile.am (ICE_9_SOURCES): Add ice-9/popen.scm.
  (ICE_9_SOURCES) [BUILD_ICE_9_POPEN]: Remove conditional addition
  of ice-9/popen.scm.
  (SCRIPTS_SOURCES): Add scripts/autofrisk.scm and
  scripts/scan-api.scm unconditionally.
  (SCRIPTS_SOURCES) [BUILD_ICE_9_POPEN]: Remove conditional addition
  of scripts/autofrisk.scm and scripts/scan-api.scm.

* configure.ac: Remove the BUILD_ICE_9_POPEN condition.

* test-suite/tests/popen.test (if-supported): Don't test for 'fork
 feature being supported.
2014-07-03 19:20:00 +03:00
Ludovic Courtès
82b8cfa40c tests: Use NUL instead of /dev/null on MinGW.
Reported by Eli Zaretskii <eliz@gnu.org>.

* test-suite/test-suite/lib.scm (%null-device): New variable.
* test-suite/tests/c-api.test (egrep): Use %NULL-DEVICE instead of
  /dev/null.
* test-suite/tests/popen.test ("open-input-pipe")["no duplicate"]:
  Likewise.
2014-06-11 14:36:55 +02:00
Ludovic Courtès
df3d365a99 build: Build and check (ice-9 popen) only when --enable-posix and HAVE_FORK.
Fixes <http://bugs.gnu.org/13848>.
Reported by Jan Schukat <shookie@email.de>.

* configure.ac: Rename `HAVE_FORK' conditional to `BUILD_ICE_9_POPEN'.
  Set it when both $enable_posix and $ac_cv_func_fork are true.
* libguile/posix.c (scm_init_posix): Add the `fork' feature.
* doc/ref/api-options.texi (Common Feature Symbols): Add `fork'.
* doc/ref/posix.texi (Pipes): Add footnote mentioning the `fork'
  feature.
* module/Makefile.am (SCRIPTS_SOURCES): Make `scripts/autofrisk.scm' and
  `scripts/scan-api.scm' conditional on `BUILD_ICE_9_POPEN'.
* test-suite/tests/popen.test (if-supported): New macro.
  Wrap body in `if-supported'.
2013-03-29 19:20:01 +01:00
Mark H Weaver
bd79ebf318 Portability fixes for popen.test (for when /bin/sh is not bash)
* test-suite/tests/popen.test (open-input-pipe no-duplicate): Pass
  "read REPLY" command instead of "read" to the subshell, for improved
  portability.  In particular, it is needed when /bin/sh is dash.

  (open-output-pipe no-duplicate): Pass "exec guile [...]" instead of
  "guile [...]" to the subshell, to ensure that the subshell will not
  run guile as a subprocess while holding a duplicate of STDIN, which
  would cause this test to fail.  This is needed when /bin/sh is dash.
2011-03-02 14:12:53 -05:00
Andy Wingo
6f06e8d35f autocompile -> auto-compile
* NEWS:
* check-guile.in:
* doc/guile.1:
* doc/ref/scheme-scripts.texi:
* libguile/init.c:
* libguile/load.c:
* libguile/load.h:
* libguile/script.c:
* module/Makefile.am:
* module/ice-9/boot-9.scm:
* module/scripts/compile.scm:
* module/system/base/compile.scm:
* test-suite/Makefile.am:
* test-suite/tests/popen.test: Change "autocompile" to "auto-compile" or
  "auto_compile", as appropriate, in variable names, function names,
  command line arguments, and the documentation.
2011-02-13 15:06:11 +01:00
Ludovic Courtès
72a54e9480 popen.test: Don't auto-compile `popen-child.scm'.
* test-suite/tests/popen.test ("open-output-pipe")["no duplicate"]:
  Disable auto-compilation of `popen-child.scm'.
2010-09-01 15:03:24 +02:00
Neil Jerram
6069e97331 Fix hanging of popen.test
The "open-output-pipe":"no duplicate" test has been hanging, on and
off, and not completely reliably, for a few years.  It's now doing so
fairly reliably for me, and investigation shows that

- the child shell process is in a tight loop (99% CPU)

- the parent Guile process is stuck calling waitpid().

The problem is that the child hasn't got the SIGPIPE that the test
intends, and so is continuing to echo "closed" forever; and Guile is
waiting for it to terminate, forever.

I haven't fully debugged the SIGPIPE problem, but it sounds very like
what Chet Ramey describes here:
http://old.nabble.com/Re%3A-SIGPIPE-not-properly-reset-with-%27trap---PIPE%27-p20985595.html.

(And my version of bash is 3.2.39.)

So, a fix should be to use something other than shell to implement the
child; and it appears that this works.

* check-guile.in (TEST_SUITE_DIR): Export.

* test-suite/tests/popen-child.scm: New script file.

* test-suite/tests/popen.test ("open-output-pipe", "no duplicate"):
  Use Guile for the child process, instead of shell.
2010-07-01 22:16:54 +01:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Neil Jerram
12798872ff Fix popen.test on NetBSD and Ubuntu Jaunty, where sh is not Bash
Thanks to Greg Troxel for reporting, and Barry Fishman for the
explanation and fix.

* test-suite/tests/popen.test ("open-input-pipe"): Use shell function
  `read' with an explicit argument, as apparently not all shells
  support read with no argument.
2009-06-06 00:15:32 +01:00
Neil Jerram
88f2f7a127 Avoid "no duplicate" popen tests leaving zombie processes
On the one hand we want the child process in these tests to exit.  On
the other, we don't want it to exit before the parent Guile code has
tested the relevant condition (EOF in the first test, broken pipe in
the second) - because these conditions would obviously be true if the
child had already exited, and that's not what we're trying to test
here.  We're trying to test getting EOF and broken pipe while the
child process is still alive.

* test-suite/tests/popen.test (open-input-pipe:no duplicate): Add
  another pipe from parent to child, so that the child can finish by
  reading from this.  Then the parent controls the child lifetime by
  writing to this pipe.

* test-suite/tests/popen.test (open-output-pipe:no duplicate): Add
  another pipe from child to parent, and have the child finish by
  endlessly writing into this.  Then the parent controls the child
  lifetime by closing its end of the pipe, causing a broken pipe in
  the child.
2009-05-20 19:07:25 +01:00
Kevin Ryde
8ab3d8a068 merge from 1.8 branch 2006-10-09 23:40:48 +00:00
Kevin Ryde
6e7d5622ee merge from 1.8 branch 2006-04-16 23:37:40 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Kevin Ryde
930d3b37a8 Fix a couple of typos in:
New file.
2003-10-02 00:00:42 +00:00
Kevin Ryde
3e690887f5 New file. 2003-09-19 01:05:13 +00:00