comparison tests/test-unlinkat.c @ 12517:013b270a78b9

tests: don't require debug system() to pass When running a cross-compilation to mingw on a Linux host, but without a valid mingw rm executable, the debug-only system() call would fail. This is not fatal to the test, since the call is merely a debugging aid if a prior call to the test encountered a failure and left garbage; in general, the tests should pass and the system() call have nothing to clean in the first place. Also, the system() call only needs to happen once at startup, not once per iteration into the tests performed by .h files. * tests/test-lstat.h (test_lstat_func): Move debug cleanup... * tests/test-rmdir.h (test_rmdir_func): Likewise. * tests/test-unlink.h (test_unlink_func): Likewise. * tests/test-fstatat.c (main): ...into callers. * tests/test-lstat.c (main): Likewise. * tests/test-rmdir.c (main): Likewise. * tests/test-unlink.c (main): Likewise. * tests/test-unlinkat.c (main): Likewise. * tests/test-areadlink-with-size.c (main): Don't require a debug-only system call to pass, aiding cross-testing to mingw. * tests/test-areadlink.c (main): Likewise. * tests/test-areadlinkat-with-size.c (main): Likewise. * tests/test-areadlinkat.c (main): Likewise. * tests/test-canonicalize-lgpl.c (main): Likewise. * tests/test-canonicalize.c (main): Likewise. * tests/test-chown.c (main): Likewise. * tests/test-fchownat.c (main): Likewise. * tests/test-lchown.c (main): Likewise. * tests/test-fdutimensat.c (main): Likewise. * tests/test-futimens.c (main): Likewise. * tests/test-link.c (main): Likewise. * tests/test-linkat.c (main): Likewise. * tests/test-mkdir.c (main): Likewise. * tests/test-mkdirat.c (main): Likewise. * tests/test-mkfifo.c (main): Likewise. * tests/test-mkfifoat.c (main): Likewise. * tests/test-mknod.c (main): Likewise. * tests/test-readlink.c (main): Likewise. * tests/test-remove.c (main): Likewise. * tests/test-rename.c (main): Likewise. * tests/test-renameat.c (main): Likewise. * tests/test-symlink.c (main): Likewise. * tests/test-symlinkat.c (main): Likewise. * tests/test-utimens.c (main): Likewise. * tests/test-utimensat.c (main): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Tue, 29 Dec 2009 06:58:18 -0700
parents a48d3d749ca5
children c2cbabec01dd
comparison
equal deleted inserted replaced
12516:94cbe360f46e 12517:013b270a78b9
58 main (void) 58 main (void)
59 { 59 {
60 /* FIXME: Add tests of fd other than ".". */ 60 /* FIXME: Add tests of fd other than ".". */
61 int result1; 61 int result1;
62 int result2; 62 int result2;
63
64 /* Remove any leftovers from a previous partial run. */
65 system ("rm -rf " BASE "*");
66
63 result1 = test_rmdir_func (rmdirat, false); 67 result1 = test_rmdir_func (rmdirat, false);
64 result2 = test_unlink_func (unlinker, false); 68 result2 = test_unlink_func (unlinker, false);
65 ASSERT (result1 == result2); 69 ASSERT (result1 == result2);
66 dfd = open (".", O_RDONLY); 70 dfd = open (".", O_RDONLY);
67 ASSERT (0 <= dfd); 71 ASSERT (0 <= dfd);