swig/Examples/test-suite/python/Makefile.in
William S Fulton 0cfd53cff7 Merge branch 'master' into vadz-doxygen
* master:
  Add Octave 4.4 to Travis allow_failures
  Fixes for appveyor image changes
  Javascript test-suite Makefile parallel jobs
  Add changes entry for csconstruct, dconstruct and javaconstruct fix
  Fix lookup of csconstruct, dconstructor and javaconstruct typemaps
  Javascript %nspace fix in generated C++ code
  Add C++17 documentation chapter
  Add changes notes for C++17 nested namespaces support
  Test for invalid C++17 nested namespace aliases
  Test c++17 nested namespaces and %nspace
  Add c++17 nested namespaces runtime test for C#
  Add c++17 nested namespaces runtime test for Python
  Add support for c++17 nested namespaces
  Update CHANGES.current
  .travis.yml: test against Octave 4.4
  Examples/test-suite/register_par.i: rename 'tree' to 'swig_tree'
  Examples/octave/module_load/runme.m: update 'exist()' statements for Octave >= 4.4
  Examples/octave/module_load/runme.m: do not use duplicate function names
  Examples/Makefile.in: unset OCTAVE_PATH when running Octave for tests
  Lib/octave: fix getting/setting global variables for Octave >= 4.4
  Lib/octave: use new class for function member dereference with Octave >= 4.4
  Lib/octave: fix operator installation for Octave >= 4.4
  Lib/Octave: in Octave >= 4.4, assign reference to base class in subclass
  Lib/octave: fix call to mlock() for Octave >= 4.4
  Lib/octave: fix call to octave::call_stack::current() for Octave >= 4.4
  Lib/octave: 'octave_exit' not longer exists in Octave >= 4.4
  Lib/octave: replace is_bool_type() with islogical() for Octave >= 4.4
  Lib/octave: replace is_numeric_type() with isnumeric() for Octave >= 4.4
  Lib/octave: replace is_cell() with iscell() for Octave >= 4.4
  Lib/octave: call octave::feval() instead of feval() for Octave >= 4.4
  Lib/octave: fix function name passed to unwind_protect::begin_frame()
  C#, D, Java methodmodifiers on destructors
  Javascript assert.h - move to header section
  Appveyor cl compiler warning fixes during configure
  Java vector wrappers cast correction
  test-suite fixes (Java directors) for compilers that don't support varargs
  Go - use director.swg like other languages
  test-suite fixes (2) for compilers that don't support varargs
  Consistent spacing in generated exception specifications
  test-suite fixes for compilers that don't support vararg macros
  Enhance Travis testing to use gcc 8 and test C++17 and C17
  Enhance SWIG_isfinite for older standards: C++03/C++98/C89
  test-suite support for gcc-8 targeting C++11 and C++14
  Scilab portability fixes - remove use of strdup
  Scilab array overbounds fix handling char type exceptions
  test-suite fix for c++17 and throw macro
  Remove use of 'register' in C source
  test-suite support for C++17: switch testing of the deprecated C++17 'register' keyword from C++ to C
  Examples update to support C++17: exception specification throw removal
  Cosmetic syntax tweak using throw in Octave directors
  test-suite support for C++17 (Java): exception specification throw removal
  test-suite support for C++17: exception specification throw removal
  __cplusplus macro usage tweak
  Improve detection of Python's 2to3 tool
  Correct C shared library creation when specifing CC to configure
  Remove superfluous parens in generated Python scripts.
  [ci] guile 2.2 build no longer expected to fail
  guile - resstructure some configure tests
  Disable guile configuration if guile-config and guile report a different version
  Fix guile executable detection on early 2.0.x guile versions
  guile - drop GDB_INTERFACE related stuff
  guile - replace obsolete scm_listify with scm_list_n
  guile - use more reliable method of finding guile executable based on guile-config
  Fix go version matching in configure for go1.10
  [Python] Suppress new pycodestyle warning
  Add if-no-present action for jsv8inc arg
  Fix typo in help --with-jscoreinc and --with-jscorelib
  Fix off-by-one error
  * Makefile.in (configfiles): Update URLs for latest configfiles.
  Add changes entry for Ruby %alias fix for global functions
  [Ruby] Pass Qnil instead of NULL to rb_funcall()
  Fix typo
  Fix ruby %alias directive for native c functions
  Stop testing Python on Appveyor msys/mingw
  Fix -Wimplicit-fallthrough gcc-7.3 warning
2018-05-17 19:57:02 +01:00

197 lines
4.7 KiB
Makefile

