summaryrefslogtreecommitdiff
path: root/test/fops
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-04-08 10:19:33 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-04-08 14:22:10 -0400
commit7d0e5fe3dfa39f7ff377a1d4660bc2bc36dc0df8 (patch)
treeef6b30b3bb354aba7fcd52d5e99156def9eb8f1e /test/fops
parent9665c0dc4d512f0e2748229d01cf0700dcc4898f (diff)
downloadmongo-7d0e5fe3dfa39f7ff377a1d4660bc2bc36dc0df8.tar.gz
Enable test/fops for Windows, and add to CI
- Added Windows shim for gettimeofday
Diffstat (limited to 'test/fops')
-rw-r--r--test/fops/t.c19
-rw-r--r--test/fops/thread.h10
2 files changed, 26 insertions, 3 deletions
diff --git a/test/fops/t.c b/test/fops/t.c
index 1522b5941f7..be98310be38 100644
--- a/test/fops/t.c
+++ b/test/fops/t.c
@@ -113,7 +113,7 @@ main(int argc, char *argv[])
return (usage());
/* Use line buffering on stdout so status updates aren't buffered. */
- (void)setvbuf(stdout, NULL, _IOLBF, 0);
+ (void)setvbuf(stdout, NULL, _IOLBF, 32);
/* Clean up on signal. */
(void)signal(SIGINT, onint);
@@ -156,7 +156,14 @@ wt_startup(char *config_open)
int ret;
char config_buf[128];
- if ((ret = system("rm -rf WT_TEST && mkdir WT_TEST")) != 0)
+#undef CMD
+#ifdef _WIN32
+#define CMD "rd /s /q WT_TEST & mkdir WT_TEST"
+#else
+#define CMD "rm -rf WT_TEST && mkdir WT_TEST"
+#endif
+
+ if ((ret = system(CMD)) != 0)
die(ret, "directory cleanup call failed");
snprintf(config_buf, sizeof(config_buf),
@@ -192,7 +199,13 @@ shutdown(void)
{
int ret;
- if ((ret = system("rm -rf WT_TEST")) != 0)
+#undef CMD
+#ifdef _WIN32
+#define CMD "if exist WT_TEST rd /s /q WT_TEST"
+#else
+#define CMD "rm -rf WT_TEST"
+#endif
+ if ((ret = system(CMD)) != 0)
die(ret, "directory cleanup call failed");
}
diff --git a/test/fops/thread.h b/test/fops/thread.h
index 3b49a45d9bb..72333f5f710 100644
--- a/test/fops/thread.h
+++ b/test/fops/thread.h
@@ -27,16 +27,26 @@
*/
#include <sys/types.h>
+#ifndef _WIN32
#include <sys/time.h>
+#endif
#include <errno.h>
#include <inttypes.h>
+#ifndef _WIN32
#include <pthread.h>
+#endif
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifndef _WIN32
#include <unistd.h>
+#endif
+
+#ifdef _WIN32
+#include "windows_shim.h"
+#endif
#include <wiredtiger.h>