summaryrefslogtreecommitdiff
path: root/tests/utils
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2012-08-10 14:44:17 +0200
committerAndreas Baumann <abaumann@yahoo.com>2012-08-10 14:44:17 +0200
commit4a6b24a567142317a24a98d2ab998f5093a581cc (patch)
tree522107a269c040e69b933fc9f69fe330703562b5 /tests/utils
parent9fe78b708868dcb5bdbfc88ed96dee18c6f1f6b3 (diff)
downloadcrawler-4a6b24a567142317a24a98d2ab998f5093a581cc.tar.gz
crawler-4a6b24a567142317a24a98d2ab998f5093a581cc.tar.bz2
first porting attempts to Windows:
nmake support from Wolframe module loader adapted tests for typeinfo and template trickery
Diffstat (limited to 'tests/utils')
-rwxr-xr-x[-rw-r--r--]tests/utils/GNUmakefile2
-rwxr-xr-xtests/utils/Makefile.W3238
-rwxr-xr-xtests/utils/exec_test17
-rwxr-xr-xtests/utils/exec_test.cmd15
4 files changed, 56 insertions, 16 deletions
diff --git a/tests/utils/GNUmakefile b/tests/utils/GNUmakefile
index ce6df00..8fec5ce 100644..100755
--- a/tests/utils/GNUmakefile
+++ b/tests/utils/GNUmakefile
@@ -3,7 +3,7 @@ TOPDIR = ../..
SUBDIRS =
INCLUDE_DIRS = \
- -I$(TOPDIR)/src
+ -I. -I$(TOPDIR)/src
INCLUDE_LDFLAGS =
diff --git a/tests/utils/Makefile.W32 b/tests/utils/Makefile.W32
new file mode 100755
index 0000000..c2d74e7
--- /dev/null
+++ b/tests/utils/Makefile.W32
@@ -0,0 +1,38 @@
+TOPDIR = ..\..
+
+SUBDIRS =
+
+!INCLUDE $(TOPDIR)\makefiles\nmake\platform.mk
+
+INCLUDE_CXXFLAGS = \
+ /D_WIN32_WINNT=0x504
+
+INCLUDE_DIRS = \
+ /I. \
+ /I$(TOPDIR)\src
+
+INCLUDE_LDFLAGS = \
+
+INCLUDE_LIBS = \
+
+TEST_CPP_BINS = \
+ test1.exe \
+ test2.exe
+
+OBJS =
+
+!INCLUDE $(TOPDIR)\makefiles\nmake\sub.mk
+
+test1.exe: test1.obj
+test2.exe: test2.obj
+
+local_all:
+
+local_clean:
+ @-erase -f *.RES *.DIFF *.ERR 2>NUL
+
+local_distclean:
+
+local_test:
+ @-exec_test test1 "TypeList and TypeTraits"
+ @-exec_test test2 "TypeInfo C++ demangle"
diff --git a/tests/utils/exec_test b/tests/utils/exec_test
index b49999b..d2d606f 100755
--- a/tests/utils/exec_test
+++ b/tests/utils/exec_test
@@ -2,20 +2,7 @@
BINARY=$1
TITLE=$2
-PLATFORM=$3
-LINUX_DIST=$4
-LINUX_REV=$5
-
-if test "x${PLATFORM}" = "xLINUX"; then
-SPECIAL="${PLATFORM}_${LINUX_DIST}_${LINUX_REV}"
-else
-SPECIAL="${PLATFORM}"
-fi
printf "$BINARY: $TITLE .. "
-./$BINARY | sed 's/\(time: .* ms\)//g' >$BINARY.RES 2>&1
-if test -f $BINARY.MUST.$SPECIAL; then
- diff $BINARY.MUST.$SPECIAL $BINARY.RES > $BINARY.DIFF && printf "OK\n" || printf "ERROR\n"
-else
- diff $BINARY.MUST $BINARY.RES > $BINARY.DIFF && printf "OK\n" || printf "ERROR\n"
-fi
+./$BINARY >$BINARY.RES 2>&1
+diff $BINARY.MUST $BINARY.RES > $BINARY.DIFF && printf "OK\n" || printf "ERROR\n"
diff --git a/tests/utils/exec_test.cmd b/tests/utils/exec_test.cmd
new file mode 100755
index 0000000..81a6222
--- /dev/null
+++ b/tests/utils/exec_test.cmd
@@ -0,0 +1,15 @@
+@echo off
+
+set BINARY=%1
+set TITLE=%2
+
+%BINARY% >%BINARY%.OUT 2>%BINARY%.ERR
+..\..\utils\win32\dos2unix <%BINARY%.OUT >%BINARY%.RES
+erase /q %BINARY%.OUT
+echo n | comp %BINARY%.MUST %BINARY%.RES > %BINARY%.DIFF 2>NUL
+if ERRORLEVEL 1 GOTO FAIL
+echo %BINARY%: %TITLE%.. OK
+goto END
+:FAIL
+echo %BINARY%: %TITLE% .. ERROR
+:END