summaryrefslogtreecommitdiff
path: root/cppe/test
diff options
context:
space:
mode:
Diffstat (limited to 'cppe/test')
-rw-r--r--cppe/test/Makefile22
-rw-r--r--cppe/test/include/TestCommon.h26
2 files changed, 48 insertions, 0 deletions
diff --git a/cppe/test/Makefile b/cppe/test/Makefile
new file mode 100644
index 00000000000..6e41f659626
--- /dev/null
+++ b/cppe/test/Makefile
@@ -0,0 +1,22 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ..
+
+include $(top_srcdir)/config/Make.rules
+
+SUBDIRS = IceUtil \
+ Ice
+
+$(EVERYTHING)::
+ @for subdir in $(SUBDIRS); \
+ do \
+ echo "making $@ in $$subdir"; \
+ ( cd $$subdir && $(MAKE) $@ ) || exit 1; \
+ done
diff --git a/cppe/test/include/TestCommon.h b/cppe/test/include/TestCommon.h
new file mode 100644
index 00000000000..9786b1dc121
--- /dev/null
+++ b/cppe/test/include/TestCommon.h
@@ -0,0 +1,26 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef TEST_COMMON_H
+#define TEST_COMMON_H
+
+#include <IceUtil/Config.h>
+#include <cstdlib>
+
+void
+inline testFailed(const char* expr, const char* file, unsigned int line)
+{
+ std::cout << "failed!" << std::endl;
+ std::cout << file << ':' << line << ": assertion `" << expr << "' failed" << std::endl;
+ abort();
+}
+
+#define test(ex) ((ex) ? ((void)0) : testFailed(#ex, __FILE__, __LINE__))
+
+#endif