fixes to use parallel make when running the examples and test-suite

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9875 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2007-07-24 21:26:54 +00:00
commit e4bade15f3
22 changed files with 187 additions and 154 deletions

View file

@ -1,6 +1,15 @@
Version 1.3.32 (in progress)
============================
07/24/2007: wsfulton
Parallel make support added for the examples and test-suite for developers who have
more than one CPU. Now parallel make can be used for checking in addition to building
the SWIG executable. Some typical checking examples:
make -j8 -k check
make -j4 check-java-test-suite
make -j2 check-java-examples
07/19/2007: mgossage
Fixed bug that stopped configure working on mingw (applied dos2unix to configure.in)

View file

@ -137,18 +137,18 @@ include $(srcdir)/../common.mk
# Rules for the different types of tests
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ) &&\
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
%.ctest:
$(setup) \
($(swig_and_compile_c); ) &&\
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ) &&\
$(setup)
+$(swig_and_compile_multi_cpp)
$(run_testcase)
# Runs the testcase. A testcase is only run if

View file

@ -18,18 +18,18 @@ CPP_TEST_CASES =
# Rules for the different types of tests
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ) &&\
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
%.ctest:
$(setup) \
($(swig_and_compile_c); ) &&\
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ) &&\
$(setup)
+$(swig_and_compile_multi_cpp)
$(run_testcase)
# Runs the testcase. A testcase is only run if

View file

@ -30,32 +30,32 @@ SWIGOPT += -nounit
# Rules for the different types of tests
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ) && \
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then ( \
$(MAKE) $*.cppproxy; ) \
fi;
%.ctest:
$(setup) \
($(swig_and_compile_c); ) && \
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then ( \
+if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then ( \
$(MAKE) $*.cproxy; ) \
fi;
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ) && \
$(setup)
+$(swig_and_compile_multi_cpp)
$(run_testcase)
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then ( \
$(MAKE) $*.multiproxy; ) \
fi;
%.externaltest:
$(setup) \
($(swig_and_compile_external); ) && \
$(setup)
$(swig_and_compile_external)
$(run_testcase)
# Runs the testcase. A testcase is only run if
@ -70,22 +70,22 @@ run_testcase = \
%.cppproxy: SWIGOPT += -proxy
%.cppproxy: SCRIPTSUFFIX = $(PROXYSUFFIX)
%.cppproxy:
echo "Checking testcase $* (with run test) under chicken with -proxy"; \
($(swig_and_compile_cpp); ) && \
echo "Checking testcase $* (with run test) under chicken with -proxy"
$(swig_and_compile_cpp)
$(run_testcase)
%.cproxy: SWIGOPT += -proxy
%.cproxy: SCRIPTSUFFIX = $(PROXYSUFFIX)
%.cproxy:
echo "Checking testcase $* (with run test) under chicken with -proxy"; \
($(swig_and_compile_c); ) && \
echo "Checking testcase $* (with run test) under chicken with -proxy"
+$(swig_and_compile_c)
$(run_testcase)
%.multiproxy: SWIGOPT += -proxy -noclosuses
%.multiproxy: SCRIPTSUFFIX = $(PROXYSUFFIX)
%.multiproxy:
echo "Checking testcase $* (with run test) under chicken with -proxy"; \
($(swig_and_compile_multi_cpp); ) && \
echo "Checking testcase $* (with run test) under chicken with -proxy"
+$(swig_and_compile_multi_cpp)
$(run_testcase)
# Clean

View file

@ -18,18 +18,18 @@ CPP_TEST_CASES =
# Rules for the different types of tests
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ) &&\
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
%.ctest:
$(setup) \
($(swig_and_compile_c); ) &&\
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ) &&\
$(setup)
+$(swig_and_compile_multi_cpp)
$(run_testcase)
# Runs the testcase. A testcase is only run if

View file

@ -30,19 +30,19 @@ SWIGOPT += -namespace $*Namespace $(SWIGOPTSPECIAL)
# Rules for the different types of tests
%.cpptest:
$(setup) \
(cd $* && $(swig_and_compile_cpp); ) && \
$(run_testcase)
$(setup)
+(cd $* && $(swig_and_compile_cpp))
+$(run_testcase)
%.ctest:
$(setup) \
(cd $* && $(swig_and_compile_c); ) && \
$(run_testcase)
$(setup)
+(cd $* && $(swig_and_compile_c))
+$(run_testcase)
%.multicpptest:
$(setup) \
(cd $* && $(swig_and_compile_multi_cpp); ) && \
$(run_testcase)
$(setup)
+(cd $* && $(swig_and_compile_multi_cpp))
+$(run_testcase)
# Rules for custom tests
intermediary_classname.customtest:

