now throw PHP Exception objects instead of giving a PHP error of type E_ERROR. This change shouldn't cause incompatibility issues, since you can't set an error handler for E_ERROR, so previously PHP would just exit which also happens for unhandled exceptions. The benefit is you can now catch them if you want to. Fixes SF#2545578 and SF#2955522. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12055 626c5289-ae23-0410-ae9c-e8d60b6d4f22
70 lines
2.1 KiB
Makefile
70 lines
2.1 KiB
Makefile
#######################################################################
|
|
# Makefile for php test-suite
|
|
#######################################################################
|
|
|
|
LANGUAGE = php
|
|
SCRIPTSUFFIX = _runme.php
|
|
srcdir = @srcdir@
|
|
top_srcdir = @top_srcdir@
|
|
top_builddir = @top_builddir@
|
|
|
|
CPP_TEST_CASES += \
|
|
php_namewarn_rename \
|
|
|
|
include $(srcdir)/../common.mk
|
|
|
|
# Overridden variables here
|
|
TARGETPREFIX =# Should be php_ for Windows, empty otherwise
|
|
|
|
# Custom tests - tests with additional commandline options
|
|
prefix.cpptest: SWIGOPT += -prefix Project
|
|
|
|
# write out tests without a _runme.php
|
|
missingcpptests:
|
|
for test in $(CPP_TEST_CASES) ; do test -f $${test}_runme.php || echo $${test}; done
|
|
|
|
missingctests:
|
|
for test in $(C_TEST_CASES) ; do test -f $${test}_runme.php || echo $${test}; done
|
|
|
|
missingtests: missingcpptests missingctests
|
|
|
|
# Rules for the different types of tests
|
|
%.cpptest:
|
|
$(setup)
|
|
+$(swig_and_compile_cpp)
|
|
+$(run_testcase)
|
|
|
|
%.ctest:
|
|
$(setup)
|
|
+$(swig_and_compile_c)
|
|
+$(run_testcase)
|
|
|
|
%.multicpptest:
|
|
$(setup)
|
|
+$(swig_and_compile_multi_cpp)
|
|
+$(run_testcase)
|
|
|
|
# Smart target
|
|
%.test:
|
|
@echo ' $(C_TEST_CASES) '|grep -F -v ' $* ' >/dev/null ||\
|
|
$(MAKE) $*.ctest
|
|
@echo ' $(CPP_TEST_CASES) '|grep -F -v ' $* ' >/dev/null ||\
|
|
$(MAKE) $*.cpptest
|
|
@echo ' $(MULTICPP_TEST_CASES) '|grep -F -v ' $* ' >/dev/null ||\
|
|
$(MAKE) $*.multicpptest
|
|
|
|
# Runs the testcase. Tries to run testcase_runme.php, and if that's not
|
|
# found, runs testcase.php, except for multicpptests.
|
|
run_testcase = \
|
|
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
|
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile PHPSCRIPT=$(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) RUNTOOL="$(RUNTOOL)" php_run; \
|
|
elif [ -f $(srcdir)/$(SCRIPTPREFIX)$*.php -a ! -f $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list ]; then \
|
|
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile PHPSCRIPT=$(srcdir)/$(SCRIPTPREFIX)$*.php RUNTOOL="$(RUNTOOL)" php_run; \
|
|
fi
|
|
|
|
# Clean: remove the generated .php file
|
|
%.clean:
|
|
@rm -f $*.php;
|
|
|
|
clean:
|
|
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile php_clean
|