#######################################################################
# Makefile for python test-suite
#######################################################################
ifeq (,$(PY3))
PYBIN = @PYTHON@
else
PYBIN = @PYTHON3@
endif
LANGUAGE = python
PYTHON = $(PYBIN)
PYCODESTYLE = @PYCODESTYLE@
PYCODESTYLE_FLAGS = --ignore=E252,E30,E402,E501,E731,W291,W391
#*_runme.py for Python 2.x, *_runme3.py for Python 3.x
PY2SCRIPTSUFFIX = _runme.py
PY3SCRIPTSUFFIX = _runme3.py
PY2TO3 = @PY2TO3@ -x import
ifeq (,$(PY3))
SCRIPTSUFFIX = $(PY2SCRIPTSUFFIX)
else
SCRIPTSUFFIX = $(PY3SCRIPTSUFFIX)
endif
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
CPP_TEST_CASES += \
argcargvtest \
callback \
complextest \
director_stl \
director_wstring \
file_test \
iadd \
implicittest \
inout \
inplaceadd \
input \
li_cstring \
li_cwstring \
li_factory \
li_implicit \
li_std_containers_int \
li_std_map_member \
li_std_multimap \
li_std_pair_extra \
li_std_set \
li_std_stream \
li_std_string_extra \
li_std_vectora \
li_std_vector_extra \
li_std_wstream \
li_std_wstring \
primitive_types \
python_abstractbase \
python_append \
python_builtin \
python_destructor_exception \
python_director \
python_docstring \
python_extranative \
python_moduleimport \
python_nondynamic \
python_overload_simple_cast \
python_pickle \
python_pythoncode \
python_richcompare \
python_strict_unicode \
python_threads \
simutry \
std_containers \
swigobject \
template_matrix \
# li_std_carray
# director_profile
# python_pybuf
CPP11_TEST_CASES = \
cpp11_hash_tables \
cpp11_shared_ptr_const \
cpp11_shared_ptr_nullptr_in_containers \
cpp11_shared_ptr_overload \
cpp11_shared_ptr_upcast \
C_TEST_CASES += \
file_test \
li_cstring \
li_cwstring \
python_nondynamic \
python_varargs_typemap \
#
# This test only works with modern C compilers
#
#C_TEST_CASES += \
# complextest
include $(srcdir)/../common.mk
# Overridden variables here
SCRIPTDIR = .
LIBS = -L.
VALGRIND_OPT += --suppressions=pythonswig.supp
# Custom tests - tests with additional commandline options
# none!
# Rules for the different types of tests
%.cpptest:
+$(convert_testcase)
$(setup)
+$(swig_and_compile_cpp)
$(check_pep8)
$(run_testcase)
%.ctest:
+$(convert_testcase)
$(setup)
+$(swig_and_compile_c)
$(check_pep8)
$(run_testcase)
%.multicpptest:
+$(convert_testcase)
$(setup)
+$(swig_and_compile_multi_cpp)
$(check_pep8_multi_cpp)
$(run_testcase)
# Runs the testcase. A testcase is only run if
# a file is found which has _runme.py (or _runme3.py for Python 3) appended after the testcase name.
py_runme = $(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)
py2_runme = $(SCRIPTPREFIX)$*$(PY2SCRIPTSUFFIX)
py3_runme = $(SCRIPTPREFIX)$*$(PY3SCRIPTSUFFIX)
ifneq (,$(PYCODESTYLE))
check_pep8 = $(COMPILETOOL) $(PYCODESTYLE) $(PYCODESTYLE_FLAGS) $(SCRIPTPREFIX)$*.py
check_pep8_multi_cpp = \
for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \
$(COMPILETOOL) $(PYCODESTYLE) $(PYCODESTYLE_FLAGS) $$f.py; \
done
endif
run_python = env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PYTHONPATH=.:$(srcdir):$$PYTHONPATH $(RUNTOOL) $(PYTHON) $(py_runme)
run_testcase = \
if [ -f $(SCRIPTDIR)/$(py_runme) ]; then \
$(run_python);\
fi
# No copying/conversion needed for in-source-tree Python 2 scripts
ifeq ($(SCRIPTDIR)|$(SCRIPTSUFFIX),$(srcdir)|$(PY2SCRIPTSUFFIX))
convert_testcase =
else
convert_testcase = \
if [ -f $(srcdir)/$(py2_runme) ]; then \
$(MAKE) $(SCRIPTDIR)/$(py_runme); \
fi
$(SCRIPTDIR)/$(SCRIPTPREFIX)%$(SCRIPTSUFFIX): $(abspath $(srcdir)/$(SCRIPTPREFIX)%$(PY2SCRIPTSUFFIX))
test x$< = x$@ || cp $< $@ || exit 1
test x$(PY3) = x || $(PY2TO3) -w $@ >/dev/null 2>&1 || exit 1
endif
# Clean: remove the generated .py file
# We only remove the _runme3.py if it is generated by 2to3 from a _runme.py.
%.clean:
@rm -f $*.py
@if test -f $(srcdir)/$(py2_runme); then rm -f $(SCRIPTDIR)/$(py3_runme) $(SCRIPTDIR)/$(py3_runme).bak; fi
@if test "x$(SCRIPTDIR)" != "x$(srcdir)"; then rm -f $(SCRIPTDIR)/$(py2_runme); fi
clean:
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' python_clean
rm -f hugemod.h hugemod_a.i hugemod_b.i hugemod_a.py hugemod_b.py hugemod_runme.py
rm -f clientdata_prop_a.py clientdata_prop_b.py import_stl_a.py import_stl_b.py
rm -f imports_a.py imports_b.py mod_a.py mod_b.py multi_import_a.py
rm -f multi_import_b.py packageoption_a.py packageoption_b.py packageoption_c.py
hugemod_runme = hugemod$(SCRIPTPREFIX)
hugemod:
perl hugemod.pl $(hugemod_runme)
$(MAKE) hugemod_a.cpptest
$(MAKE) hugemod_b.cpptest
sh -c "time $(PYTHON) $(hugemod_runme)"
sh -c "time $(PYTHON) $(hugemod_runme)"