View file

@ -20,13 +20,13 @@ include $(srcdir)/../common.mk
# Rules for the different types of tests
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ) && \
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
%.ctest:
$(setup) \
($(swig_and_compile_c); ) && \
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
# override the default in common.mk by adding SWIGOPT +=
@ -43,8 +43,8 @@ swig_and_compile_multi_cpp = \
done
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ) && \
$(setup)
+$(swig_and_compile_multi_cpp)
$(run_testcase)
# Runs the testcase. A testcase is only run if

View file

@ -37,8 +37,8 @@ swig_and_compile_multi_cpp = \
done
%.externaltest:
$(local_setup) \
($(swig_and_compile_external); ) && \
$(local_setup)
$(swig_and_compile_external)
$(local_run_testcase)
# Same as setup and run_testcase, but without the SCRIPTPREFIX (so the runme comes from the guilescm directory)

View file

@ -37,18 +37,18 @@ SWIGOPT += -package $*
# Rules for the different types of tests
%.cpptest:
$(setup) \
(cd $*; $(swig_and_compile_cpp); ) && \
$(setup)
+(cd $* && $(swig_and_compile_cpp))
$(run_testcase)
%.ctest:
$(setup) \
(cd $*; $(swig_and_compile_c); ) && \
$(setup)
+(cd $* && $(swig_and_compile_c))
$(run_testcase)
%.multicpptest:
$(setup) \
(cd $*; $(swig_and_compile_multi_cpp); ) && \
$(setup)
+(cd $* && $(swig_and_compile_multi_cpp))
$(run_testcase)
# Makes a directory for the testcase if it does not exist
@ -66,7 +66,7 @@ setup = \
# a file is found which has _runme.java appended after the testcase name.
# Note Java uses LD_LIBRARY_PATH under Unix, PATH under Cygwin/Windows, SHLIB_PATH on HPUX and DYLD_LIBRARY_PATH on Mac OS X.
run_testcase = \
(cd $* && javac -classpath . *.java; ) && \
(cd $* && javac -classpath . *.java) && \
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then ( \
javac -classpath . -d . $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
env LD_LIBRARY_PATH="$*:$$LD_LIBRARY_PATH" PATH="$*:$$PATH" SHLIB_PATH="$*:$$SHLIB_PATH" DYLD_LIBRARY_PATH="$*:$$DYLD_LIBRARY_PATH" java -classpath . $*\_runme;) \

View file

@ -27,18 +27,18 @@ LIBS = -L.
# Rules for the different types of tests
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ) &&\
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
%.ctest:
$(setup) \
($(swig_and_compile_c); ) &&\
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ) &&\
$(setup)
+$(swig_and_compile_multi_cpp)
$(run_testcase)
# Runs the testcase. A testcase is only run if

View file

@ -16,18 +16,18 @@ include $(srcdir)/../common.mk
# Rules for the different types of tests
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ) && \
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
%.ctest:
$(setup) \
($(swig_and_compile_c); ) && \
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ) && \
$(setup)
+$(swig_and_compile_multi_cpp)
$(run_testcase)
# Runs the testcase. A testcase is only run if

View file

@ -47,27 +47,27 @@ include $(srcdir)/../common.mk
# Rules for the different types of tests
%.cpptest:
echo $@ >> testing
$(setup) \
($(swig_and_compile_cpp); ) && \
$(run_testcase) \
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
if [ -f $(@:%.cpptest=%_wrap.o) ] ; then \
echo $@ >> success ; \
fi
%.ctest:
echo $@ >> testing
$(setup) \
($(swig_and_compile_c); ) && \
$(run_testcase) \
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
if [ -f $(@:%.ctest=%_wrap.o) ] ; then \
echo $@ >> success ; \
fi
%.multicpptest:
echo $@ >> testing
($(swig_and_compile_multi_cpp); ) && \
$(setup) \
$(run_testcase) \
+$(swig_and_compile_multi_cpp)
$(setup)
$(run_testcase)
if [ -f $(@:%.multicpptest=%_runtime_wrap.o) ] ; then \
echo $@ >> success ; \
fi

View file

@ -29,18 +29,18 @@ include $(srcdir)/../common.mk
# Rules for the different types of tests
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ) && \
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
%.ctest:
$(setup) \
($(swig_and_compile_c); ) && \
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ) && \
$(setup)
+$(swig_and_compile_multi_cpp)
$(run_testcase)
# Runs the testcase. A testcase is only run if

View file

