[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCHv2 6/9] tests: reduce dependencies
From: |
Eric Blake |
Subject: |
[PATCHv2 6/9] tests: reduce dependencies |
Date: |
Tue, 26 Apr 2011 17:35:28 -0600 |
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 <address@hidden>
---
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 e998524..ea162d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2011-04-26 Eric Blake <address@hidden>
+ 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.
+
dirent-safer: drop unused link dependency
* modules/dirent-safer-tests (Makefile.am): Drop stale LDADD.
diff --git a/modules/fchdir-tests b/modules/fchdir-tests
index 462e709..8f82dce 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 6df4781..c49c1b3 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 dcef7c1..9e7b337 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 8d179e2..e3c8a5e 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 1849a24..96fe3a7 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 <sys/stat.h>
#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);
--
1.7.4.4
- Re: [PATCHv2 4/9] save-cwd: reduce dependency, (continued)
[PATCHv2 2/9] getcwd-lgpl: new module, Eric Blake, 2011/04/26
[PATCHv2 5/9] dirent-safer: drop unused link dependency, Eric Blake, 2011/04/26
[PATCHv2 6/9] tests: reduce dependencies,
Eric Blake <=
[PATCHv2 3/9] getcwd: enhance tests, Eric Blake, 2011/04/26
[PATCHv2 7/9] linkat, renameat: add missing dependency, Eric Blake, 2011/04/26
[PATCHv2 8/9] filenamecat-lgpl: fix licence, Eric Blake, 2011/04/26
[PATCHv2 9/9] fchdir: avoid extra chdir and fix test, Eric Blake, 2011/04/26