99ea5e446f
from Piotr Sikora (MAINTAINER)
100 lines
3.5 KiB
Plaintext
100 lines
3.5 KiB
Plaintext
--- Makefile.orig Fri Sep 9 13:50:55 2011
|
|
+++ Makefile Thu Sep 15 08:51:57 2011
|
|
@@ -22,21 +22,10 @@ USAGES_XML=$(DOCS_DIR)/rabbitmqctl.1.xml
|
|
USAGES_ERL=$(foreach XML, $(USAGES_XML), $(call usage_xml_to_erl, $(XML)))
|
|
QC_MODULES := rabbit_backing_queue_qc
|
|
QC_TRIALS ?= 100
|
|
+TARGET_DIR=$(PREFIX)/lib/rabbitmq
|
|
+SBIN_DIR=$(PREFIX)/sbin
|
|
+MAN_DIR=$(PREFIX)/man
|
|
|
|
-ifeq ($(shell python -c 'import simplejson' 2>/dev/null && echo yes),yes)
|
|
-PYTHON=python
|
|
-else
|
|
-ifeq ($(shell python2.6 -c 'import simplejson' 2>/dev/null && echo yes),yes)
|
|
-PYTHON=python2.6
|
|
-else
|
|
-ifeq ($(shell python2.5 -c 'import simplejson' 2>/dev/null && echo yes),yes)
|
|
-PYTHON=python2.5
|
|
-else
|
|
-# Hmm. Missing simplejson?
|
|
-PYTHON=python
|
|
-endif
|
|
-endif
|
|
-endif
|
|
|
|
BASIC_PLT=basic.plt
|
|
RABBIT_PLT=rabbit.plt
|
|
@@ -69,6 +58,10 @@ ERL_CALL=erl_call -sname $(RABBITMQ_NODENAME) -e
|
|
|
|
ERL_EBIN=erl -noinput -pa $(EBIN_DIR)
|
|
|
|
+CHECK_NAME=rabbitmq-check
|
|
+CHECK_DIR=/tmp/$(CHECK_NAME)
|
|
+CHECK_CALL=HOME=$(CHECK_DIR) erl_call -sname $(CHECK_NAME) -e
|
|
+
|
|
define usage_xml_to_erl
|
|
$(subst __,_,$(patsubst $(DOCS_DIR)/rabbitmq%.1.xml, $(SOURCE_DIR)/rabbit_%_usage.erl, $(subst -,_,$(1))))
|
|
endef
|
|
@@ -83,7 +76,7 @@ endef
|
|
|
|
ifneq "$(SBIN_DIR)" ""
|
|
ifneq "$(TARGET_DIR)" ""
|
|
-SCRIPTS_REL_PATH=$(shell ./calculate-relative $(TARGET_DIR)/sbin $(SBIN_DIR))
|
|
+SCRIPTS_REL_PATH="../lib/rabbitmq/sbin"
|
|
endif
|
|
endif
|
|
|
|
@@ -144,7 +137,7 @@ clean:
|
|
rm -f $(EBIN_DIR)/*.beam
|
|
rm -f $(EBIN_DIR)/rabbit.app $(EBIN_DIR)/rabbit.boot $(EBIN_DIR)/rabbit.script $(EBIN_DIR)/rabbit.rel
|
|
rm -f $(INCLUDE_DIR)/rabbit_framing.hrl $(SOURCE_DIR)/rabbit_framing_amqp_*.erl codegen.pyc
|
|
- rm -f $(DOCS_DIR)/*.[0-9].gz $(DOCS_DIR)/*.man.xml $(DOCS_DIR)/*.erl $(USAGES_ERL)
|
|
+ rm -f $(DOCS_DIR)/*.[0-9] $(DOCS_DIR)/*.man.xml $(DOCS_DIR)/*.erl $(USAGES_ERL)
|
|
rm -f $(RABBIT_PLT)
|
|
rm -f $(DEPS_FILE)
|
|
|
|
@@ -180,6 +173,23 @@ run-tests: all
|
|
run-qc: all
|
|
$(foreach MOD,$(QC_MODULES),./quickcheck $(RABBITMQ_NODENAME) $(MOD) $(QC_TRIALS))
|
|
|
|
+regress:
|
|
+ @[ "`id -u`" != "0" ] || (echo "Don't run tests as a superuser." && false)
|
|
+ rm -rf $(CHECK_DIR)
|
|
+ mkdir -m 777 -p $(CHECK_DIR)
|
|
+ HOME=$(CHECK_DIR) \
|
|
+ RABBITMQ_NODENAME="$(CHECK_NAME)" \
|
|
+ RABBITMQ_NODE_PORT="45672" \
|
|
+ RABBITMQ_LOG_BASE="$(CHECK_DIR)/logs" \
|
|
+ RABBITMQ_MNESIA_BASE="$(CHECK_DIR)/mnesia" \
|
|
+ RABBITMQ_SERVER_START_ARGS="$(RABBITMQ_SERVER_START_ARGS) -detached" \
|
|
+ ./scripts/rabbitmq-server
|
|
+ @sleep 5
|
|
+ OUT=$$(echo "rabbit_tests:all_tests()." | $(CHECK_CALL)) ; \
|
|
+ echo $$OUT ; echo $$OUT | grep '^{ok, passed}$$' > /dev/null || \
|
|
+ ($(CHECK_CALL) -q && rm -rf $(CHECK_DIR) && false)
|
|
+ $(CHECK_CALL) -q && rm -rf $(CHECK_DIR) && echo "Passed."
|
|
+
|
|
start-background-node:
|
|
$(BASIC_SCRIPT_ENVIRONMENT_SETTINGS) \
|
|
RABBITMQ_NODE_ONLY=true \
|
|
@@ -250,8 +260,7 @@ distclean: clean
|
|
%.gz: %.xml $(DOCS_DIR)/examples-to-end.xsl
|
|
xmlto --version | grep -E '^xmlto version 0\.0\.([0-9]|1[1-8])$$' >/dev/null || opt='--stringparam man.indent.verbatims=0' ; \
|
|
xsltproc --novalid $(DOCS_DIR)/examples-to-end.xsl $< > $<.tmp && \
|
|
- xmlto -o $(DOCS_DIR) $$opt man $<.tmp && \
|
|
- gzip -f $(DOCS_DIR)/`basename $< .xml`
|
|
+ xmlto -o $(DOCS_DIR) $$opt man $<.tmp
|
|
rm -f $<.tmp
|
|
|
|
# Use tmp files rather than a pipeline so that we get meaningful errors
|
|
@@ -294,7 +303,7 @@ install_bin: all install_dirs
|
|
install_docs: docs_all install_dirs
|
|
for section in 1 5; do \
|
|
mkdir -p $(MAN_DIR)/man$$section; \
|
|
- for manpage in $(DOCS_DIR)/*.$$section.gz; do \
|
|
+ for manpage in $(DOCS_DIR)/*.$$section; do \
|
|
cp $$manpage $(MAN_DIR)/man$$section; \
|
|
done; \
|
|
done
|