From a2772ebc9c45666f0e61508bbc564373bf0fe7e0 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 26 Apr 2011 15:23:23 -0600 Subject: [PATCH] tests: reduce dependencies We can assume that tests won't be run from a directory with an absolute name longer than native getcwd limits. * tests/test-linkat.c (main): Use lighter-weight getcwd. * tests/test-renameat.c (main): Likewise. * modules/linkat-tests (Depends-on): Relax dependency. * modules/renameat-tests (Depends-on): Likewise. * modules/fchdir-tests (Depends-on): Likewise. Also make cloexec dependency explicit. Signed-off-by: Eric Blake --- ChangeLog | 8 ++++++++ modules/fchdir-tests | 3 ++- modules/linkat-tests | 2 +- modules/renameat-tests | 2 +- tests/test-linkat.c | 4 ++-- tests/test-renameat.c | 4 ++-- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b6b0639c..ada7e9813 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2011-04-27 Eric Blake + tests: reduce dependencies + * tests/test-linkat.c (main): Use lighter-weight getcwd. + * tests/test-renameat.c (main): Likewise. + * modules/linkat-tests (Depends-on): Relax dependency. + * modules/renameat-tests (Depends-on): Likewise. + * modules/fchdir-tests (Depends-on): Likewise. Also make cloexec + dependency explicit. + save-cwd: reduce default dependency * modules/save-cwd (Depends-on): Use getcwd-lgpl. * lib/save-cwd.c: Update comments. diff --git a/modules/fchdir-tests b/modules/fchdir-tests index 462e70921..8f82dcee4 100644 --- a/modules/fchdir-tests +++ b/modules/fchdir-tests @@ -4,7 +4,8 @@ tests/signature.h tests/macros.h Depends-on: -getcwd +cloexec +getcwd-lgpl configure.ac: diff --git a/modules/linkat-tests b/modules/linkat-tests index 6df478197..c49c1b324 100644 --- a/modules/linkat-tests +++ b/modules/linkat-tests @@ -8,9 +8,9 @@ Depends-on: ignore-value areadlink-with-size filenamecat +getcwd-lgpl progname same-inode -xgetcwd configure.ac: diff --git a/modules/renameat-tests b/modules/renameat-tests index dcef7c19d..9e7b337d7 100644 --- a/modules/renameat-tests +++ b/modules/renameat-tests @@ -7,8 +7,8 @@ tests/macros.h Depends-on: ignore-value filenamecat +getcwd-lgpl progname -xgetcwd configure.ac: diff --git a/tests/test-linkat.c b/tests/test-linkat.c index 8d179e2fa..e3c8a5e1d 100644 --- a/tests/test-linkat.c +++ b/tests/test-linkat.c @@ -34,7 +34,6 @@ SIGNATURE_CHECK (linkat, int, (int, char const *, int, char const *, int)); #include "areadlink.h" #include "filenamecat.h" #include "same-inode.h" -#include "xgetcwd.h" #include "ignore-value.h" #include "macros.h" @@ -119,7 +118,8 @@ main (void) ASSERT (mkdir (BASE "sub1", 0700) == 0); ASSERT (mkdir (BASE "sub2", 0700) == 0); ASSERT (close (creat (BASE "00", 0600)) == 0); - cwd = xgetcwd (); + cwd = getcwd (NULL, 0); + ASSERT (cwd); dfd = open (BASE "sub1", O_RDONLY); ASSERT (0 <= dfd); diff --git a/tests/test-renameat.c b/tests/test-renameat.c index 1849a2441..96fe3a755 100644 --- a/tests/test-renameat.c +++ b/tests/test-renameat.c @@ -33,7 +33,6 @@ SIGNATURE_CHECK (renameat, int, (int, char const *, int, char const *)); #include #include "filenamecat.h" -#include "xgetcwd.h" #include "ignore-value.h" #include "macros.h" @@ -79,7 +78,8 @@ main (void) dfd = creat (BASE "00", 0600); ASSERT (0 <= dfd); ASSERT (close (dfd) == 0); - cwd = xgetcwd (); + cwd = getcwd (NULL, 0); + ASSERT (cwd); dfd = open (BASE "sub1", O_RDONLY); ASSERT (0 <= dfd); -- 2.11.0