aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-05-16 10:08:24 -0400
committerNick Mathewson <nickm@torproject.org>2012-05-16 10:08:24 -0400
commitd9ceab5bc3611fa6ed4e2f58d38ff26860eeeb3c (patch)
treeaaa30f6162272c0eb1c940df4579f57400ecf7aa
parentd5ccaa6e2b8c73a1d9d43b82c782c7b10557fe5c (diff)
downloadtor-d9ceab5bc3611fa6ed4e2f58d38ff26860eeeb3c.tar
tor-d9ceab5bc3611fa6ed4e2f58d38ff26860eeeb3c.tar.gz
Fix some remaining nmake/msvc build issues
-rw-r--r--src/test/Makefile.nmake20
-rw-r--r--src/test/test.c3
-rw-r--r--src/test/test_util.c3
-rw-r--r--src/tools/Makefile.nmake19
4 files changed, 45 insertions, 0 deletions
diff --git a/src/test/Makefile.nmake b/src/test/Makefile.nmake
new file mode 100644
index 000000000..aec477cf9
--- /dev/null
+++ b/src/test/Makefile.nmake
@@ -0,0 +1,20 @@
+all: test.exe
+
+CFLAGS = /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or
+
+LIBS = ..\..\..\build-alpha\lib\libevent.lib \
+ ..\..\..\build-alpha\lib\libcrypto.lib \
+ ..\..\..\build-alpha\lib\libssl.lib \
+ ..\..\..\build-alpha\lib\libz.lib \
+ ..\or\libtor.lib \
+ ws2_32.lib advapi32.lib shell32.lib
+
+TEST_OBJECTS = test.obj test_addr.obj test_containers.obj \
+ test_crypto.obj test_data.obj test_dir.obj test_microdesc.obj \
+ test_pt.obj test_util.obj test_config.obj tinytest.obj
+
+test.exe: $(TEST_OBJECTS)
+ $(CC) $(CFLAGS) $(LIBS) ..\common\*.lib $(TEST_OBJECTS)
+
+clean:
+ del $(TEST_OBJECTS) *.lib test.exe
diff --git a/src/test/test.c b/src/test/test.c
index 7f196aacf..c2dba924e 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -71,6 +71,9 @@ int have_failed = 0;
/** Temporary directory (set up by setup_directory) under which we store all
* our files during testing. */
static char temp_dir[256];
+#ifdef _WIN32
+#define pid_t unsigned
+#endif
static pid_t temp_dir_setup_in_pid = 0;
/** Select and create the temporary directory we'll use to run our unit tests.
diff --git a/src/test/test_util.c b/src/test/test_util.c
index b5b40bba9..d9fc6a33c 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -2263,6 +2263,9 @@ test_util_spawn_background_ok(void *ptr)
static void
test_util_spawn_background_fail(void *ptr)
{
+#ifndef BUILDDIR
+#define BUILDDIR "."
+#endif
const char *argv[] = {BUILDDIR "/src/test/no-such-file", "--test", NULL};
const char *expected_err = "";
char expected_out[1024];
diff --git a/src/tools/Makefile.nmake b/src/tools/Makefile.nmake
new file mode 100644
index 000000000..a30a28b2e
--- /dev/null
+++ b/src/tools/Makefile.nmake
@@ -0,0 +1,19 @@
+all: tor-resolve.exe tor-gencert.exe
+
+CFLAGS = /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or
+
+LIBS = ..\..\..\build-alpha\lib\libevent.lib \
+ ..\..\..\build-alpha\lib\libcrypto.lib \
+ ..\..\..\build-alpha\lib\libssl.lib \
+ ..\..\..\build-alpha\lib\libz.lib \
+ ws2_32.lib advapi32.lib shell32.lib
+
+
+tor-gencert.exe: tor-gencert.obj
+ $(CC) $(CFLAGS) $(LIBS) ..\common\*.lib tor-gencert.obj
+
+tor-resolve.exe: tor-resolve.obj
+ $(CC) $(CFLAGS) $(LIBS) ..\common\*.lib tor-resolve.obj
+
+clean:
+ del *.obj *.lib *.exe