diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-06-15 10:07:54 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-06-15 10:07:54 +0000 |
commit | a042595dbebba7626b74c036af203bda0bd4a4ea (patch) | |
tree | 0fd1c5eea3727fdd04b961be2cdaf025898fb84c /usr.bin/tar | |
parent | 6d3ab1837b01faf41c5d73c87ab383b12bd6e08b (diff) | |
download | FreeBSD-src-a042595dbebba7626b74c036af203bda0bd4a4ea.zip FreeBSD-src-a042595dbebba7626b74c036af203bda0bd4a4ea.tar.gz |
MfP4: test harness cleanup.
Diffstat (limited to 'usr.bin/tar')
-rw-r--r-- | usr.bin/tar/test/main.c | 9 | ||||
-rw-r--r-- | usr.bin/tar/test/test.h | 31 |
2 files changed, 21 insertions, 19 deletions
diff --git a/usr.bin/tar/test/main.c b/usr.bin/tar/test/main.c index 3856f3a..3f4384f 100644 --- a/usr.bin/tar/test/main.c +++ b/usr.bin/tar/test/main.c @@ -27,13 +27,13 @@ * Various utility routines useful for test programs. * Each test program is linked against this file. */ +#include "test.h" + #include <errno.h> #include <locale.h> #include <stdarg.h> #include <time.h> -#include "test.h" - /* * This same file is used pretty much verbatim for all test harnesses. * @@ -712,8 +712,11 @@ static int test_run(int i, const char *tmpdir) { int failures_before = failures; - if (!quiet_flag) + if (!quiet_flag) { printf("%d: %s\n", i, tests[i].name); + fflush(stdout); + } + /* * Always explicitly chdir() in case the last test moved us to * a strange place. diff --git a/usr.bin/tar/test/test.h b/usr.bin/tar/test/test.h index 416f0dd..39a9837 100644 --- a/usr.bin/tar/test/test.h +++ b/usr.bin/tar/test/test.h @@ -31,8 +31,18 @@ * The goal of this file (and the matching test.c) is to * simplify the very repetitive test-*.c test programs. */ -#ifndef _FILE_OFFSET_BITS -#define _FILE_OFFSET_BITS 64 +#if defined(HAVE_CONFIG_H) +/* Most POSIX platforms use the 'configure' script to build config.h */ +#include "../../config.h" +#elif defined(__FreeBSD__) +/* Building as part of FreeBSD system requires a pre-built config.h. */ +#include "../config_freebsd.h" +#elif defined(_WIN32) +/* Win32 can't run the 'configure' script. */ +#include "../config_windows.h" +#else +/* Warn if the library hasn't been (automatically or manually) configured. */ +#error Oops: No config.h and no pre-built configuration in test.h. #endif #include <dirent.h> @@ -51,20 +61,6 @@ #include <dmalloc.h> #endif -#if defined(HAVE_CONFIG_H) -/* Most POSIX platforms use the 'configure' script to build config.h */ -#include "../../config.h" -#elif defined(__FreeBSD__) -/* Building as part of FreeBSD system requires a pre-built config.h. */ -#include "../config_freebsd.h" -#elif defined(_WIN32) -/* Win32 can't run the 'configure' script. */ -#include "../config_windows.h" -#else -/* Warn if the library hasn't been (automatically or manually) configured. */ -#error Oops: No config.h and no pre-built configuration in test.h. -#endif - /* No non-FreeBSD platform will have __FBSDID, so just define it here. */ #ifdef __FreeBSD__ #include <sys/cdefs.h> /* For __FBSDID */ @@ -108,6 +104,9 @@ /* Assert that a file exists; supports printf-style arguments. */ #define assertFileNotExists \ test_setup(__FILE__, __LINE__);test_assert_file_not_exists +/* Assert that file contents match a string; supports printf-style arguments. */ +#define assertFileContents \ + test_setup(__FILE__, __LINE__);test_assert_file_contents /* * This would be simple with C99 variadic macros, but I don't want to |