Fixed SWIG go for cases when SWIG %import-s another package which is located in a subdirectory.
This commit is contained in:
parent
ece9854e8f
commit
8da4d20308
9 changed files with 135 additions and 7 deletions
|
|
@ -28,6 +28,9 @@ CPP_TEST_CASES = \
|
|||
go_inout \
|
||||
go_director_inout
|
||||
|
||||
MULTI_CPP_TEST_CASES = \
|
||||
go_subdir_import
|
||||
|
||||
include $(srcdir)/../common.mk
|
||||
|
||||
.SUFFIXES: .cpptest .ctest .multicpptest
|
||||
|
|
@ -59,6 +62,25 @@ multi_import.multicpptest:
|
|||
done
|
||||
$(run_multi_testcase)
|
||||
|
||||
go_subdir_import.multicpptest:
|
||||
$(setup)
|
||||
mkdir -p testdir/go_subdir_import/
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" CXXSRCS="$(CXXSRCS)" \
|
||||
SWIG_LIB="$(SWIG_LIB)" SWIG="$(SWIG)" LIBS='$(LIBS)' \
|
||||
INTERFACEPATH="go_subdir_import_b.i" \
|
||||
INCLUDES="$(INCLUDES)" SWIGOPT="$(SWIGOPT) -outdir ." NOLINK=true \
|
||||
TARGET="$(TARGETPREFIX)go_subdir_import_b$(TARGETSUFFIX)" INTERFACEDIR="$(INTERFACEDIR)" \
|
||||
INTERFACE="testdir/go_subdir_import/go_subdir_import_b.i" \
|
||||
$(LANGUAGE)$(VARIANT)_cpp;
|
||||
for f in testdir/go_subdir_import/go_subdir_import_c go_subdir_import_a ; do \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" CXXSRCS="$(CXXSRCS)" \
|
||||
SWIG_LIB="$(SWIG_LIB)" SWIG="$(SWIG)" LIBS='$(LIBS)' \
|
||||
INCLUDES="$(INCLUDES)" SWIGOPT="$(SWIGOPT)" NOLINK=true \
|
||||
TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR="$(INTERFACEDIR)" INTERFACE="$$f.i" \
|
||||
$(LANGUAGE)$(VARIANT)_cpp; \
|
||||
done
|
||||
$(run_multi_testcase)
|
||||
|
||||
# Runs the testcase.
|
||||
run_testcase = \
|
||||
if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
|
||||
|
|
@ -108,6 +130,7 @@ clean:
|
|||
rm -f mod_a.go mod_b.go imports_a.go imports_b.go
|
||||
rm -f clientdata_prop_a.go clientdata_prop_b.go
|
||||
rm -f multi_import_a.go multi_import_b.go
|
||||
rm -rf go_subdir_import_a.go testdir
|
||||
rm -f packageoption_a.go packageoption_b.go packageoption_c.go
|
||||
rm -f import_stl_a.go import_stl_b.go
|
||||
|
||||
|
|
|
|||
16
Examples/test-suite/go/go_subdir_import_runme.go
Normal file
16
Examples/test-suite/go/go_subdir_import_runme.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"go_subdir_import_a"
|
||||
"testdir/go_subdir_import/go_subdir_import_b"
|
||||
"testdir/go_subdir_import/go_subdir_import_c"
|
||||
)
|
||||
|
||||
func main() {
|
||||
b := go_subdir_import_b.NewObjB();
|
||||
c := go_subdir_import_c.NewObjC();
|
||||
v := go_subdir_import_a.AddFive(b, c)
|
||||
if v != 50 {
|
||||
panic(0)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue