Ralf Wildenhues wrote: > * Jim Meyering wrote on Sun, May 23, 2010 at 10:14:30AM CEST: >> That is one of the key points of init.sh: automatically >> isolate tests, so that using generic (not obfuscated out-$$) >> names like 'out' and 'err' works safely, as expected. > > Ah, good. I really didn't read the script carefully enough. > >> tests/test-pwrite.c appears to be the culprit: >> >> char const *file = "out"; >> ... >> fd = open (file, O_CREAT | O_WRONLY, 0600); > > Ah, ok. Thanks! In that case, ok to commit this fix?
{crossed mail} Thanks, but no. I've pushed this: >From a4f094f64b19327ff087eee6467bdb067a37ae4c Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Sun, 23 May 2010 10:32:12 +0200 Subject: [PATCH] test-pwrite: do not leave behind a test file named "out" Revert commit d8fa18472a54c1cb2674c296b3d82443f234d5f7. The trivial-looking use of init.sh is really necessary. It ensures that the temporary file, "out", is created in a temporary directory, and removed upon termination. * tests/test-pwrite.sh: Re-add file. * modules/pwrite-tests: Reference it. --- ChangeLog | 10 ++++++++++ modules/pwrite-tests | 3 ++- tests/test-pwrite.sh | 7 +++++++ 3 files changed, 19 insertions(+), 1 deletions(-) create mode 100755 tests/test-pwrite.sh diff --git a/ChangeLog b/ChangeLog index d281ea6..40fe597 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2010-05-23 Jim Meyering <meyer...@redhat.com> + + test-pwrite: do not leave behind a test file named "out" + Revert commit d8fa18472a54c1cb2674c296b3d82443f234d5f7. + The trivial-looking use of init.sh is really necessary. + It ensures that the temporary file, "out", is created in + a temporary directory, and removed upon termination. + * tests/test-pwrite.sh: Re-add file. + * modules/pwrite-tests: Reference it. + 2010-05-23 Ralf Wildenhues <ralf.wildenh...@gmx.de> Fix output redirection buglet in init.sh. diff --git a/modules/pwrite-tests b/modules/pwrite-tests index 5654822..6249a8e 100644 --- a/modules/pwrite-tests +++ b/modules/pwrite-tests @@ -1,4 +1,5 @@ Files: +tests/test-pwrite.sh tests/test-pwrite.c tests/init.sh tests/signature.h @@ -9,5 +10,5 @@ Depends-on: configure.ac: Makefile.am: -TESTS += test-pwrite +TESTS += test-pwrite.sh check_PROGRAMS += test-pwrite diff --git a/tests/test-pwrite.sh b/tests/test-pwrite.sh new file mode 100755 index 0000000..94f0f38 --- /dev/null +++ b/tests/test-pwrite.sh @@ -0,0 +1,7 @@ +#!/bin/sh +. "${srcdir=.}/init.sh"; path_prepend_ . + +fail=0 +test-pwrite || fail=1 + +Exit $fail -- 1.7.1.342.g1c280