runtests:
make -C python runtests
make -C dotnet runtests
+ make -C cpp runtests
test:
./wvtestrunner.pl $(MAKE) runtests
+
+clean::
+ make -C python clean
+ make -C dotnet clean
+ make -C cpp clean
--- /dev/null
+
+all:
+ @echo "Try: make test"
+ @false
+
+t/wvtest: wvtestmain.cc wvtest.cc t/wvtest.t.cc
+ g++ -D WVTEST_CONFIGURED -o $@ -I. $^
+
+runtests: t/wvtest
+ t/wvtest
+
+test:
+ ../wvtestrunner.pl $(MAKE) runtests
+
+clean::
+ rm -f *~ *.o t/*.o t/wvtest
--- /dev/null
+#include "wvtest.h"
+
+WVTEST_MAIN("wvtest tests")
+{
+ WVPASS(1);
+ WVPASSEQ(1, 1);
+ WVPASSNE(1, 2);
+ WVPASSEQ(1, 1);
+ WVPASSLT(1, 2);
+}
* Part of an automated testing framework. See wvtest.h.
*/
#include "wvtest.h"
-#include "wvautoconf.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#ifndef __WVTEST_H
#define __WVTEST_H
+#ifndef WVTEST_CONFIGURED
+# error "Missing settings: HAVE_VALGRIND_MEMCHECK_H HAVE_WVCRASH WVTEST_CONFIGURED"
+#endif
+
#include <time.h>
class WvTest
WvTest::start_check(__FILE__, __LINE__, "NOT(" #cond ")", !(cond))
#define WVFAILEQ(a, b) \
WvTest::start_check_eq(__FILE__, __LINE__, (a), (b), false)
+#define WVPASSNE(a, b) WVFAILEQ(a, b)
+#define WVFAILNE(a, b) WVPASSEQ(a, b)
#define WVTEST_MAIN3(descr, ff, ll, slowness) \
static void _wvtest_main_##ll(); \
#include "wvtest.h"
-#include "wvcrash.h"
-#include "wvstring.h"
+#ifdef HAVE_WVCRASH
+# include "wvcrash.h"
+#endif
#include <stdlib.h>
#include <stdio.h>
#ifdef _WIN32
int main(int argc, char **argv)
{
-#ifdef _WIN32
+ char buf[200];
+#if defined(_WIN32) && defined(HAVE_WVCRASH)
setup_console_crash();
#endif
WVPASS(startfd == endfd);
#ifndef _WIN32
if (startfd != endfd)
- system(WvString("ls -l /proc/%s/fd", getpid()));
+ {
+ sprintf(buf, "ls -l /proc/%d/fd", getpid());
+ system(buf);
+ }
#endif
}
test:
../wvtestrunner.pl $(MAKE) runtests
+
+clean::
+ rm -f *~ t/*~ *.pyc t/*.pyc
\ No newline at end of file