Merge from trunk
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@12270 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
commit
1842244c93
530 changed files with 22854 additions and 11740 deletions
|
|
@ -117,7 +117,7 @@ VALGRIND_OPT += --suppressions=pythonswig.supp
|
|||
# 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.
|
||||
|
||||
run_python = env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PYTHONPATH=$(srcdir):$$PYTHONPATH $(RUNTOOL) $(PYTHON) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)
|
||||
run_python = env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PYTHONPATH=.:$(srcdir):$$PYTHONPATH $(RUNTOOL) $(PYTHON) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)
|
||||
|
||||
py2_runme = $(srcdir)/$(SCRIPTPREFIX)$*$(PY2SCRIPTSUFFIX)
|
||||
py3_runme = $(srcdir)/$(SCRIPTPREFIX)$*$(PY3SCRIPTSUFFIX)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ if _enums.cvar.enumInstance != 2:
|
|||
if _enums.cvar.Slap != 10:
|
||||
raise RuntimeError
|
||||
|
||||
if _enums.cvar.My != 11:
|
||||
if _enums.cvar.Mine != 11:
|
||||
raise RuntimeError
|
||||
|
||||
if _enums.cvar.Thigh != 12:
|
||||
|
|
|
|||
9
Examples/test-suite/python/funcptr_cpp_runme.py
Normal file
9
Examples/test-suite/python/funcptr_cpp_runme.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
from funcptr_cpp import *
|
||||
|
||||
if call1(ADD_BY_VALUE, 10, 11) != 21:
|
||||
raise RuntimeError
|
||||
if call2(ADD_BY_POINTER, 12, 13) != 25:
|
||||
raise RuntimeError
|
||||
if call3(ADD_BY_REFERENCE, 14, 15) != 29:
|
||||
raise RuntimeError
|
||||
|
||||
40
Examples/test-suite/python/global_namespace_runme.py
Normal file
40
Examples/test-suite/python/global_namespace_runme.py
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
from global_namespace import *
|
||||
|
||||
k1 = Klass1()
|
||||
k2 = Klass2()
|
||||
k3 = Klass3()
|
||||
k4 = Klass4()
|
||||
k5 = Klass5()
|
||||
k6 = Klass6()
|
||||
k7 = Klass7()
|
||||
|
||||
KlassMethods.methodA(k1, k2, k3, k4, k5, k6, k7)
|
||||
KlassMethods.methodB(k1, k2, k3, k4, k5, k6, k7)
|
||||
|
||||
k1 = getKlass1A()
|
||||
k2 = getKlass2A()
|
||||
k3 = getKlass3A()
|
||||
k4 = getKlass4A()
|
||||
k5 = getKlass5A()
|
||||
k6 = getKlass6A()
|
||||
k7 = getKlass7A()
|
||||
|
||||
KlassMethods.methodA(k1, k2, k3, k4, k5, k6, k7)
|
||||
KlassMethods.methodB(k1, k2, k3, k4, k5, k6, k7)
|
||||
|
||||
k1 = getKlass1B()
|
||||
k2 = getKlass2B()
|
||||
k3 = getKlass3B()
|
||||
k4 = getKlass4B()
|
||||
k5 = getKlass5B()
|
||||
k6 = getKlass6B()
|
||||
k7 = getKlass7B()
|
||||
|
||||
KlassMethods.methodA(k1, k2, k3, k4, k5, k6, k7)
|
||||
KlassMethods.methodB(k1, k2, k3, k4, k5, k6, k7)
|
||||
|
||||
XYZMethods.methodA(XYZ1(), XYZ2(), XYZ3(), XYZ4(), XYZ5(), XYZ6(), XYZ7())
|
||||
XYZMethods.methodB(XYZ1(), XYZ2(), XYZ3(), XYZ4(), XYZ5(), XYZ6(), XYZ7())
|
||||
|
||||
TheEnumMethods.methodA(theenum1, theenum2, theenum3)
|
||||
TheEnumMethods.methodA(theenum1, theenum2, theenum3)
|
||||
0
Examples/test-suite/python/iadd_runme.py
Executable file → Normal file
0
Examples/test-suite/python/iadd_runme.py
Executable file → Normal file
|
|
@ -18,3 +18,17 @@ check(nd)
|
|||
b = boing(nd)
|
||||
check(b)
|
||||
|
||||
################################
|
||||
|
||||
v = VectorIntHolder()
|
||||
v.push_back(IntHolder(11))
|
||||
v.push_back(IntHolder(22))
|
||||
v.push_back(IntHolder(33))
|
||||
|
||||
sum = sum(v)
|
||||
if sum != 66:
|
||||
raise "sum is wrong"
|
||||
|
||||
################################
|
||||
p = HiddenDestructor.create()
|
||||
|
||||
|
|
|
|||
|
|
@ -41,3 +41,6 @@ memberPtr = NULLPT
|
|||
check ("Square area ", 100.0, do_op(s,AREAPT))
|
||||
check ("Square perim", 40.0, do_op(s,PERIMPT))
|
||||
|
||||
check ("Add by value", 3, call1(ADD_BY_VALUE, 1, 2))
|
||||
check ("Add by pointer", 7, call2(ADD_BY_POINTER, 3, 4))
|
||||
check ("Add by reference", 11, call3(ADD_BY_REFERENCE, 5, 6))
|
||||
|
|
|
|||
0
Examples/test-suite/python/overload_complicated_runme.py
Executable file → Normal file
0
Examples/test-suite/python/overload_complicated_runme.py
Executable file → Normal file
10
Examples/test-suite/python/rename_pcre_encoder_runme.py
Normal file
10
Examples/test-suite/python/rename_pcre_encoder_runme.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
from rename_pcre_encoder import *
|
||||
|
||||
s = SomeWidget()
|
||||
s.putBorderWidth(3)
|
||||
s.putSize(4, 5)
|
||||
a = AnotherWidget()
|
||||
a.DoSomething()
|
||||
|
||||
evt = wxEVTSomeEvent()
|
||||
t = xUnchangedName()
|
||||
123
Examples/test-suite/python/smart_pointer_const_overload_runme.py
Normal file
123
Examples/test-suite/python/smart_pointer_const_overload_runme.py
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
from smart_pointer_const_overload import *
|
||||
|
||||
CONST_ACCESS = 1
|
||||
MUTABLE_ACCESS = 2
|
||||
|
||||
def test(b, f):
|
||||
if f.x != 0:
|
||||
raise RuntimeError
|
||||
|
||||
# Test member variable get
|
||||
if b.x != 0:
|
||||
raise RuntimeError
|
||||
|
||||
if f.access != CONST_ACCESS:
|
||||
raise RuntimeError
|
||||
|
||||
# Test member variable set
|
||||
b.x = 1
|
||||
|
||||
if f.x != 1:
|
||||
raise RuntimeError
|
||||
|
||||
if f.access != MUTABLE_ACCESS:
|
||||
raise RuntimeError
|
||||
|
||||
# Test const method
|
||||
if b.getx() != 1:
|
||||
raise RuntimeError
|
||||
|
||||
if f.access != CONST_ACCESS:
|
||||
raise RuntimeError
|
||||
|
||||
# Test mutable method
|
||||
b.setx(2)
|
||||
|
||||
if f.x != 2:
|
||||
raise RuntimeError
|
||||
|
||||
if f.access != MUTABLE_ACCESS:
|
||||
raise RuntimeError
|
||||
|
||||
# Test extended const method
|
||||
if b.getx2() != 2:
|
||||
raise RuntimeError
|
||||
|
||||
if f.access != CONST_ACCESS:
|
||||
raise RuntimeError
|
||||
|
||||
# Test extended mutable method
|
||||
b.setx2(3)
|
||||
|
||||
if f.x != 3:
|
||||
raise RuntimeError
|
||||
|
||||
if f.access != MUTABLE_ACCESS:
|
||||
raise RuntimeError
|
||||
|
||||
# Test static method
|
||||
b.stat()
|
||||
|
||||
if f.access != CONST_ACCESS:
|
||||
raise RuntimeError
|
||||
|
||||
# Test const member
|
||||
f.access = MUTABLE_ACCESS
|
||||
|
||||
if b.y != 0:
|
||||
raise RuntimeError
|
||||
|
||||
if f.access != CONST_ACCESS:
|
||||
raise RuntimeError
|
||||
|
||||
# Test get through mutable pointer to const member
|
||||
f.access = MUTABLE_ACCESS
|
||||
|
||||
if get_int(b.yp) != 0:
|
||||
raise RuntimeError
|
||||
|
||||
if f.access != CONST_ACCESS:
|
||||
raise RuntimeError
|
||||
|
||||
# Test get through const pointer to mutable member
|
||||
f.x = 4
|
||||
f.access = MUTABLE_ACCESS
|
||||
|
||||
if get_int(b.xp) != 4:
|
||||
raise RuntimeError
|
||||
|
||||
if f.access != CONST_ACCESS:
|
||||
raise RuntimeError
|
||||
|
||||
# Test set through const pointer to mutable member
|
||||
f.access = MUTABLE_ACCESS
|
||||
set_int(b.xp, 5)
|
||||
|
||||
if f.x != 5:
|
||||
raise RuntimeError
|
||||
|
||||
if f.access != CONST_ACCESS:
|
||||
raise RuntimeError
|
||||
|
||||
# Test set pointer to const member
|
||||
b.yp = new_int(6)
|
||||
|
||||
if f.y != 0:
|
||||
raise RuntimeError
|
||||
|
||||
if get_int(f.yp) != 6:
|
||||
raise RuntimeError
|
||||
|
||||
if f.access != MUTABLE_ACCESS:
|
||||
raise RuntimeError
|
||||
|
||||
delete_int(f.yp);
|
||||
|
||||
f = Foo()
|
||||
b = Bar(f)
|
||||
|
||||
f2 = Foo()
|
||||
b2 = Bar2(f2)
|
||||
|
||||
test(b, f)
|
||||
test(b2, f2)
|
||||
0
Examples/test-suite/python/threads_exception_runme.py
Executable file → Normal file
0
Examples/test-suite/python/threads_exception_runme.py
Executable file → Normal file
Loading…
Add table
Add a link
Reference in a new issue