~laney/ubuntu/quantal/swig2.0/guile-2.0

« back to all changes in this revision

Viewing changes to .pc/upstream_r12653.diff/Examples/test-suite/python/Makefile.in

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Landschoff
  • Date: 2011-05-03 22:34:43 UTC
  • Revision ID: james.westby@ubuntu.com-20110503223443-2f1pqulejz92wiqn
Tags: 2.0.3-2
* Package a snapshot of the upcoming upstream release 2.0.4. This matches
  upstream revision r12653.
  + Fixes building of Python 3.2 bindings (closes: #622980).

Show diffs side-by-side

added added

removed removed

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