PageRenderTime 39ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/python/Makefile.in

#
Autoconf | 186 lines | 132 code | 34 blank | 20 comment | 4 complexity | 80ef0de7f99a720c394fb925de75b98b MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. #######################################################################
  2. # Makefile for python test-suite
  3. #######################################################################
  4. ifeq (,$(PY3))
  5. PYBIN = @PYTHON@
  6. else
  7. PYBIN = @PYTHON3@
  8. endif
  9. LANGUAGE = python
  10. PYTHON = $(PYBIN)
  11. #*_runme.py for Python 2.x, *_runme3.py for Python 3.x
  12. PY2SCRIPTSUFFIX = _runme.py
  13. PY3SCRIPTSUFFIX = _runme3.py
  14. ifeq (,$(PY3))
  15. SCRIPTSUFFIX = $(PY2SCRIPTSUFFIX)
  16. else
  17. SCRIPTSUFFIX = $(PY3SCRIPTSUFFIX)
  18. endif
  19. srcdir = @srcdir@
  20. top_srcdir = @top_srcdir@
  21. top_builddir = @top_builddir@
  22. PY2TO3 = 2to3 -x import
  23. CPP_TEST_CASES += \
  24. argcargvtest \
  25. callback \
  26. complextest \
  27. director_stl \
  28. director_wstring \
  29. file_test \
  30. iadd \
  31. implicittest \
  32. inout \
  33. inplaceadd \
  34. input \
  35. kwargs_feature \
  36. li_cstring \
  37. li_cwstring \
  38. li_factory \
  39. li_implicit \
  40. li_std_map_member \
  41. li_std_multimap \
  42. li_std_pair_extra \
  43. li_std_set \
  44. li_std_stream \
  45. li_std_string_extra \
  46. li_std_vectora \
  47. li_std_vector_extra \
  48. li_std_wstream \
  49. li_std_wstring \
  50. primitive_types \
  51. python_abstractbase \
  52. python_append \
  53. python_director \
  54. python_nondynamic \
  55. python_overload_simple_cast \
  56. python_richcompare \
  57. simutry \
  58. std_containers \
  59. swigobject \
  60. template_matrix
  61. # li_std_carray
  62. # director_profile
  63. # python_pybuf
  64. C_TEST_CASES += \
  65. file_test \
  66. li_cstring \
  67. li_cwstring \
  68. python_nondynamic \
  69. python_varargs_typemap
  70. #
  71. # This test only works with modern C compilers
  72. #
  73. #C_TEST_CASES += \
  74. # complextest
  75. include $(srcdir)/../common.mk
  76. BUILTIN_BROKEN = \
  77. default_constructor.cpptest \
  78. director_exception.cpptest \
  79. exception_order.cpptest \
  80. li_std_string_extra.cpptest \
  81. li_std_wstring.cpptest \
  82. python_abstractbase.cpptest \
  83. threads_exception.cpptest
  84. BUILTIN_NOT_BROKEN = $(filter-out $(BUILTIN_BROKEN),$(NOT_BROKEN_TEST_CASES))
  85. builtin-check : $(BUILTIN_NOT_BROKEN)
  86. # Overridden variables here
  87. LIBS = -L.
  88. VALGRIND_OPT += --suppressions=pythonswig.supp
  89. # Custom tests - tests with additional commandline options
  90. # none!
  91. # Rules for the different types of tests
  92. %.cpptest:
  93. $(setup)
  94. +$(swig_and_compile_cpp)
  95. $(run_testcase)
  96. %.ctest:
  97. $(setup)
  98. +$(swig_and_compile_c)
  99. $(run_testcase)
  100. %.multicpptest:
  101. $(setup)
  102. +$(swig_and_compile_multi_cpp)
  103. $(run_testcase)
  104. # Call 2to3 to generate Python 3.x test from the Python 2.x's *_runme.py file
  105. %$(PY3SCRIPTSUFFIX): %$(PY2SCRIPTSUFFIX)
  106. cp $< $@
  107. $(PY2TO3) -w $@ >/dev/null 2>&1
  108. # Runs the testcase. A testcase is only run if
  109. # a file is found which has _runme.py (or _runme3.py for Python 3) appended after the testcase name.
  110. run_python = env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PYTHONPATH=.:$(srcdir):$$PYTHONPATH $(RUNTOOL) $(PYTHON) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)
  111. py2_runme = $(srcdir)/$(SCRIPTPREFIX)$*$(PY2SCRIPTSUFFIX)
  112. py3_runme = $(srcdir)/$(SCRIPTPREFIX)$*$(PY3SCRIPTSUFFIX)
  113. ifeq (,$(PY3))
  114. run_testcase = \
  115. if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
  116. $(run_python);\
  117. fi
  118. else
  119. run_testcase = \
  120. if [ -f $(py2_runme) ]; then \
  121. $(MAKE) -f $(srcdir)/Makefile $(py3_runme) && $(run_python); \
  122. elif [ -f $(py3_runme) ]; then \
  123. $(run_python); \
  124. fi
  125. endif
  126. # Clean: remove the generated .py file
  127. %.clean:
  128. @rm -f $*.py;
  129. @#We only remove the _runme3.py if it is generated by 2to3 from a _runme.py.
  130. @if [ -f $(py2_runme) ]; then rm -f $(py3_runme) $(py3_runme).bak; fi
  131. clean:
  132. $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile python_clean
  133. rm -f hugemod.h hugemod_a.i hugemod_b.i hugemod_a.py hugemod_b.py hugemod_runme.py
  134. cvsignore:
  135. @echo '*wrap* *.pyc *.so *.dll *.exp *.lib'
  136. @echo Makefile
  137. @for i in ${CPP_TEST_CASES} ${C_TEST_CASES}; do echo $$i.py; done
  138. @for i in ${CPP_TEST_CASES} ${C_TEST_CASES}; do if grep -q $${i}_runme.py CVS/Entries ; then echo $${i}_runme.py; fi; done
  139. @echo clientdata_prop_a.py
  140. @echo clientdata_prop_b.py
  141. @echo imports_a.py
  142. @echo imports_b.py
  143. @echo mod_a.py mod_b.py
  144. @echo hugemod.h hugemod_a.i hugemod_b.i hugemod_a.py hugemod_b.py hugemod_runme.py
  145. @echo template_typedef_import.py
  146. hugemod_runme = hugemod$(SCRIPTPREFIX)
  147. hugemod:
  148. perl hugemod.pl $(hugemod_runme)
  149. $(MAKE) hugemod_a.cpptest
  150. $(MAKE) hugemod_b.cpptest
  151. sh -c "time $(PYTHON) $(hugemod_runme)"
  152. sh -c "time $(PYTHON) $(hugemod_runme)"