@ -15,18 +15,18 @@ include $(srcdir)/../common.mk
TARGETPREFIX =# Should be php_ for Windows, empty otherwise
makecpptests:
@bash -ec 'for test in $(CPP_TEST_CASES) ; do make clean && make $${test}.cpptest; done'
@bash -ec 'for test in $(CPP_TEST_CASES) ; do $(MAKE) clean && $(MAKE) $${test}.cpptest; done'
maketests: makecpptests makectests
makectests:
@bash -ec 'for test in $(C_TEST_CASES) ; do make clean && make $${test}.cpptest; done'
@bash -ec 'for test in $(C_TEST_CASES) ; do $($(MAKE)) clean && $(MAKE) $${test}.cpptest; done'
runcpptests:
@bash -ec 'for test in $(CPP_TEST_CASES) ; do if [ -f $${test}_runme.php4 ] ; then make clean && make $${test}.cpptest; fi ; done'
@bash -ec 'for test in $(CPP_TEST_CASES) ; do if [ -f $${test}_runme.php4 ] ; then $(MAKE) clean && $(MAKE) $${test}.cpptest; fi ; done'
runctests:
@bash -ec 'for test in $(C_TEST_CASES) ; do if [ -f $${test}_runme.php4 ] ; then make clean && make $${test}.cpptest; fi; done'
@bash -ec 'for test in $(C_TEST_CASES) ; do if [ -f $${test}_runme.php4 ] ; then $(MAKE) clean && $(MAKE) $${test}.cpptest; fi; done'
runtests: runcpptests runctests
@ -41,18 +41,18 @@ missingtests: missingcpptests missingctests
# Rules for the different types of tests
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ) &&\
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
%.ctest:
$(setup) \
($(swig_and_compile_c); ) &&\
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ) &&\
$(setup)
+$(swig_and_compile_multi_cpp)
$(run_testcase)
# Runs the testcase. A testcase is only run if

View file

@ -16,18 +16,18 @@ include $(srcdir)/../common.mk
# Rules for the different types of tests
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ) &&\
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
%.ctest:
$(setup) \
($(swig_and_compile_c); ) &&\
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ) &&\
$(setup)
+$(swig_and_compile_multi_cpp)
$(run_testcase)
# Runs the testcase. A testcase is only run if

View file

@ -67,18 +67,18 @@ LIBS = -L.
# Rules for the different types of tests
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ) &&\
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
%.ctest:
$(setup) \
($(swig_and_compile_c); ) &&\
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ) &&\
$(setup)
+$(swig_and_compile_multi_cpp)
$(run_testcase)
# Runs the testcase. A testcase is only run if
@ -112,7 +112,7 @@ cvsignore:
hugemod:
perl hugemod.pl
make hugemod_a.cpptest
make hugemod_b.cpptest
$(MAKE) hugemod_a.cpptest
$(MAKE) hugemod_b.cpptest
time $(PYTHON) hugemod_runme.py
time $(PYTHON) hugemod_runme.py

View file

@ -20,18 +20,18 @@ include $(srcdir)/../common.mk
# Rules for the different types of tests
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ) && \
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
%.ctest:
$(setup) \
($(swig_and_compile_c); ) && \
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ) && \
$(setup)
+$(swig_and_compile_multi_cpp)
$(run_testcase)
# Runs the testcase.

View file

@ -46,18 +46,18 @@ SWIGOPT += -w801 -noautorename -features autodoc=4
naming.cpptest: SWIGOPT = -autorename
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ) &&\
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
%.ctest:
$(setup) \
($(swig_and_compile_c); ) &&\
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ) &&\
$(setup)
+$(swig_and_compile_multi_cpp)
$(run_testcase)
# Runs the testcase. A testcase is only run if
@ -69,7 +69,7 @@ run_testcase = \
# Clean
%.clean:
clean:
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile ruby_clean

View file

@ -34,18 +34,18 @@ include $(srcdir)/../common.mk
# Rules for the different types of tests
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ) &&\
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
%.ctest:
$(setup) \
($(swig_and_compile_c); ) &&\
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ) &&\
$(setup)
+$(swig_and_compile_multi_cpp)
$(run_testcase)
# Runs the testcase. A testcase is only run if

View file

@ -18,18 +18,18 @@ CPP_TEST_CASES =
# Rules for the different types of tests
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ) &&\
$(setup)
+$(swig_and_compile_cpp)
$(run_testcase)
%.ctest:
$(setup) \
($(swig_and_compile_c); ) &&\
$(setup)
+$(swig_and_compile_c)
$(run_testcase)
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ) &&\
$(setup)
+$(swig_and_compile_multi_cpp)
$(run_testcase)
# Runs the testcase. A testcase is only run if

