Added test for subincluiding files with the same basename, reported by Kerim Borchaev
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5353 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8f8e9107c1
commit
8d1ccabff4
8 changed files with 74 additions and 1 deletions
|
|
@ -56,7 +56,8 @@ CPP_TEST_BROKEN += \
|
||||||
using_namespace
|
using_namespace
|
||||||
|
|
||||||
# Broken C test cases. (Can be run individually using make testcase.ctest.)
|
# Broken C test cases. (Can be run individually using make testcase.ctest.)
|
||||||
C_TEST_BROKEN +=
|
C_TEST_BROKEN += \
|
||||||
|
inctest.i
|
||||||
|
|
||||||
|
|
||||||
# C++ test cases. (Can be run individually using make testcase.cpptest.)
|
# C++ test cases. (Can be run individually using make testcase.cpptest.)
|
||||||
|
|
|
||||||
15
SWIG/Examples/test-suite/inctest.i
Normal file
15
SWIG/Examples/test-suite/inctest.i
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
%module inctest
|
||||||
|
|
||||||
|
//
|
||||||
|
// This test fails if swig is not able to include
|
||||||
|
// the following two files:
|
||||||
|
//
|
||||||
|
// 'testdir/subdir1/hello.i'
|
||||||
|
// 'testdir/subdir2/hello.i'
|
||||||
|
//
|
||||||
|
// since they have the same basename 'hello', swig is only
|
||||||
|
// including one. This is not right, it must include both,
|
||||||
|
// as the well known compilers do.
|
||||||
|
//
|
||||||
|
|
||||||
|
%include "testdir/test.i"
|
||||||
22
SWIG/Examples/test-suite/python/inctest_runme.py
Normal file
22
SWIG/Examples/test-suite/python/inctest_runme.py
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
import inctest
|
||||||
|
|
||||||
|
try:
|
||||||
|
a = inctest.A()
|
||||||
|
except:
|
||||||
|
print "didn't find A"
|
||||||
|
print "therefore, I didn't include 'testdir/subdir1/hello.i'"
|
||||||
|
error = 1
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
b = inctest.B()
|
||||||
|
except:
|
||||||
|
print "didn't find B"
|
||||||
|
print "therefore, I didn't include 'testdir/subdir2/hello.i'"
|
||||||
|
error = 1
|
||||||
|
pass
|
||||||
|
|
||||||
|
if error == 1:
|
||||||
|
raise RuntimeError
|
||||||
|
|
||||||
15
SWIG/Examples/test-suite/testdir/subdir1/hello.i
Normal file
15
SWIG/Examples/test-suite/testdir/subdir1/hello.i
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
#ifndef __subdir1_hello_i__
|
||||||
|
#define __subdir1_hello_i__
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
|
||||||
|
struct A
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif //__subdir1_hello_i__
|
||||||
1
SWIG/Examples/test-suite/testdir/subdir1/subinc1.i
Normal file
1
SWIG/Examples/test-suite/testdir/subdir1/subinc1.i
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
%include "hello.i"
|
||||||
14
SWIG/Examples/test-suite/testdir/subdir2/hello.i
Normal file
14
SWIG/Examples/test-suite/testdir/subdir2/hello.i
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
#ifndef __subdir2_hello_i__
|
||||||
|
#define __subdir2_hello_i__
|
||||||
|
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
|
||||||
|
struct B
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
#endif //__subdir2_hello_i__
|
||||||
2
SWIG/Examples/test-suite/testdir/subdir2/subinc2.i
Normal file
2
SWIG/Examples/test-suite/testdir/subdir2/subinc2.i
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
%include "hello.i"
|
||||||
|
|
||||||
3
SWIG/Examples/test-suite/testdir/test.i
Normal file
3
SWIG/Examples/test-suite/testdir/test.i
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
%include "subdir1/subinc1.i"
|
||||||
|
%include "subdir2/subinc2.i"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue