diff options
author | Alex Gorrod <alexander.gorrod@mongodb.com> | 2016-05-23 13:13:54 -0400 |
---|---|---|
committer | sueloverso <sue@mongodb.com> | 2016-05-23 13:13:54 -0400 |
commit | 9768c2db0baa654ed2953bf7a308bd7f7e2de7d6 (patch) | |
tree | a64ee76bef7d02acd5f6812fbfa15d9afc22bf24 /test/recovery | |
parent | 0f7ae730d9ab28aaa51a938075502f639947d26f (diff) | |
download | mongo-9768c2db0baa654ed2953bf7a308bd7f7e2de7d6.tar.gz |
WT-2554 Add initial C test framework. (#2655)
* WT-2554 Add initial C test framework.
With a few sample applications. Need to do further work to cleanup
the same applications and share as much code/style as possible.
* WT-2554 Fixup build errors.
* Fix compiler warning.
* Cleanup
* Ensure each test runs in a different directory.
* Update C test suite names and add copyright.
* Move test code into subdirectories.
* Replace test_util.i with a real utility library now that we have one.
Nothing needs to be an inline function.
Mostly cherry picked from 7c18420.
* Use WiredTiger getopt in C test suite for platform portability.
* Add a header comment to each test case.
* Add a C test suite entry auto generator
* Style, KNF
* Implement review feedback.
* Build test/utility library on Windows
* Add comment to script. Fix a printf.
Diffstat (limited to 'test/recovery')
-rw-r--r-- | test/recovery/Makefile.am | 11 | ||||
-rw-r--r-- | test/recovery/random-abort.c | 13 | ||||
-rw-r--r-- | test/recovery/truncated-log.c | 16 |
3 files changed, 13 insertions, 27 deletions
diff --git a/test/recovery/Makefile.am b/test/recovery/Makefile.am index 6865d5edf3e..19fc48dce47 100644 --- a/test/recovery/Makefile.am +++ b/test/recovery/Makefile.am @@ -1,13 +1,16 @@ -AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)/src/include \ - -I$(top_srcdir)/test/utility +AM_CPPFLAGS = -I$(top_builddir) +AM_CPPFLAGS +=-I$(top_srcdir)/src/include +AM_CPPFLAGS +=-I$(top_srcdir)/test/utility noinst_PROGRAMS = random-abort truncated-log random_abort_SOURCES = random-abort.c -random_abort_LDADD = $(top_builddir)/libwiredtiger.la +random_abort_LDADD = $(top_builddir)/test/utility/libtest_util.la +random_abort_LDADD +=$(top_builddir)/libwiredtiger.la random_abort_LDFLAGS = -static truncated_log_SOURCES = truncated-log.c -truncated_log_LDADD = $(top_builddir)/libwiredtiger.la +truncated_log_LDADD = $(top_builddir)/test/utility/libtest_util.la +truncated_log_LDADD +=$(top_builddir)/libwiredtiger.la truncated_log_LDFLAGS = -static # Run this during a "make check" smoke test. diff --git a/test/recovery/random-abort.c b/test/recovery/random-abort.c index cd7d1b08708..33597245966 100644 --- a/test/recovery/random-abort.c +++ b/test/recovery/random-abort.c @@ -26,19 +26,10 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#include "test_util.h" + #include <sys/wait.h> -#include <errno.h> #include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#ifndef _WIN32 -#include <unistd.h> -#endif - -#include <wiredtiger.h> - -#include "test_util.i" static char home[512]; /* Program working dir */ static const char *progname; /* Program name */ diff --git a/test/recovery/truncated-log.c b/test/recovery/truncated-log.c index e099873e5b9..3b99ea2c932 100644 --- a/test/recovery/truncated-log.c +++ b/test/recovery/truncated-log.c @@ -26,23 +26,15 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#include "test_util.h" + #include <sys/wait.h> -#include <errno.h> -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#ifndef _WIN32 -#include <unistd.h> -#else + +#ifdef _WIN32 /* snprintf is not supported on <= VS2013 */ #define snprintf _snprintf #endif -#include <wiredtiger.h> - -#include "test_util.i" - static char home[512]; /* Program working dir */ static const char *progname; /* Program name */ static const char * const uri = "table:main"; |