View file

@ -70,8 +70,6 @@ chk-set-swiglib = SWIG_LIB=@ROOT_DIR@/Lib
chk-set-swig = SWIG=@ROOT_DIR@/$(TARGET)
chk-set-env = $(chk-set-swiglib) $(chk-set-swig)
chk = $(MAKE) -k -s $(chk-set-env) $(ACTION)
check-aliveness:
test -x ./$(TARGET)
./$(TARGET) -version
@ -114,26 +112,47 @@ check-examples: \
check-cffi-examples \
check-r-examples
check-%-examples:
@passed=true; \
dir="Examples/$*"; \
if $(skip-$*); then \
tcl_examples :=$(shell sed '/^\#/d' Examples/tcl/check.list)
perl5_examples :=$(shell sed '/^\#/d' Examples/perl5/check.list)
python_examples :=$(shell sed '/^\#/d' Examples/python/check.list)
java_examples :=$(shell sed '/^\#/d' Examples/java/check.list)
guile_examples :=$(shell sed '/^\#/d' Examples/guile/check.list)
mzscheme_examples :=$(shell sed '/^\#/d' Examples/mzscheme/check.list)
ruby_examples :=$(shell sed '/^\#/d' Examples/ruby/check.list)
ocaml_examples :=$(shell sed '/^\#/d' Examples/ocaml/check.list)
php4_examples :=$(shell sed '/^\#/d' Examples/php4/check.list)
pike_examples :=$(shell sed '/^\#/d' Examples/pike/check.list)
chicken_examples :=$(shell sed '/^\#/d' Examples/chicken/check.list)
csharp_examples :=$(shell sed '/^\#/d' Examples/csharp/check.list)
modula3_examples :=$(shell sed '/^\#/d' Examples/modula3/check.list)
lua_examples :=$(shell sed '/^\#/d' Examples/lua/check.list)
allegrocl_examples :=
clisp_examples :=
uffi_examples :=
cffi_examples :=
r_examples :=
# all examples
check-%-examples :
@if $(skip-$*); then \
echo skipping $* $(ACTION); \
elif [ ! -f $$dir/check.list ]; then \
echo skipping $* $(ACTION) "(no $$dir/check.list)"; \
else \
all=`sed '/^#/d' $$dir/check.list`; \
for a in $$all; do \
if $(skip-gcj) && test $$a = "java"; then \
echo "skipping $* $$dir/$$a $(ACTION) (gcj test)";\
else \
echo $(ACTION)ing $$dir/$$a; \
(cd $$dir/$$a && $(chk)) \
|| passed=false; \
fi; \
done; \
$(MAKE) -k -s $($*_examples:=.actionexample) LANGUAGE=$* ACTION=$(ACTION); \
fi;
# individual example
%.actionexample:
@echo $(ACTION)ing Examples/$(LANGUAGE)/$*
@(cd Examples/$(LANGUAGE)/$* && $(MAKE) -s $(chk-set-env) $(ACTION))
# gcj individual example
java.actionexample:
@if $(skip-gcj); then \
echo "skipping Examples/$(LANGUAGE)/java $(ACTION) (gcj test)"; \
else \
echo $(ACTION)ing Examples/$(LANGUAGE)/java; \
(cd Examples/$(LANGUAGE)/java && $(MAKE) -s $(chk-set-env) $(ACTION)) \
fi; \
test $$passed = true
gifplot-library:
@echo $(ACTION)ing Examples/GIFPlot/Lib
@ -167,7 +186,8 @@ check-%-gifplot: gifplot-library
all=`sed '/^#/d' $$dir/check.list`; \
for a in $$all; do \
echo $(ACTION)ing $$dir/$$a; \
(cd $$dir/$$a && $(chk)) \
(cd $$dir/$$a && \
$(MAKE) -k -s $(chk-set-env) $(ACTION)) \
|| passed=false; \
done; \
fi; \

6
README
View file

@ -416,7 +416,11 @@ many parts of the implementation including obscure corner cases. If some
of these tests fail or generate warning messages, there is no reason for
alarm---the test may be related to some new SWIG feature or a difficult bug
that we're trying to resolve. Chances are that SWIG will work just fine
for you.
for you. Note that if you have more than one CPU/core, then you can use
parallel make can be used to speed up the check as it does take quite some
time to run, for example:
% make -j2 -k check
Also, SWIG's support for C++ is sufficiently advanced that certain
tests may fail on older C++ compilers (for instance if your compiler