summaryrefslogtreecommitdiff
path: root/cpp/src/tests/cluster.mk
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/tests/cluster.mk')
-rw-r--r--cpp/src/tests/cluster.mk38
1 files changed, 25 insertions, 13 deletions
diff --git a/cpp/src/tests/cluster.mk b/cpp/src/tests/cluster.mk
index 489eec748e..fd8f789363 100644
--- a/cpp/src/tests/cluster.mk
+++ b/cpp/src/tests/cluster.mk
@@ -1,23 +1,35 @@
-#-*-Makefile-*-
+if CLUSTER
# Cluster tests makefile fragment, to be included in Makefile.am
#
lib_cluster = $(abs_builddir)/../libqpidcluster.la
-#
-# AIS_UNIT_TESTS must be called with gid=ais. They are run
-# separately under sudo -u ais.
-#
-AIS_UNIT_TESTS=
-AIS_UNIT_TESTS+=Cpg
-Cpg_SOURCES=unit/Cpg.cpp
-Cpg_LDADD=-lboost_unit_test_framework $(lib_cluster)
-
-RUN_AIS_TESTS=ais_unit_tests # Run ais unit tests via check-ais.
+# NOTE: Programs using the openais library must be run with gid=ais
+# Such programs are built as *.ais, with a wrapper script *.sh that
+# runs the program under sudo -u ais.
+#
+# Rule to generate wrappers.
# The chmod is a horrible hack to allow libtools annoying wrapers to
# relink the executable when run as user ais.
-check-ais: $(AIS_UNIT_TESTS)
+.ais.sh:
+ echo sudo -u ais env VALGRIND=$(VALGRIND) srcdir=$(srcdir) $(srcdir)/run_test ./$< >$@; chmod a+x $@
chmod a+rwx . .libs
- sudo -u ais $(MAKE) check TESTS=$(AIS_UNIT_TESTS)
+# Cluster tests.
+#
+check_PROGRAMS+=Cpg.ais
+Cpg_ais_SOURCES=Cpg.cpp
+Cpg_ais_LDADD=$(lib_cluster) -lboost_unit_test_framework
+unit_wrappers+=Cpg.sh
+
+check_PROGRAMS+=Cluster.ais
+Cluster_ais_SOURCES=Cluster.cpp Cluster.h
+Cluster_ais_LDADD=$(lib_cluster) -lboost_unit_test_framework
+unit_wrappers+=Cluster.sh
+
+check_PROGRAMS+=Cluster_child
+Cluster_child_SOURCES=Cluster_child.cpp Cluster.h
+Cluster_child_LDADD=$(lib_cluster) -lboost_test_exec_monitor
+
+endif