1 ## Process this file with automake to produce Makefile.in.
3 # Copyright 2007 Johannes Lehtinen
4 # This Makefile is free software; Johannes Lehtinen gives unlimited
5 # permission to copy, distribute and modify it.
7 # This can be defined to a debugging wrapper program such as Valgrind.
10 # This can be defined to a subset of test cases to be performed
13 DIST_SUBDIRS = plugins-source
15 EXTRA_DIST = tests.txt
18 CPPFLAGS += -DCP_HOST="\"$(host)\""
20 LIBS = @LIBS_OTHER@ @LIBS@
22 check_PROGRAMS = testsuite
24 testsuite_SOURCES = psymbolusage.c extcfg.c pdependencies.c pcallbacks.c pscanning.c pinstallation.c ploading.c loggers.c collections.c initdestroy.c fatalerror.c cpinfo.c testmain.c test.h
25 testsuite_LDFLAGS = -dlopen self
27 tmpinstalldir = $(CURDIR)/tmp/install
29 check-local: install-plugins
33 if test -x "$(srcdir)/test-$$test"; then \
34 srcdir='$(srcdir)' TEST_WRAPPER='$(TEST_WRAPPER)' "$(srcdir)/test-$$test"; \
37 eval srcdir='$(srcdir)' libtool --mode=execute $(TEST_WRAPPER) ./testsuite "\$$test"; \
42 echo "SKIPPED: $$test"; \
46 numt=$$(($$numt + 1)); \
49 echo "FAIL: $$test"; \
50 numt=$$(($$numt + 1)); \
51 numf=$$(($$numf + 1)); \
56 echo '===================================================================='; \
57 echo 'C-Pluff Test Suite'; \
58 echo '===================================================================='; \
59 if test '$(SELECTED_TESTS)' = all; then \
62 done < '$(srcdir)/tests.txt'; \
64 for test in $(SELECTED_TESTS); do \
68 echo '===================================================================='; \
69 if test $$numf -gt 0; then \
70 echo "FAILED: $$numf/$$numt"; \
74 echo '===================================================================='; \
80 test ! -f plugins-source/Makefile || (cd plugins-source && $(MAKE) $(AM_MAKEFLAGS) clean)
83 $(MKDIR_P) '$(distdir)'
84 cp -p '$(srcdir)'/test-* '$(distdir)'
85 $(MKDIR_P) '$(distdir)/expected'
86 cp -p '$(srcdir)'/expected/*.txt '$(distdir)'/expected
87 $(MKDIR_P) '$(distdir)'/plugins
88 cd '$(srcdir)'/plugins && \
90 ( mkdir '$(distdir)'/plugins/"$$d" && \
91 cp -p "$$d/plugin.xml" '$(distdir)'/plugins/"$$d" ) \
94 $(MKDIR_P) '$(distdir)'/pcollections
95 cd '$(srcdir)'/pcollections && \
97 ( $(MKDIR_P) '$(distdir)'/pcollections/"$$d" && \
98 cp -p "$$d/plugin.xml" '$(distdir)'/pcollections/"$$d" ) \
102 install-plugins: build-plugins install-libcpluff
103 cd plugins-source && $(MAKE) $(AM_MAKEFLAGS) DESTDIR='$(tmpinstalldir)' install
106 cd plugins-source && $(MAKE)
109 cd ../libcpluff && $(MAKE) $(AM_MAKEFLAGS) DESTDIR='$(tmpinstalldir)' install
111 .PHONY: build-plugins install-plugins install-libcpluff