summaryrefslogtreecommitdiff
path: root/tests/Makefile
diff options
context:
space:
mode:
authorrpj <rpj>1999-02-21 18:07:25 +0000
committerrpj <rpj>1999-02-21 18:07:25 +0000
commit943bc9bb02212649a83ec32152299d50d34226e6 (patch)
tree55d0329607b7d2fa1044884be957518cc7a52c6e /tests/Makefile
parent1acd28b4aec86a907846e1715bc95208d6e277e6 (diff)
1999-02-23 Ross Johnson <rpj@ise.canberra.edu.au>
* Makefile: Now actually runs the tests. * tests.h: Define our own assert macro. The Mingw32 version pops up a dialog but we want to run non-interactively. * equal1.c: use assert a little more directly so that it prints the actual call statement. * exit1.c: Modify to return 0 on success, 1 on failure.
Diffstat (limited to 'tests/Makefile')
-rw-r--r--tests/Makefile51
1 files changed, 46 insertions, 5 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 82c1d44..56968e5 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,14 +1,55 @@
# Makefile for the pthreads test suite.
# If all of the .pass files can be created, the test suite has passed.
+
+CP = copy
+RM = erase
+TOUCH = echo Passed >
+
+#
+# Mingw32
+#
+CC = gcc
+CFLAGS = -g -O2 -UNDEBUG -Wall -o $@ $^
+BUILD_DIR = ../build
+RELEASE_DIR = ../release
+INCLUDES = -I$(BUILD_DIR)/include
+LIBS = $(BUILD_DIR)/lib/libpthread32.a
+
+##
+## MSVC
+##
+#CC = cl
+#CFLAGS = /W3 /MT /nologo /Yd /Zi /Fe$@ $^
+#BUILD_DIR = ..\build
+#RELEASE_DIR = ..\release
+#INCLUDES = -I$(BUILD_DIR)\include
+#LIBS = $(BUILD_DIR)\lib\pthread.lib
+
+DLL = pthread.dll
+
# If a test case returns a non-zero exit code to the shell, make will
# stop.
-PASSES = count1.pass create1.pass equal1.pass exit1.pass exit2.pass \
- exit3.pass eyal1.pass mutex1.pass mutex2.pass mutex3.pass \
- once1.pass self1.pass self2.pass self3.pass tsd1.pass
+TESTS = count1 create1 equal1 exit1 exit2 \
+ exit3 eyal1 mutex1 mutex2 mutex3 \
+ once1 self1 self2 self3 tsd1
+
+PASSES = $(TESTS:%=%.pass)
all: $(PASSES)
-%.pass: %.exe
- touch $@
+%.pass: %.exe $(DLL)
+ $*
+ $(TOUCH) $@
+
+%.exe: %.c
+ $(CC) $(CFLAGS) $(INCLUDES) $(LIBS)
+
+$(DLL):
+ $(CP) ..\build\bin\$@ .
+
+clean:
+ - $(RM) *.exe
+ - $(RM) *.pass
+