michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: IPDLTESTSRCS = $(filter Test%,$(CPPSRCS)) michael@0: IPDLTESTS = $(IPDLTESTSRCS:.cpp=) michael@0: michael@0: EXTRA_PROTOCOLS = \ michael@0: TestBridgeSub \ michael@0: $(NULL) michael@0: michael@0: IPDLTESTHDRS = $(addprefix $(srcdir)/,$(addsuffix .h,$(IPDLTESTS))) michael@0: michael@0: TESTER_TEMPLATE := $(srcdir)/IPDLUnitTests.template.cpp michael@0: GENTESTER := $(srcdir)/genIPDLUnitTests.py michael@0: michael@0: include $(topsrcdir)/config/rules.mk michael@0: michael@0: michael@0: IPDLUNITTEST_BIN = $(DEPTH)/dist/bin/ipdlunittest$(BIN_SUFFIX) michael@0: michael@0: IPDLUnitTests.cpp : Makefile.in $(GENTESTER) $(TESTER_TEMPLATE) $(IPDLTESTHDRS) michael@0: $(PYTHON) $(GENTESTER) $(TESTER_TEMPLATE) -t $(IPDLTESTS) -e $(EXTRA_PROTOCOLS) > $@ michael@0: michael@0: check-proc:: michael@0: @$(EXIT_ON_ERROR) \ michael@0: for test in $(IPDLTESTS); do \ michael@0: $(RUN_TEST_PROGRAM) $(IPDLUNITTEST_BIN) $$test ; \ michael@0: done michael@0: michael@0: check-thread:: michael@0: @$(EXIT_ON_ERROR) \ michael@0: for test in $(IPDLTESTS); do \ michael@0: $(RUN_TEST_PROGRAM) $(IPDLUNITTEST_BIN) thread:$$test ; \ michael@0: done michael@0: michael@0: check:: check-proc check-thread michael@0: michael@0: check-valgrind:: michael@0: @$(EXIT_ON_ERROR) \ michael@0: for test in $(IPDLTESTS); do \ michael@0: $(RUN_TEST_PROGRAM) -g -d \ michael@0: valgrind -a '--leak-check=full --trace-children=yes -q' \ michael@0: $(IPDLUNITTEST_BIN) $$test ; \ michael@0: done