From 8a1c09e280e323ba48407a9a9ae86f19d1c7abbe Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 24 Apr 2019 21:43:38 -0700 Subject: [PATCH] Fix Go tests to run in module mode Stop using relative imports and add a go.mod file. Tested against Go 1.6 through Go pre-1.13, and gccgo. --- Doc/Manual/Go.html | 7 ++ Examples/Makefile.in | 57 ++++++++------ Examples/go/callback/runme.go | 3 +- Examples/go/class/runme.go | 3 +- Examples/go/constants/runme.go | 3 +- Examples/go/director/runme.go | 3 +- Examples/go/enum/runme.go | 3 +- Examples/go/extend/runme.go | 3 +- Examples/go/funcptr/runme.go | 3 +- Examples/go/multimap/runme.go | 3 +- Examples/go/pointer/runme.go | 3 +- Examples/go/reference/runme.go | 3 +- Examples/go/simple/runme.go | 3 +- Examples/go/template/runme.go | 3 +- Examples/go/variables/runme.go | 3 +- Examples/test-suite/go/Makefile.in | 78 ++++++++++++------- .../test-suite/go/abstract_access_runme.go | 2 +- .../test-suite/go/abstract_typedef2_runme.go | 2 +- .../test-suite/go/abstract_typedef_runme.go | 2 +- .../test-suite/go/abstract_virtual_runme.go | 2 +- Examples/test-suite/go/argout_runme.go | 2 +- Examples/test-suite/go/array_member_runme.go | 2 +- Examples/test-suite/go/arrays_global_runme.go | 2 +- Examples/test-suite/go/char_binary_runme.go | 2 +- Examples/test-suite/go/class_ignore_runme.go | 2 +- .../test-suite/go/class_scope_weird_runme.go | 2 +- .../test-suite/go/compactdefaultargs_runme.go | 2 +- Examples/test-suite/go/constover_runme.go | 3 +- .../test-suite/go/constructor_copy_runme.go | 2 +- Examples/test-suite/go/contract_runme.go | 2 +- ...cpp11_strongly_typed_enumerations_runme.go | 2 +- Examples/test-suite/go/cpp_enum_runme.go | 2 +- Examples/test-suite/go/cpp_namespace_runme.go | 2 +- Examples/test-suite/go/cpp_static_runme.go | 2 +- Examples/test-suite/go/default_args_runme.go | 2 +- .../go/default_constructor_runme.go | 2 +- .../go/director_alternating_runme.go | 2 +- .../test-suite/go/director_basic_runme.go | 2 +- .../test-suite/go/director_classic_runme.go | 2 +- .../test-suite/go/director_default_runme.go | 2 +- .../test-suite/go/director_detect_runme.go | 2 +- Examples/test-suite/go/director_enum_runme.go | 2 +- .../test-suite/go/director_exception_runme.go | 2 +- .../test-suite/go/director_extend_runme.go | 2 +- .../test-suite/go/director_finalizer_runme.go | 2 +- Examples/test-suite/go/director_frob_runme.go | 2 +- .../test-suite/go/director_nested_runme.go | 2 +- .../test-suite/go/director_profile_runme.go | 2 +- .../test-suite/go/director_protected_runme.go | 2 +- .../test-suite/go/director_string_runme.go | 2 +- .../test-suite/go/director_unroll_runme.go | 2 +- Examples/test-suite/go/disown_runme.go | 2 +- Examples/test-suite/go/dynamic_cast_runme.go | 2 +- Examples/test-suite/go/empty_c_runme.go | 2 +- Examples/test-suite/go/empty_runme.go | 2 +- Examples/test-suite/go/enum_template_runme.go | 2 +- Examples/test-suite/go/enums_runme.go | 2 +- .../test-suite/go/exception_order_runme.go | 2 +- .../test-suite/go/extend_placement_runme.go | 2 +- .../test-suite/go/extend_template_ns_runme.go | 2 +- .../test-suite/go/extend_template_runme.go | 2 +- .../test-suite/go/extend_variable_runme.go | 2 +- Examples/test-suite/go/extern_c_runme.go | 2 +- Examples/test-suite/go/friends_runme.go | 2 +- Examples/test-suite/go/fvirtual_runme.go | 2 +- Examples/test-suite/go/global_ns_arg_runme.go | 2 +- .../test-suite/go/go_director_inout_runme.go | 2 +- Examples/test-suite/go/go_inout_runme.go | 2 +- .../test-suite/go/go_subdir_import_runme.go | 6 +- Examples/test-suite/go/grouping_runme.go | 2 +- .../test-suite/go/import_nomodule_runme.go | 2 +- Examples/test-suite/go/imports_runme.go | 4 +- Examples/test-suite/go/inctest_runme.go | 2 +- .../test-suite/go/inherit_member_runme.go | 2 +- .../test-suite/go/inherit_missing_runme.go | 2 +- Examples/test-suite/go/input_runme.go | 2 +- .../test-suite/go/keyword_rename_c_runme.go | 2 +- .../test-suite/go/keyword_rename_runme.go | 2 +- Examples/test-suite/go/li_attribute_runme.go | 2 +- .../test-suite/go/li_carrays_cpp_runme.go | 2 +- Examples/test-suite/go/li_carrays_runme.go | 2 +- Examples/test-suite/go/li_cdata_cpp_runme.go | 2 +- Examples/test-suite/go/li_cdata_runme.go | 2 +- Examples/test-suite/go/li_cmalloc_runme.go | 2 +- .../test-suite/go/li_cpointer_cpp_runme.go | 2 +- Examples/test-suite/go/li_cpointer_runme.go | 2 +- Examples/test-suite/go/li_std_map_runme.go | 2 +- .../test-suite/go/li_std_vector_ptr_runme.go | 2 +- .../test-suite/go/member_pointer_runme.go | 2 +- .../test-suite/go/memberin_extend_c_runme.go | 2 +- Examples/test-suite/go/minherit_runme.go | 2 +- Examples/test-suite/go/mod_runme.go | 4 +- Examples/test-suite/go/multi_import_runme.go | 4 +- .../test-suite/go/namespace_class_runme.go | 2 +- .../test-suite/go/namespace_typemap_runme.go | 2 +- .../go/namespace_virtual_method_runme.go | 2 +- Examples/test-suite/go/naturalvar_runme.go | 2 +- .../test-suite/go/nested_workaround_runme.go | 2 +- .../go/overload_complicated_runme.go | 2 +- Examples/test-suite/go/overload_copy_runme.go | 2 +- .../test-suite/go/overload_extend2_runme.go | 2 +- .../test-suite/go/overload_extend_c_runme.go | 2 +- .../test-suite/go/overload_extend_runme.go | 2 +- .../go/overload_polymorphic_runme.go | 2 +- .../test-suite/go/overload_rename_runme.go | 2 +- .../test-suite/go/overload_simple_runme.go | 2 +- .../test-suite/go/overload_subtype_runme.go | 2 +- .../go/overload_template_fast_runme.go | 2 +- .../test-suite/go/overload_template_runme.go | 2 +- Examples/test-suite/go/preproc_runme.go | 2 +- Examples/test-suite/go/primitive_ref_runme.go | 2 +- Examples/test-suite/go/profiletest_runme.go | 2 +- Examples/test-suite/go/refcount_runme.go | 2 +- .../go/reference_global_vars_runme.go | 2 +- Examples/test-suite/go/rename_scope_runme.go | 2 +- Examples/test-suite/go/rename_simple_runme.go | 2 +- .../go/rename_strip_encoder_runme.go | 2 +- Examples/test-suite/go/ret_by_value_runme.go | 2 +- .../test-suite/go/return_const_value_runme.go | 2 +- .../go/smart_pointer_extend_runme.go | 2 +- .../go/smart_pointer_member_runme.go | 2 +- .../go/smart_pointer_multi_runme.go | 2 +- .../go/smart_pointer_multi_typedef_runme.go | 2 +- .../go/smart_pointer_overload_runme.go | 2 +- .../go/smart_pointer_rename_runme.go | 2 +- .../go/smart_pointer_simple_runme.go | 2 +- .../smart_pointer_templatevariables_runme.go | 2 +- .../go/smart_pointer_typedef_runme.go | 2 +- Examples/test-suite/go/sneaky1_runme.go | 2 +- .../go/special_variable_macros_runme.go | 2 +- .../go/static_const_member_2_runme.go | 2 +- .../go/struct_initialization_runme.go | 2 +- Examples/test-suite/go/struct_rename_runme.go | 2 +- Examples/test-suite/go/struct_value_runme.go | 2 +- .../go/template_default_arg_runme.go | 2 +- .../test-suite/go/template_extend1_runme.go | 2 +- .../test-suite/go/template_extend2_runme.go | 2 +- .../test-suite/go/template_inherit_runme.go | 2 +- Examples/test-suite/go/template_ns4_runme.go | 2 +- Examples/test-suite/go/template_ns_runme.go | 2 +- .../test-suite/go/template_opaque_runme.go | 2 +- .../test-suite/go/template_ref_type_runme.go | 2 +- .../test-suite/go/template_rename_runme.go | 2 +- .../test-suite/go/template_static_runme.go | 2 +- .../go/template_tbase_template_runme.go | 2 +- .../go/template_type_namespace_runme.go | 2 +- .../go/template_typedef_cplx3_runme.go | 2 +- .../go/template_typedef_cplx4_runme.go | 2 +- .../test-suite/go/threads_exception_runme.go | 2 +- Examples/test-suite/go/typedef_class_runme.go | 2 +- .../test-suite/go/typedef_funcptr_runme.go | 2 +- .../test-suite/go/typedef_inherit_runme.go | 2 +- Examples/test-suite/go/typedef_scope_runme.go | 2 +- .../test-suite/go/typemap_namespace_runme.go | 2 +- .../test-suite/go/typemap_ns_using_runme.go | 2 +- .../go/typemap_out_optimal_runme.go | 2 +- Examples/test-suite/go/typename_runme.go | 2 +- Examples/test-suite/go/unions_runme.go | 2 +- Examples/test-suite/go/using1_runme.go | 2 +- Examples/test-suite/go/using2_runme.go | 2 +- .../test-suite/go/using_composition_runme.go | 2 +- Examples/test-suite/go/using_extend_runme.go | 2 +- Examples/test-suite/go/using_inherit_runme.go | 2 +- Examples/test-suite/go/using_private_runme.go | 2 +- .../test-suite/go/using_protected_runme.go | 2 +- .../test-suite/go/varargs_overload_runme.go | 2 +- Examples/test-suite/go/varargs_runme.go | 2 +- .../test-suite/go/virtual_derivation_runme.go | 2 +- Examples/test-suite/go/virtual_poly_runme.go | 2 +- Examples/test-suite/go/voidtest_runme.go | 2 +- Examples/test-suite/go/wrapmacro_runme.go | 2 +- Examples/test-suite/go_subdir_import.list | 2 +- Source/Modules/go.cxx | 21 ++++- 173 files changed, 298 insertions(+), 227 deletions(-) diff --git a/Doc/Manual/Go.html b/Doc/Manual/Go.html index dbea7de96..cfa56dbcf 100644 --- a/Doc/Manual/Go.html +++ b/Doc/Manual/Go.html @@ -266,6 +266,13 @@ swig -go -help ignored. + +-import-prefix <prefix> +A prefix to add when turning a %import prefix in the SWIG + interface file into an import statement in the Go file. For + example, with -import-prefix mymodule, a SWIG + interface file %import mypackage will become a Go + import statement import "mymodule/mypackage". diff --git a/Examples/Makefile.in b/Examples/Makefile.in index d7b71af2f..98be7873f 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -1457,7 +1457,8 @@ GOPACK = `if $(GO1) ; then echo go tool pack; else echo gopack; fi` GOPACKAGE = $(notdir $(INTERFACE:.i=.a)) -GOPATHDIR = gopath/src/$(INTERFACE:.i=) +GOPATHPARENTDIR = gopath/$(GOMOD)/src +GOPATHDIR = $(GOPATHPARENTDIR)/$(INTERFACE:.i=) GOOBJEXT = `if $(GO15); then echo o; else echo $(GOC:c=); fi` GOGCOBJS = $(GOSRCS:.go=.$(GOOBJEXT)) @@ -1467,6 +1468,16 @@ GOGCCOBJS = $(GOSRCS:.go=.@OBJEXT@) # Build a Go module (C) # ---------------------------------------------------------------- +$(GOPATHPARENTDIR)/go.mod: + @mkdir gopath 2>/dev/null || true + @mkdir gopath/$(GOMOD) 2>/dev/null || true + @mkdir gopath/$(GOMOD)/src 2>/dev/null || true + @mkdir $(GOPATHDIR) 2>/dev/null || true + echo "module swigtests" > $(GOPATHDIR)/go.mod + echo "" >> $(GOPATHDIR)/go.mod + echo "go 1.12" >> $(GOPATHDIR)/go.mod + mv -f $(GOPATHDIR)/go.mod $(GOPATHPARENTDIR)/go.mod + go_nocgo: $(SRCDIR_SRCS) $(SWIG) -go -no-cgo $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) if $(GO12) || $(GO13) || $(GO15) || $(GOGCC); then \ @@ -1503,11 +1514,12 @@ go_nocgo: $(SRCDIR_SRCS) fi; \ fi -go: $(SRCDIR_SRCS) - $(SWIG) -go $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) +go: $(SRCDIR_SRCS) $(GOPATHPARENTDIR)/go.mod + $(SWIG) -go -import-prefix swigtests $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) @mkdir gopath 2>/dev/null || true - @mkdir gopath/src 2>/dev/null || true - @mkdir gopath/src/$(INTERFACE:.i=) 2>/dev/null || true + @mkdir gopath/$(GOMOD) 2>/dev/null || true + @mkdir gopath/$(GOMOD)/src 2>/dev/null || true + @mkdir $(GOPATHDIR) 2>/dev/null || true rm -f $(GOPATHDIR)/* cp $(ISRCS) $(GOPATHDIR)/ if test -f $(IWRAP:.i=.h); then \ @@ -1517,7 +1529,7 @@ go: $(SRCDIR_SRCS) cp $(SRCDIR_SRCS) $(GOPATHDIR)/; \ fi cp $(GOSRCS) $(GOPATHDIR)/ - GOPATH=`pwd`/gopath; \ + GOPATH=`pwd`/gopath/$(GOMOD); \ export GOPATH; \ CGO_CPPFLAGS="$(CPPFLAGS) $(INCLUDES) -I `cd $(SRCDIR) && pwd` -I `pwd`"; \ export CGO_CPPFLAGS; \ @@ -1526,17 +1538,16 @@ go: $(SRCDIR_SRCS) CGO_LDFLAGS="$(LDFLAGS) -lm"; \ export CGO_LDFLAGS; \ (cd $(GOPATHDIR)/ && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o $(GOPACKAGE)) - cp $(GOPATHDIR)/$(GOPACKAGE) $(dir $(INTERFACE))/$(GOPACKAGE) if $(GOGCC); then \ - cp $(dir $(INTERFACE))/$(GOPACKAGE) $(dir $(INTERFACE))/$(GOPACKAGE:.a=.gox); \ + cp $(GOPATHDIR)/$(GOPACKAGE) $(GOPATHDIR)/$(GOPACKAGE:.a=.gox); \ fi if test -f $(SRCDIR)$(RUNME).go; then \ if $(GOGCC) ; then \ - $(COMPILETOOL) $(GCCGO) -c -g $(SRCDIR)$(RUNME).go; \ - $(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(dir $(INTERFACE))/$(GOPACKAGE); \ + $(COMPILETOOL) $(GCCGO) -c -g -I $(GOPATHDIR) $(SRCDIR)$(RUNME).go; \ + $(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(GOPATHDIR)/$(GOPACKAGE); \ elif $(GO12) || $(GO13) || $(GO15); then \ - $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -o $(RUNME).$(GOOBJEXT) $(SRCDIR)$(RUNME).go; \ - $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CC)" -extldflags "$(CFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \ + $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I $(GOPATHDIR) -o $(RUNME).$(GOOBJEXT) $(SRCDIR)$(RUNME).go; \ + $(COMPILETOOL) $(GOTOOL) $(GOLD) -L $(GOPATHDIR) -linkmode external -extld "$(CC)" -extldflags "$(CFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \ else \ $(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \ $(COMPILETOOL) $(GOTOOL) $(GOLD) -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $(RUNME) $(RUNME).$(GOOBJEXT); \ @@ -1595,11 +1606,12 @@ go_cpp_nocgo: $(SRCDIR_SRCS) fi; \ fi -go_cpp: $(SRCDIR_SRCS) - $(SWIG) -go -c++ $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) +go_cpp: $(SRCDIR_SRCS) $(GOPATHPARENTDIR)/go.mod + $(SWIG) -go -c++ -import-prefix swigtests $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) @mkdir gopath 2>/dev/null || true - @mkdir gopath/src 2>/dev/null || true - @mkdir gopath/src/$(INTERFACE:.i=) 2>/dev/null || true + @mkdir gopath/$(GOMOD) 2>/dev/null || true + @mkdir gopath/$(GOMOD)/src 2>/dev/null || true + @mkdir $(GOPATHDIR) 2>/dev/null || true rm -f $(GOPATHDIR)/* cp $(ICXXSRCS) $(GOPATHDIR)/ if test -f $(IWRAP:.i=.h); then \ @@ -1612,7 +1624,7 @@ go_cpp: $(SRCDIR_SRCS) cp $(SRCDIR_SRCS) $(GOPATHDIR)/; \ fi cp $(GOSRCS) $(GOPATHDIR)/ - GOPATH=`pwd`/gopath; \ + GOPATH=`pwd`/gopath/$(GOMOD); \ export GOPATH; \ CGO_CPPFLAGS="$(CPPFLAGS) $(INCLUDES) -I `cd $(SRCDIR) && pwd` -I `pwd`"; \ export CGO_CPPFLAGS; \ @@ -1623,17 +1635,16 @@ go_cpp: $(SRCDIR_SRCS) CGO_LDFLAGS="$(LDFLAGS) -lm"; \ export CGO_LDFLAGS; \ (cd $(GOPATHDIR) && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o $(GOPACKAGE)) - cp $(GOPATHDIR)/$(GOPACKAGE) $(dir $(INTERFACE))/$(GOPACKAGE) if $(GOGCC); then \ - cp $(dir $(INTERFACE))/$(GOPACKAGE) $(dir $(INTERFACE))/$(GOPACKAGE:.a=.gox); \ + cp $(GOPATHDIR)/$(GOPACKAGE) $(GOPATHDIR)/$(GOPACKAGE:.a=.gox); \ fi if test -f $(SRCDIR)$(RUNME).go; then \ if $(GOGCC) ; then \ - $(COMPILETOOL) $(GCCGO) -g -c $(SRCDIR)$(RUNME).go; \ - $(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(dir $(INTERFACE))/$(GOPACKAGE) -lstdc++; \ + $(COMPILETOOL) $(GCCGO) -g -c -I $(GOPATHDIR) $(SRCDIR)$(RUNME).go; \ + $(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(GOPATHDIR)/$(GOPACKAGE) -lstdc++; \ elif $(GO12) || $(GO13) || $(GO15); then \ - $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -o $(RUNME).$(GOOBJEXT) $(SRCDIR)$(RUNME).go; \ - $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CXX)" -extldflags "$(CXXFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \ + $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I $(GOPATHDIR) -o $(RUNME).$(GOOBJEXT) $(SRCDIR)$(RUNME).go; \ + $(COMPILETOOL) $(GOTOOL) $(GOLD) -L $(GOPATHDIR) -linkmode external -extld "$(CXX)" -extldflags "$(CXXFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \ else \ $(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \ $(COMPILETOOL) $(GOTOOL) $(GOLD) -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $(RUNME) $(RUNME).$(GOOBJEXT); \ diff --git a/Examples/go/callback/runme.go b/Examples/go/callback/runme.go index 03ab0c5e2..2c1d81343 100644 --- a/Examples/go/callback/runme.go +++ b/Examples/go/callback/runme.go @@ -1,8 +1,9 @@ package main import ( - . "./example" "fmt" + + . "example" ) func main() { diff --git a/Examples/go/class/runme.go b/Examples/go/class/runme.go index 8d68afb61..d2f292ed4 100644 --- a/Examples/go/class/runme.go +++ b/Examples/go/class/runme.go @@ -3,8 +3,9 @@ package main import ( - . "./example" "fmt" + + . "example" ) func main() { diff --git a/Examples/go/constants/runme.go b/Examples/go/constants/runme.go index 1427997a0..d56fd62c8 100644 --- a/Examples/go/constants/runme.go +++ b/Examples/go/constants/runme.go @@ -1,8 +1,9 @@ package main import ( - "./example" "fmt" + + "example" ) func main() { diff --git a/Examples/go/director/runme.go b/Examples/go/director/runme.go index 0d839bc88..0e0da07bd 100644 --- a/Examples/go/director/runme.go +++ b/Examples/go/director/runme.go @@ -1,9 +1,10 @@ package main import ( - "./example" "fmt" "os" + + "example" ) func Compare(name string, got string, exp string) error { diff --git a/Examples/go/enum/runme.go b/Examples/go/enum/runme.go index 99d2651f4..50887056e 100644 --- a/Examples/go/enum/runme.go +++ b/Examples/go/enum/runme.go @@ -1,8 +1,9 @@ package main import ( - . "./example" "fmt" + + . "example" ) func main() { diff --git a/Examples/go/extend/runme.go b/Examples/go/extend/runme.go index a56968937..af64a6e5d 100644 --- a/Examples/go/extend/runme.go +++ b/Examples/go/extend/runme.go @@ -3,8 +3,9 @@ package main import ( - . "./example" "fmt" + + . "example" ) func main() { diff --git a/Examples/go/funcptr/runme.go b/Examples/go/funcptr/runme.go index 44dae3c9e..4b20db4fb 100644 --- a/Examples/go/funcptr/runme.go +++ b/Examples/go/funcptr/runme.go @@ -1,8 +1,9 @@ package main import ( - . "./example" "fmt" + + . "example" ) func main() { diff --git a/Examples/go/multimap/runme.go b/Examples/go/multimap/runme.go index 390205a80..571fac7c2 100644 --- a/Examples/go/multimap/runme.go +++ b/Examples/go/multimap/runme.go @@ -1,8 +1,9 @@ package main import ( - . "./example" "fmt" + + . "example" ) func main() { diff --git a/Examples/go/pointer/runme.go b/Examples/go/pointer/runme.go index 1414d341e..0cf340f51 100644 --- a/Examples/go/pointer/runme.go +++ b/Examples/go/pointer/runme.go @@ -1,8 +1,9 @@ package main import ( - . "./example" "fmt" + + . "example" ) func main() { diff --git a/Examples/go/reference/runme.go b/Examples/go/reference/runme.go index 004a04c2e..9999733b3 100644 --- a/Examples/go/reference/runme.go +++ b/Examples/go/reference/runme.go @@ -3,8 +3,9 @@ package main import ( - . "./example" "fmt" + + . "example" ) func main() { diff --git a/Examples/go/simple/runme.go b/Examples/go/simple/runme.go index 9eb0ff454..0bd4657f9 100644 --- a/Examples/go/simple/runme.go +++ b/Examples/go/simple/runme.go @@ -1,8 +1,9 @@ package main import ( - "./example" "fmt" + + "example" ) func main() { diff --git a/Examples/go/template/runme.go b/Examples/go/template/runme.go index fca2f1b75..347795377 100644 --- a/Examples/go/template/runme.go +++ b/Examples/go/template/runme.go @@ -3,8 +3,9 @@ package main import ( - . "./example" "fmt" + + . "example" ) func main() { diff --git a/Examples/go/variables/runme.go b/Examples/go/variables/runme.go index 3d9737f5c..e2dd0c67f 100644 --- a/Examples/go/variables/runme.go +++ b/Examples/go/variables/runme.go @@ -3,8 +3,9 @@ package main import ( - "./example" "fmt" + + "example" ) func main() { diff --git a/Examples/test-suite/go/Makefile.in b/Examples/test-suite/go/Makefile.in index b7be554d7..d07a56bec 100644 --- a/Examples/test-suite/go/Makefile.in +++ b/Examples/test-suite/go/Makefile.in @@ -73,7 +73,18 @@ INCLUDES = -I$(abs_top_srcdir)/$(EXAMPLES)/$(TEST_SUITE) %.multicpptest: $(setup) - +$(swig_and_compile_multi_cpp) + mkdir -p gopath/$*/src 2>/dev/null || true + if ! test -d gopath/$*/src/swigtests; then \ + (cd gopath/$*/src && ln -s . swigtests); \ + fi + +for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \ + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \ + SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \ + LIBS='$(LIBS)' INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT)' NOLINK=true \ + TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR='$(INTERFACEDIR)' INTERFACE="$$f.i" \ + GOMOD="$*" \ + $(LANGUAGE)$(VARIANT)_cpp; \ + done $(run_multi_testcase) li_windows.cpptest: @@ -82,50 +93,55 @@ li_windows.cpptest: multi_import.multicpptest: $(setup) + mkdir -p gopath/multi_import/src 2>/dev/null || true + if ! test -d gopath/multi_import/src/swigtests; then \ + (cd gopath/multi_import/src && ln -s . swigtests); \ + fi for f in multi_import_b multi_import_a; do \ $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \ SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \ LIBS='$(LIBS)' INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT)' NOLINK=true \ TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR='$(INTERFACEDIR)' INTERFACE="$$f.i" \ + GOMOD="multi_import" \ $(LANGUAGE)$(VARIANT)_cpp; \ done $(run_multi_testcase) go_subdir_import.multicpptest: $(setup) - mkdir -p testdir/go_subdir_import/ - mkdir -p gopath/src/testdir/go_subdir_import/ + mkdir -p gopath/go_subdir_import/src 2>/dev/null || true + if ! test -d gopath/go_subdir_import/src/swigtests; then \ + (cd gopath/go_subdir_import/src && ln -s . swigtests); \ + fi + mkdir -p testdir/go_subdir_import 2>/dev/null || true + mkdir -p gopath/go_subdir_import/src/testdir/go_subdir_import 2>/dev/null || true $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \ SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \ LIBS='$(LIBS)' INTERFACEPATH='$(SRCDIR)$(INTERFACEDIR)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' \ + GOMOD="go_subdir_import" \ $(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_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \ LIBS='$(LIBS)' INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT)' NOLINK=true \ TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR='$(INTERFACEDIR)' INTERFACE="$$f.i" \ + GOMOD="go_subdir_import" \ $(LANGUAGE)$(VARIANT)_cpp; \ done - if $(GOGCC); then \ - cp gopath/src/testdir/go_subdir_import/go_subdir_import_b/go_subdir_import_b.a gopath/src/testdir/go_subdir_import/go_subdir_import_b.gox; \ - cp gopath/src/testdir/go_subdir_import/go_subdir_import_b/go_subdir_import_b.a .; \ - cp gopath/src/testdir/go_subdir_import/go_subdir_import_c/go_subdir_import_c.a gopath/src/testdir/go_subdir_import/go_subdir_import_c.gox; \ - cp gopath/src/testdir/go_subdir_import/go_subdir_import_c/go_subdir_import_c.a testdir/go_subdir_import/; \ - fi $(run_multi_testcase) # Runs the testcase. run_testcase = \ if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \ if $(GOGCC) ; then \ - $(COMPILETOOL) $(GCCGO) -c -g -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ - $(COMPILETOOL) $(GCCGO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ $*.a; \ + $(COMPILETOOL) $(GCCGO) -c -g -I gopath/src/$* $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ + $(COMPILETOOL) $(GCCGO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ gopath/src/$*/$*.a; \ elif $(GO12) || $(GO13) || $(GO15); then \ - $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ - $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld $(CC) -extldflags "$(CFLAGS) $(OSXOLDGOLINKFLAGS)" -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \ + $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I gopath/src/$* $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ + $(COMPILETOOL) $(GOTOOL) $(GOLD) -L gopath/src/$* -linkmode external -extld $(CC) -extldflags "$(CFLAGS) $(OSXOLDGOLINKFLAGS)" -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \ else \ $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ $(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \ @@ -136,11 +152,11 @@ run_testcase = \ run_testcase_cpp = \ if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \ if $(GOGCC) ; then \ - $(COMPILETOOL) $(GCCGO) -c -g -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ - $(COMPILETOOL) $(GCCGO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ $*.a -lstdc++; \ + $(COMPILETOOL) $(GCCGO) -c -g -I gopath/src/$* $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ + $(COMPILETOOL) $(GCCGO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ gopath/src/$*/$*.a -lstdc++; \ elif $(GO12) || $(GO13) || $(GO15); then \ - $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ - $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld $(CXX) -extldflags "$(CXXFLAGS) $(OSXOLDGOLINKFLAGS)" -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \ + $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I gopath/src/$* $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ + $(COMPILETOOL) $(GOTOOL) $(GOLD) -L gopath/src/$* -linkmode external -extld $(CXX) -extldflags "$(CXXFLAGS) $(OSXOLDGOLINKFLAGS)" -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \ else \ $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ $(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \ @@ -150,18 +166,24 @@ run_testcase_cpp = \ run_multi_testcase = \ if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \ - if $(GOGCC) ; then \ - $(COMPILETOOL) $(GCCGO) -c -g -I . -I gopath/src $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ + if $(GO15) || $(GOGCC); then \ files=`cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list`; \ - $(COMPILETOOL) $(GCCGO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ `for f in $$files; do echo $$f.a; done` -lstdc++; \ - elif $(GO12) || $(GO13) || $(GO15); then \ - $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ - $(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -linkmode external -extld $(CXX) -extldflags "$(CXXFLAGS) $(OSXOLDGOLINKFLAGS)" -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \ - else \ - $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ - $(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \ - fi && \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) ./$*_runme; \ + mkdir gopath/$*/src/$* 2>/dev/null || true; \ + cp $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) gopath/$*/src/$*; \ + GOPATH="`pwd`/gopath/$*"; \ + export GOPATH; \ + CGO_CPPFLAGS="$(CPPFLAGS) $(INCLUDES) `for f in $$files; do echo -I ../$$f; done`"; \ + export CGO_CPPFLAGS; \ + CGO_CFLAGS="$(CFLAGS)"; \ + export CGO_CFLAGS; \ + CGO_CXXFLAGS="$(CXXFLAGS)"; \ + export CGO_CXXFLAGS; \ + CGO_LDFLAGS="$(LDFLAGS) -lm"; \ + export CGO_LDFLAGS; \ + (cd gopath/$*/src/$* && \ + $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o ../../../../$*_runme) && \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) ./$*_runme; \ + fi; \ fi %.clean: diff --git a/Examples/test-suite/go/abstract_access_runme.go b/Examples/test-suite/go/abstract_access_runme.go index a2cfeda92..5102236f9 100644 --- a/Examples/test-suite/go/abstract_access_runme.go +++ b/Examples/test-suite/go/abstract_access_runme.go @@ -1,6 +1,6 @@ package main -import "./abstract_access" +import "abstract_access" func main() { d := abstract_access.NewD() diff --git a/Examples/test-suite/go/abstract_typedef2_runme.go b/Examples/test-suite/go/abstract_typedef2_runme.go index ef760e45d..76a5fc8de 100644 --- a/Examples/test-suite/go/abstract_typedef2_runme.go +++ b/Examples/test-suite/go/abstract_typedef2_runme.go @@ -1,6 +1,6 @@ package main -import "./abstract_typedef2" +import "abstract_typedef2" func main() { abstract_typedef2.NewA_UF() diff --git a/Examples/test-suite/go/abstract_typedef_runme.go b/Examples/test-suite/go/abstract_typedef_runme.go index 99ff94ded..56aaa613f 100644 --- a/Examples/test-suite/go/abstract_typedef_runme.go +++ b/Examples/test-suite/go/abstract_typedef_runme.go @@ -1,6 +1,6 @@ package main -import "./abstract_typedef" +import "abstract_typedef" func main() { e := abstract_typedef.NewEngine() diff --git a/Examples/test-suite/go/abstract_virtual_runme.go b/Examples/test-suite/go/abstract_virtual_runme.go index b87cf9b5c..e19eac27d 100644 --- a/Examples/test-suite/go/abstract_virtual_runme.go +++ b/Examples/test-suite/go/abstract_virtual_runme.go @@ -1,6 +1,6 @@ package main -import "./abstract_virtual" +import "abstract_virtual" func main() { abstract_virtual.NewD() diff --git a/Examples/test-suite/go/argout_runme.go b/Examples/test-suite/go/argout_runme.go index 5f7017e73..bb8ab9ed2 100644 --- a/Examples/test-suite/go/argout_runme.go +++ b/Examples/test-suite/go/argout_runme.go @@ -1,6 +1,6 @@ package main -import wrap "./argout" +import wrap "argout" func main() { ip := wrap.New_intp() diff --git a/Examples/test-suite/go/array_member_runme.go b/Examples/test-suite/go/array_member_runme.go index d8a8fac2b..4f029db98 100644 --- a/Examples/test-suite/go/array_member_runme.go +++ b/Examples/test-suite/go/array_member_runme.go @@ -1,6 +1,6 @@ package main -import . "./array_member" +import . "array_member" func main() { f := NewFoo() diff --git a/Examples/test-suite/go/arrays_global_runme.go b/Examples/test-suite/go/arrays_global_runme.go index 0ff40090c..35b049d9a 100644 --- a/Examples/test-suite/go/arrays_global_runme.go +++ b/Examples/test-suite/go/arrays_global_runme.go @@ -1,6 +1,6 @@ package main -import . "./arrays_global" +import . "arrays_global" func main() { SetArray_i(GetArray_const_i()) diff --git a/Examples/test-suite/go/char_binary_runme.go b/Examples/test-suite/go/char_binary_runme.go index 50f2e121d..d47d616af 100644 --- a/Examples/test-suite/go/char_binary_runme.go +++ b/Examples/test-suite/go/char_binary_runme.go @@ -1,6 +1,6 @@ package main -import . "./char_binary" +import . "char_binary" func main() { t := NewTest() diff --git a/Examples/test-suite/go/class_ignore_runme.go b/Examples/test-suite/go/class_ignore_runme.go index 82e52eff5..24261c637 100644 --- a/Examples/test-suite/go/class_ignore_runme.go +++ b/Examples/test-suite/go/class_ignore_runme.go @@ -1,6 +1,6 @@ package main -import "./class_ignore" +import "class_ignore" func main() { a := class_ignore.NewBar() diff --git a/Examples/test-suite/go/class_scope_weird_runme.go b/Examples/test-suite/go/class_scope_weird_runme.go index 332586f31..a42bdad21 100644 --- a/Examples/test-suite/go/class_scope_weird_runme.go +++ b/Examples/test-suite/go/class_scope_weird_runme.go @@ -1,6 +1,6 @@ package main -import "./class_scope_weird" +import "class_scope_weird" func main() { f := class_scope_weird.NewFoo() diff --git a/Examples/test-suite/go/compactdefaultargs_runme.go b/Examples/test-suite/go/compactdefaultargs_runme.go index 46f3ff3f9..fe6224ca2 100644 --- a/Examples/test-suite/go/compactdefaultargs_runme.go +++ b/Examples/test-suite/go/compactdefaultargs_runme.go @@ -1,6 +1,6 @@ package main -import . "./compactdefaultargs" +import . "compactdefaultargs" func main() { defaults1 := NewDefaults1(1000) diff --git a/Examples/test-suite/go/constover_runme.go b/Examples/test-suite/go/constover_runme.go index f961e01b5..6c837095a 100644 --- a/Examples/test-suite/go/constover_runme.go +++ b/Examples/test-suite/go/constover_runme.go @@ -1,9 +1,10 @@ package main import ( - "./constover" "fmt" "os" + + "constover" ) func main() { diff --git a/Examples/test-suite/go/constructor_copy_runme.go b/Examples/test-suite/go/constructor_copy_runme.go index d9b77a9db..68c428853 100644 --- a/Examples/test-suite/go/constructor_copy_runme.go +++ b/Examples/test-suite/go/constructor_copy_runme.go @@ -1,6 +1,6 @@ package main -import . "./constructor_copy" +import . "constructor_copy" func main() { f1 := NewFoo1(3) diff --git a/Examples/test-suite/go/contract_runme.go b/Examples/test-suite/go/contract_runme.go index b20a1a64f..b028855c3 100644 --- a/Examples/test-suite/go/contract_runme.go +++ b/Examples/test-suite/go/contract_runme.go @@ -1,6 +1,6 @@ package main -import "./contract" +import "contract" func main() { contract.Test_preassert(1, 2) diff --git a/Examples/test-suite/go/cpp11_strongly_typed_enumerations_runme.go b/Examples/test-suite/go/cpp11_strongly_typed_enumerations_runme.go index f4b84b1ee..f9ca74a1e 100644 --- a/Examples/test-suite/go/cpp11_strongly_typed_enumerations_runme.go +++ b/Examples/test-suite/go/cpp11_strongly_typed_enumerations_runme.go @@ -1,7 +1,7 @@ package main import "fmt" -import . "./cpp11_strongly_typed_enumerations" +import . "cpp11_strongly_typed_enumerations" func enumCheck(actual int, expected int) int { if actual != expected { diff --git a/Examples/test-suite/go/cpp_enum_runme.go b/Examples/test-suite/go/cpp_enum_runme.go index 7d7db953d..8906dd4f1 100644 --- a/Examples/test-suite/go/cpp_enum_runme.go +++ b/Examples/test-suite/go/cpp_enum_runme.go @@ -1,6 +1,6 @@ package main -import "./cpp_enum" +import "cpp_enum" func main() { f := cpp_enum.NewFoo() diff --git a/Examples/test-suite/go/cpp_namespace_runme.go b/Examples/test-suite/go/cpp_namespace_runme.go index 8482b043f..aecdd9543 100644 --- a/Examples/test-suite/go/cpp_namespace_runme.go +++ b/Examples/test-suite/go/cpp_namespace_runme.go @@ -1,7 +1,7 @@ // Note: This example assumes that namespaces are flattened package main -import "./cpp_namespace" +import "cpp_namespace" func main() { n := cpp_namespace.Fact(4) diff --git a/Examples/test-suite/go/cpp_static_runme.go b/Examples/test-suite/go/cpp_static_runme.go index ead433466..1ad981a60 100644 --- a/Examples/test-suite/go/cpp_static_runme.go +++ b/Examples/test-suite/go/cpp_static_runme.go @@ -1,6 +1,6 @@ package main -import . "./cpp_static" +import . "cpp_static" func main() { StaticFunctionTestStatic_func() diff --git a/Examples/test-suite/go/default_args_runme.go b/Examples/test-suite/go/default_args_runme.go index 38243ac44..a39f95716 100644 --- a/Examples/test-suite/go/default_args_runme.go +++ b/Examples/test-suite/go/default_args_runme.go @@ -1,6 +1,6 @@ package main -import "./default_args" +import "default_args" func main() { if default_args.StaticsStaticmethod() != 60 { diff --git a/Examples/test-suite/go/default_constructor_runme.go b/Examples/test-suite/go/default_constructor_runme.go index 40a5a6e49..eeac7eaf8 100644 --- a/Examples/test-suite/go/default_constructor_runme.go +++ b/Examples/test-suite/go/default_constructor_runme.go @@ -1,6 +1,6 @@ package main -import dc "./default_constructor" +import dc "default_constructor" func main() { a := dc.NewA() diff --git a/Examples/test-suite/go/director_alternating_runme.go b/Examples/test-suite/go/director_alternating_runme.go index 10f6774a3..b4793aa8f 100644 --- a/Examples/test-suite/go/director_alternating_runme.go +++ b/Examples/test-suite/go/director_alternating_runme.go @@ -1,6 +1,6 @@ package main -import . "./director_alternating" +import . "director_alternating" func main() { id := GetBar().Id() diff --git a/Examples/test-suite/go/director_basic_runme.go b/Examples/test-suite/go/director_basic_runme.go index 0ce780bbd..360424d9b 100644 --- a/Examples/test-suite/go/director_basic_runme.go +++ b/Examples/test-suite/go/director_basic_runme.go @@ -1,6 +1,6 @@ package main -import "./director_basic" +import "director_basic" type GoFoo struct{} diff --git a/Examples/test-suite/go/director_classic_runme.go b/Examples/test-suite/go/director_classic_runme.go index 45e89eac5..230c9638d 100644 --- a/Examples/test-suite/go/director_classic_runme.go +++ b/Examples/test-suite/go/director_classic_runme.go @@ -1,7 +1,7 @@ package main import "fmt" -import . "./director_classic" +import . "director_classic" type TargetLangPerson struct{} // From Person func (p *TargetLangPerson) Id() string { diff --git a/Examples/test-suite/go/director_default_runme.go b/Examples/test-suite/go/director_default_runme.go index 2f963b239..ac2aace1d 100644 --- a/Examples/test-suite/go/director_default_runme.go +++ b/Examples/test-suite/go/director_default_runme.go @@ -1,6 +1,6 @@ package main -import . "./director_default" +import . "director_default" func main() { NewFoo() diff --git a/Examples/test-suite/go/director_detect_runme.go b/Examples/test-suite/go/director_detect_runme.go index 9f1ad94a9..0c3c95fdc 100644 --- a/Examples/test-suite/go/director_detect_runme.go +++ b/Examples/test-suite/go/director_detect_runme.go @@ -1,6 +1,6 @@ package main -import "./director_detect" +import "director_detect" type MyBar struct { val int diff --git a/Examples/test-suite/go/director_enum_runme.go b/Examples/test-suite/go/director_enum_runme.go index 5653fda40..002d425d2 100644 --- a/Examples/test-suite/go/director_enum_runme.go +++ b/Examples/test-suite/go/director_enum_runme.go @@ -1,6 +1,6 @@ package main -import "./director_enum" +import "director_enum" type MyFoo struct{} // From director_enum.Foo func (p *MyFoo) Say_hi(val director_enum.EnumDirectorHello) director_enum.EnumDirectorHello { diff --git a/Examples/test-suite/go/director_exception_runme.go b/Examples/test-suite/go/director_exception_runme.go index 29df3e40b..55231ff16 100644 --- a/Examples/test-suite/go/director_exception_runme.go +++ b/Examples/test-suite/go/director_exception_runme.go @@ -1,6 +1,6 @@ package main -import . "./director_exception" +import . "director_exception" type Exception struct { msg string diff --git a/Examples/test-suite/go/director_extend_runme.go b/Examples/test-suite/go/director_extend_runme.go index 70e2ab41b..27e55b997 100644 --- a/Examples/test-suite/go/director_extend_runme.go +++ b/Examples/test-suite/go/director_extend_runme.go @@ -5,7 +5,7 @@ package main -import . "./director_extend" +import . "director_extend" func main() { m := NewSpObject() diff --git a/Examples/test-suite/go/director_finalizer_runme.go b/Examples/test-suite/go/director_finalizer_runme.go index 96fcf860e..d36a4ba33 100644 --- a/Examples/test-suite/go/director_finalizer_runme.go +++ b/Examples/test-suite/go/director_finalizer_runme.go @@ -1,6 +1,6 @@ package main -import . "./director_finalizer" +import . "director_finalizer" type MyFoo struct{} // From Foo func DeleteMyFoo(p Foo) { diff --git a/Examples/test-suite/go/director_frob_runme.go b/Examples/test-suite/go/director_frob_runme.go index a6afedf69..3985eb14b 100644 --- a/Examples/test-suite/go/director_frob_runme.go +++ b/Examples/test-suite/go/director_frob_runme.go @@ -1,6 +1,6 @@ package main -import . "./director_frob" +import . "director_frob" func main() { foo := NewBravo() diff --git a/Examples/test-suite/go/director_nested_runme.go b/Examples/test-suite/go/director_nested_runme.go index 2d3bc77e1..a1193ad59 100644 --- a/Examples/test-suite/go/director_nested_runme.go +++ b/Examples/test-suite/go/director_nested_runme.go @@ -1,6 +1,6 @@ package main -import . "./director_nested" +import . "director_nested" type A struct{} // From FooBar_int func (p *A) Do_step() string { diff --git a/Examples/test-suite/go/director_profile_runme.go b/Examples/test-suite/go/director_profile_runme.go index 87edcbe26..a9bc7934b 100644 --- a/Examples/test-suite/go/director_profile_runme.go +++ b/Examples/test-suite/go/director_profile_runme.go @@ -1,7 +1,7 @@ package main import "fmt" -import "./director_profile" +import "director_profile" type MyB struct{} // From director_profile.B func (p *MyB) Vfi(a int) int { diff --git a/Examples/test-suite/go/director_protected_runme.go b/Examples/test-suite/go/director_protected_runme.go index 24adfe7bd..bfd50c6b2 100644 --- a/Examples/test-suite/go/director_protected_runme.go +++ b/Examples/test-suite/go/director_protected_runme.go @@ -1,6 +1,6 @@ package main -import . "./director_protected" +import . "director_protected" type FooBar struct{} // From Bar func (p *FooBar) Ping() string { diff --git a/Examples/test-suite/go/director_string_runme.go b/Examples/test-suite/go/director_string_runme.go index c5201ab96..f4f9cc150 100644 --- a/Examples/test-suite/go/director_string_runme.go +++ b/Examples/test-suite/go/director_string_runme.go @@ -1,6 +1,6 @@ package main -import . "./director_string" +import . "director_string" type B struct { // From A abi A diff --git a/Examples/test-suite/go/director_unroll_runme.go b/Examples/test-suite/go/director_unroll_runme.go index 6d2894a72..6a919f656 100644 --- a/Examples/test-suite/go/director_unroll_runme.go +++ b/Examples/test-suite/go/director_unroll_runme.go @@ -1,6 +1,6 @@ package main -import "./director_unroll" +import "director_unroll" type MyFoo struct{} // From director_unroll.Foo func (p *MyFoo) Ping() string { diff --git a/Examples/test-suite/go/disown_runme.go b/Examples/test-suite/go/disown_runme.go index 3e853de59..4484515fd 100644 --- a/Examples/test-suite/go/disown_runme.go +++ b/Examples/test-suite/go/disown_runme.go @@ -1,6 +1,6 @@ package main -import . "./disown" +import . "disown" func main() { a := NewA() diff --git a/Examples/test-suite/go/dynamic_cast_runme.go b/Examples/test-suite/go/dynamic_cast_runme.go index 476734805..46ba23698 100644 --- a/Examples/test-suite/go/dynamic_cast_runme.go +++ b/Examples/test-suite/go/dynamic_cast_runme.go @@ -1,6 +1,6 @@ package main -import "./dynamic_cast" +import "dynamic_cast" func main() { f := dynamic_cast.NewFoo() diff --git a/Examples/test-suite/go/empty_c_runme.go b/Examples/test-suite/go/empty_c_runme.go index 831a56118..1a1bd9cc5 100644 --- a/Examples/test-suite/go/empty_c_runme.go +++ b/Examples/test-suite/go/empty_c_runme.go @@ -1,6 +1,6 @@ package main -import _ "./empty_c" +import _ "empty_c" func main() { } diff --git a/Examples/test-suite/go/empty_runme.go b/Examples/test-suite/go/empty_runme.go index f74285cb0..681a6f3ad 100644 --- a/Examples/test-suite/go/empty_runme.go +++ b/Examples/test-suite/go/empty_runme.go @@ -1,6 +1,6 @@ package main -import _ "./empty" +import _ "empty" func main() { } diff --git a/Examples/test-suite/go/enum_template_runme.go b/Examples/test-suite/go/enum_template_runme.go index 269fe7d5b..c60a452d7 100644 --- a/Examples/test-suite/go/enum_template_runme.go +++ b/Examples/test-suite/go/enum_template_runme.go @@ -1,6 +1,6 @@ package main -import "./enum_template" +import "enum_template" func main() { if enum_template.MakeETest() != 1 { diff --git a/Examples/test-suite/go/enums_runme.go b/Examples/test-suite/go/enums_runme.go index ab193f74b..7a528b3e2 100644 --- a/Examples/test-suite/go/enums_runme.go +++ b/Examples/test-suite/go/enums_runme.go @@ -1,6 +1,6 @@ package main -import "./enums" +import "enums" func main() { enums.Bar2(1) diff --git a/Examples/test-suite/go/exception_order_runme.go b/Examples/test-suite/go/exception_order_runme.go index 626a826f8..21dcff312 100644 --- a/Examples/test-suite/go/exception_order_runme.go +++ b/Examples/test-suite/go/exception_order_runme.go @@ -1,7 +1,7 @@ package main import "strings" -import . "./exception_order" +import . "exception_order" func main() { a := NewA() diff --git a/Examples/test-suite/go/extend_placement_runme.go b/Examples/test-suite/go/extend_placement_runme.go index efa776e31..253ec6618 100644 --- a/Examples/test-suite/go/extend_placement_runme.go +++ b/Examples/test-suite/go/extend_placement_runme.go @@ -1,6 +1,6 @@ package main -import "./extend_placement" +import "extend_placement" func main() { foo := extend_placement.NewFoo() diff --git a/Examples/test-suite/go/extend_template_ns_runme.go b/Examples/test-suite/go/extend_template_ns_runme.go index 164a31b26..d005172a4 100644 --- a/Examples/test-suite/go/extend_template_ns_runme.go +++ b/Examples/test-suite/go/extend_template_ns_runme.go @@ -1,6 +1,6 @@ package main -import . "./extend_template_ns" +import . "extend_template_ns" func main() { f := NewFoo_One() diff --git a/Examples/test-suite/go/extend_template_runme.go b/Examples/test-suite/go/extend_template_runme.go index 5adb4b3c2..a5c4da4e1 100644 --- a/Examples/test-suite/go/extend_template_runme.go +++ b/Examples/test-suite/go/extend_template_runme.go @@ -1,6 +1,6 @@ package main -import "./extend_template" +import "extend_template" func main() { f := extend_template.NewFoo_0() diff --git a/Examples/test-suite/go/extend_variable_runme.go b/Examples/test-suite/go/extend_variable_runme.go index c6428c467..9425aee4d 100644 --- a/Examples/test-suite/go/extend_variable_runme.go +++ b/Examples/test-suite/go/extend_variable_runme.go @@ -1,6 +1,6 @@ package main -import . "./extend_variable" +import . "extend_variable" func main() { if FooBar != 42 { diff --git a/Examples/test-suite/go/extern_c_runme.go b/Examples/test-suite/go/extern_c_runme.go index 0fb5b21cc..9bc2cd0cc 100644 --- a/Examples/test-suite/go/extern_c_runme.go +++ b/Examples/test-suite/go/extern_c_runme.go @@ -1,6 +1,6 @@ package main -import "./extern_c" +import "extern_c" func main() { extern_c.RealFunction(2) diff --git a/Examples/test-suite/go/friends_runme.go b/Examples/test-suite/go/friends_runme.go index 9f223fcac..2e34a4db0 100644 --- a/Examples/test-suite/go/friends_runme.go +++ b/Examples/test-suite/go/friends_runme.go @@ -1,6 +1,6 @@ package main -import "./friends" +import "friends" func main() { a := friends.NewA(2) diff --git a/Examples/test-suite/go/fvirtual_runme.go b/Examples/test-suite/go/fvirtual_runme.go index 8810d5cbb..86ef90f18 100644 --- a/Examples/test-suite/go/fvirtual_runme.go +++ b/Examples/test-suite/go/fvirtual_runme.go @@ -1,6 +1,6 @@ package main -import . "./fvirtual" +import . "fvirtual" func main() { sw := NewNodeSwitch() diff --git a/Examples/test-suite/go/global_ns_arg_runme.go b/Examples/test-suite/go/global_ns_arg_runme.go index ece779c9c..e86aa6747 100644 --- a/Examples/test-suite/go/global_ns_arg_runme.go +++ b/Examples/test-suite/go/global_ns_arg_runme.go @@ -1,6 +1,6 @@ package main -import . "./global_ns_arg" +import . "global_ns_arg" func main() { Foo(1) diff --git a/Examples/test-suite/go/go_director_inout_runme.go b/Examples/test-suite/go/go_director_inout_runme.go index 9b9df318e..e6768a465 100644 --- a/Examples/test-suite/go/go_director_inout_runme.go +++ b/Examples/test-suite/go/go_director_inout_runme.go @@ -1,7 +1,7 @@ package main import ( - wrap "./go_director_inout" + wrap "go_director_inout" ) type GoMyClass struct {} diff --git a/Examples/test-suite/go/go_inout_runme.go b/Examples/test-suite/go/go_inout_runme.go index 9aa0cd0c5..4599aa104 100644 --- a/Examples/test-suite/go/go_inout_runme.go +++ b/Examples/test-suite/go/go_inout_runme.go @@ -5,7 +5,7 @@ import ( "fmt" "reflect" - "./go_inout" + "go_inout" ) type S struct { diff --git a/Examples/test-suite/go/go_subdir_import_runme.go b/Examples/test-suite/go/go_subdir_import_runme.go index f90a6eb54..a040c993f 100644 --- a/Examples/test-suite/go/go_subdir_import_runme.go +++ b/Examples/test-suite/go/go_subdir_import_runme.go @@ -1,9 +1,9 @@ package main import ( - "go_subdir_import_a" - "testdir/go_subdir_import/go_subdir_import_b" - "testdir/go_subdir_import/go_subdir_import_c" + "swigtests/go_subdir_import_a" + "swigtests/testdir/go_subdir_import/go_subdir_import_b" + "swigtests/testdir/go_subdir_import/go_subdir_import_c" ) func main() { diff --git a/Examples/test-suite/go/grouping_runme.go b/Examples/test-suite/go/grouping_runme.go index c63d6fb12..f808e1286 100644 --- a/Examples/test-suite/go/grouping_runme.go +++ b/Examples/test-suite/go/grouping_runme.go @@ -1,6 +1,6 @@ package main -import "./grouping" +import "grouping" func main() { x := grouping.Test1(42) diff --git a/Examples/test-suite/go/import_nomodule_runme.go b/Examples/test-suite/go/import_nomodule_runme.go index a6bbd7de5..48592df25 100644 --- a/Examples/test-suite/go/import_nomodule_runme.go +++ b/Examples/test-suite/go/import_nomodule_runme.go @@ -1,6 +1,6 @@ package main -import . "./import_nomodule" +import . "import_nomodule" func main() { f := Create_Foo() diff --git a/Examples/test-suite/go/imports_runme.go b/Examples/test-suite/go/imports_runme.go index 896036cbf..a67ae407b 100644 --- a/Examples/test-suite/go/imports_runme.go +++ b/Examples/test-suite/go/imports_runme.go @@ -2,8 +2,8 @@ package main -import "imports_b" -import "imports_a" +import "swigtests/imports_b" +import "swigtests/imports_a" func main() { x := imports_b.NewB() diff --git a/Examples/test-suite/go/inctest_runme.go b/Examples/test-suite/go/inctest_runme.go index f8a2c116c..3148abcd2 100644 --- a/Examples/test-suite/go/inctest_runme.go +++ b/Examples/test-suite/go/inctest_runme.go @@ -1,6 +1,6 @@ package main -import "./inctest" +import "inctest" func main() { inctest.NewA() diff --git a/Examples/test-suite/go/inherit_member_runme.go b/Examples/test-suite/go/inherit_member_runme.go index 599a0eb56..6fd70cf80 100644 --- a/Examples/test-suite/go/inherit_member_runme.go +++ b/Examples/test-suite/go/inherit_member_runme.go @@ -1,6 +1,6 @@ package main -import wrap "./inherit_member" +import wrap "inherit_member" func main() { s := wrap.NewChild() diff --git a/Examples/test-suite/go/inherit_missing_runme.go b/Examples/test-suite/go/inherit_missing_runme.go index ba9a2a516..c70c48306 100644 --- a/Examples/test-suite/go/inherit_missing_runme.go +++ b/Examples/test-suite/go/inherit_missing_runme.go @@ -1,6 +1,6 @@ package main -import "./inherit_missing" +import "inherit_missing" func main() { a := inherit_missing.New_Foo() diff --git a/Examples/test-suite/go/input_runme.go b/Examples/test-suite/go/input_runme.go index 207bdaa28..ddc2992fe 100644 --- a/Examples/test-suite/go/input_runme.go +++ b/Examples/test-suite/go/input_runme.go @@ -1,6 +1,6 @@ package main -import . "./input" +import . "input" func main() { f := NewFoo() diff --git a/Examples/test-suite/go/keyword_rename_c_runme.go b/Examples/test-suite/go/keyword_rename_c_runme.go index 425e38a26..26f2ea42b 100644 --- a/Examples/test-suite/go/keyword_rename_c_runme.go +++ b/Examples/test-suite/go/keyword_rename_c_runme.go @@ -1,6 +1,6 @@ package main -import "./keyword_rename_c" +import "keyword_rename_c" func main() { keyword_rename_c.Xgo(1) diff --git a/Examples/test-suite/go/keyword_rename_runme.go b/Examples/test-suite/go/keyword_rename_runme.go index e36bc5968..7a40ff83d 100644 --- a/Examples/test-suite/go/keyword_rename_runme.go +++ b/Examples/test-suite/go/keyword_rename_runme.go @@ -1,6 +1,6 @@ package main -import "./keyword_rename" +import "keyword_rename" func main() { keyword_rename.Xgo(1) diff --git a/Examples/test-suite/go/li_attribute_runme.go b/Examples/test-suite/go/li_attribute_runme.go index 5d2c3d0c3..b502b8cea 100644 --- a/Examples/test-suite/go/li_attribute_runme.go +++ b/Examples/test-suite/go/li_attribute_runme.go @@ -1,6 +1,6 @@ package main -import "./li_attribute" +import "li_attribute" func main() { aa := li_attribute.NewA(1, 2, 3) diff --git a/Examples/test-suite/go/li_carrays_cpp_runme.go b/Examples/test-suite/go/li_carrays_cpp_runme.go index 7ee0a4103..cfc171284 100644 --- a/Examples/test-suite/go/li_carrays_cpp_runme.go +++ b/Examples/test-suite/go/li_carrays_cpp_runme.go @@ -1,6 +1,6 @@ package main -import . "./li_carrays_cpp" +import . "li_carrays_cpp" func main() { d := NewDoubleArray(10) diff --git a/Examples/test-suite/go/li_carrays_runme.go b/Examples/test-suite/go/li_carrays_runme.go index 0cbe92cd8..9128bbfd1 100644 --- a/Examples/test-suite/go/li_carrays_runme.go +++ b/Examples/test-suite/go/li_carrays_runme.go @@ -1,6 +1,6 @@ package main -import . "./li_carrays" +import . "li_carrays" func main() { d := NewDoubleArray(10) diff --git a/Examples/test-suite/go/li_cdata_cpp_runme.go b/Examples/test-suite/go/li_cdata_cpp_runme.go index 42a0ebd08..daa5384f7 100644 --- a/Examples/test-suite/go/li_cdata_cpp_runme.go +++ b/Examples/test-suite/go/li_cdata_cpp_runme.go @@ -1,6 +1,6 @@ package main -import . "./li_cdata_cpp" +import . "li_cdata_cpp" func main() { s := "ABC abc" diff --git a/Examples/test-suite/go/li_cdata_runme.go b/Examples/test-suite/go/li_cdata_runme.go index f71a3a2c3..9458dab43 100644 --- a/Examples/test-suite/go/li_cdata_runme.go +++ b/Examples/test-suite/go/li_cdata_runme.go @@ -1,6 +1,6 @@ package main -import . "./li_cdata" +import . "li_cdata" func main() { s := "ABC abc" diff --git a/Examples/test-suite/go/li_cmalloc_runme.go b/Examples/test-suite/go/li_cmalloc_runme.go index 45f47b45f..5b9f9704a 100644 --- a/Examples/test-suite/go/li_cmalloc_runme.go +++ b/Examples/test-suite/go/li_cmalloc_runme.go @@ -1,6 +1,6 @@ package main -import . "./li_cmalloc" +import . "li_cmalloc" func main() { p := Malloc_int() diff --git a/Examples/test-suite/go/li_cpointer_cpp_runme.go b/Examples/test-suite/go/li_cpointer_cpp_runme.go index e2f5a59d1..0de57c624 100644 --- a/Examples/test-suite/go/li_cpointer_cpp_runme.go +++ b/Examples/test-suite/go/li_cpointer_cpp_runme.go @@ -1,6 +1,6 @@ package main -import . "./li_cpointer_cpp" +import . "li_cpointer_cpp" func main() { p := New_intp() diff --git a/Examples/test-suite/go/li_cpointer_runme.go b/Examples/test-suite/go/li_cpointer_runme.go index 57493b122..0fe29e77d 100644 --- a/Examples/test-suite/go/li_cpointer_runme.go +++ b/Examples/test-suite/go/li_cpointer_runme.go @@ -1,6 +1,6 @@ package main -import . "./li_cpointer" +import . "li_cpointer" func main() { p := New_intp() diff --git a/Examples/test-suite/go/li_std_map_runme.go b/Examples/test-suite/go/li_std_map_runme.go index 66e74dd60..5c5cc2e4c 100644 --- a/Examples/test-suite/go/li_std_map_runme.go +++ b/Examples/test-suite/go/li_std_map_runme.go @@ -1,6 +1,6 @@ package main -import "./li_std_map" +import "li_std_map" func main() { a1 := li_std_map.NewA(3) diff --git a/Examples/test-suite/go/li_std_vector_ptr_runme.go b/Examples/test-suite/go/li_std_vector_ptr_runme.go index a9f7fe91c..d66ff19c6 100644 --- a/Examples/test-suite/go/li_std_vector_ptr_runme.go +++ b/Examples/test-suite/go/li_std_vector_ptr_runme.go @@ -1,6 +1,6 @@ package main -import . "./li_std_vector_ptr" +import . "li_std_vector_ptr" import "fmt" func check(val1 int, val2 int) { diff --git a/Examples/test-suite/go/member_pointer_runme.go b/Examples/test-suite/go/member_pointer_runme.go index 9a55bc4b9..731526b75 100644 --- a/Examples/test-suite/go/member_pointer_runme.go +++ b/Examples/test-suite/go/member_pointer_runme.go @@ -3,7 +3,7 @@ package main import "fmt" -import . "./member_pointer" +import . "member_pointer" func check(what string, expected float64, actual float64) { if expected != actual { diff --git a/Examples/test-suite/go/memberin_extend_c_runme.go b/Examples/test-suite/go/memberin_extend_c_runme.go index ec8b11e60..0551acc90 100644 --- a/Examples/test-suite/go/memberin_extend_c_runme.go +++ b/Examples/test-suite/go/memberin_extend_c_runme.go @@ -1,6 +1,6 @@ package main -import "./memberin_extend_c" +import "memberin_extend_c" func main() { t := memberin_extend_c.NewPerson() diff --git a/Examples/test-suite/go/minherit_runme.go b/Examples/test-suite/go/minherit_runme.go index c69fe92c1..9b7873cb0 100644 --- a/Examples/test-suite/go/minherit_runme.go +++ b/Examples/test-suite/go/minherit_runme.go @@ -1,7 +1,7 @@ package main import "fmt" -import "./minherit" +import "minherit" func main() { a := minherit.NewFoo() diff --git a/Examples/test-suite/go/mod_runme.go b/Examples/test-suite/go/mod_runme.go index 581c83918..8d894db8d 100644 --- a/Examples/test-suite/go/mod_runme.go +++ b/Examples/test-suite/go/mod_runme.go @@ -1,7 +1,7 @@ package main -import "mod_a" -import "mod_b" +import "swigtests/mod_a" +import "swigtests/mod_b" func main() { c := mod_b.NewC() diff --git a/Examples/test-suite/go/multi_import_runme.go b/Examples/test-suite/go/multi_import_runme.go index 973af1e7b..f30913c6d 100644 --- a/Examples/test-suite/go/multi_import_runme.go +++ b/Examples/test-suite/go/multi_import_runme.go @@ -1,7 +1,7 @@ package main -import "multi_import_a" -import "multi_import_b" +import "swigtests/multi_import_a" +import "swigtests/multi_import_b" func main() { x := multi_import_b.NewXXX() diff --git a/Examples/test-suite/go/namespace_class_runme.go b/Examples/test-suite/go/namespace_class_runme.go index 2ed5567f7..4c240b6a4 100644 --- a/Examples/test-suite/go/namespace_class_runme.go +++ b/Examples/test-suite/go/namespace_class_runme.go @@ -1,6 +1,6 @@ package main -import . "./namespace_class" +import . "namespace_class" func main() { EulerT3DToFrame(1, 1, 1) diff --git a/Examples/test-suite/go/namespace_typemap_runme.go b/Examples/test-suite/go/namespace_typemap_runme.go index 056da1567..47e2b64f1 100644 --- a/Examples/test-suite/go/namespace_typemap_runme.go +++ b/Examples/test-suite/go/namespace_typemap_runme.go @@ -1,6 +1,6 @@ package main -import . "./namespace_typemap" +import . "namespace_typemap" func main() { if Stest1("hello") != "hello" { diff --git a/Examples/test-suite/go/namespace_virtual_method_runme.go b/Examples/test-suite/go/namespace_virtual_method_runme.go index 3f8e774c6..a8cb38bad 100644 --- a/Examples/test-suite/go/namespace_virtual_method_runme.go +++ b/Examples/test-suite/go/namespace_virtual_method_runme.go @@ -1,6 +1,6 @@ package main -import "./namespace_virtual_method" +import "namespace_virtual_method" func main() { _ = namespace_virtual_method.NewSpam() diff --git a/Examples/test-suite/go/naturalvar_runme.go b/Examples/test-suite/go/naturalvar_runme.go index e3723e6ab..ed47e9d2d 100644 --- a/Examples/test-suite/go/naturalvar_runme.go +++ b/Examples/test-suite/go/naturalvar_runme.go @@ -1,6 +1,6 @@ package main -import . "./naturalvar" +import . "naturalvar" func main() { f := NewFoo() diff --git a/Examples/test-suite/go/nested_workaround_runme.go b/Examples/test-suite/go/nested_workaround_runme.go index 5737aaaf7..8b31a7f4b 100644 --- a/Examples/test-suite/go/nested_workaround_runme.go +++ b/Examples/test-suite/go/nested_workaround_runme.go @@ -1,6 +1,6 @@ package main -import . "./nested_workaround" +import . "nested_workaround" func main() { inner := NewInner(5) diff --git a/Examples/test-suite/go/overload_complicated_runme.go b/Examples/test-suite/go/overload_complicated_runme.go index e3911c218..ce9d124c8 100644 --- a/Examples/test-suite/go/overload_complicated_runme.go +++ b/Examples/test-suite/go/overload_complicated_runme.go @@ -1,6 +1,6 @@ package main -import . "./overload_complicated" +import . "overload_complicated" func main() { var pInt *int diff --git a/Examples/test-suite/go/overload_copy_runme.go b/Examples/test-suite/go/overload_copy_runme.go index d35ff70b1..55ec4a333 100644 --- a/Examples/test-suite/go/overload_copy_runme.go +++ b/Examples/test-suite/go/overload_copy_runme.go @@ -1,6 +1,6 @@ package main -import . "./overload_copy" +import . "overload_copy" func main() { f := NewFoo() diff --git a/Examples/test-suite/go/overload_extend2_runme.go b/Examples/test-suite/go/overload_extend2_runme.go index 121506734..db790989c 100644 --- a/Examples/test-suite/go/overload_extend2_runme.go +++ b/Examples/test-suite/go/overload_extend2_runme.go @@ -1,6 +1,6 @@ package main -import "./overload_extend2" +import "overload_extend2" func main() { f := overload_extend2.NewFoo() diff --git a/Examples/test-suite/go/overload_extend_c_runme.go b/Examples/test-suite/go/overload_extend_c_runme.go index e00f0b945..4d3b2b6e1 100644 --- a/Examples/test-suite/go/overload_extend_c_runme.go +++ b/Examples/test-suite/go/overload_extend_c_runme.go @@ -1,6 +1,6 @@ package main -import "./overload_extend_c" +import "overload_extend_c" func main() { f := overload_extend_c.NewFoo() diff --git a/Examples/test-suite/go/overload_extend_runme.go b/Examples/test-suite/go/overload_extend_runme.go index 1ba541f13..d73d6cf3c 100644 --- a/Examples/test-suite/go/overload_extend_runme.go +++ b/Examples/test-suite/go/overload_extend_runme.go @@ -1,6 +1,6 @@ package main -import "./overload_extend" +import "overload_extend" func main() { f := overload_extend.NewFoo() diff --git a/Examples/test-suite/go/overload_polymorphic_runme.go b/Examples/test-suite/go/overload_polymorphic_runme.go index 46f837f49..12b9777e6 100644 --- a/Examples/test-suite/go/overload_polymorphic_runme.go +++ b/Examples/test-suite/go/overload_polymorphic_runme.go @@ -1,6 +1,6 @@ package main -import "./overload_polymorphic" +import "overload_polymorphic" func main(){ t := overload_polymorphic.NewDerived() diff --git a/Examples/test-suite/go/overload_rename_runme.go b/Examples/test-suite/go/overload_rename_runme.go index dca5843c3..3bd4a69c5 100644 --- a/Examples/test-suite/go/overload_rename_runme.go +++ b/Examples/test-suite/go/overload_rename_runme.go @@ -1,6 +1,6 @@ package main -import "./overload_rename" +import "overload_rename" func main() { _ = overload_rename.NewFoo(float32(1)) diff --git a/Examples/test-suite/go/overload_simple_runme.go b/Examples/test-suite/go/overload_simple_runme.go index 5f6d0558b..3eb859bac 100644 --- a/Examples/test-suite/go/overload_simple_runme.go +++ b/Examples/test-suite/go/overload_simple_runme.go @@ -1,6 +1,6 @@ package main -import . "./overload_simple" +import . "overload_simple" func main() { if Foo(3) != "foo:int" { diff --git a/Examples/test-suite/go/overload_subtype_runme.go b/Examples/test-suite/go/overload_subtype_runme.go index dc56d1ca7..45d5a025f 100644 --- a/Examples/test-suite/go/overload_subtype_runme.go +++ b/Examples/test-suite/go/overload_subtype_runme.go @@ -1,6 +1,6 @@ package main -import . "./overload_subtype" +import . "overload_subtype" func main() { f := NewFoo() diff --git a/Examples/test-suite/go/overload_template_fast_runme.go b/Examples/test-suite/go/overload_template_fast_runme.go index b80cb7dd4..63809c0ff 100644 --- a/Examples/test-suite/go/overload_template_fast_runme.go +++ b/Examples/test-suite/go/overload_template_fast_runme.go @@ -1,6 +1,6 @@ package main -import . "./overload_template_fast" +import . "overload_template_fast" func main() { _ = Foo() diff --git a/Examples/test-suite/go/overload_template_runme.go b/Examples/test-suite/go/overload_template_runme.go index 53e1def1b..f3a08ecd6 100644 --- a/Examples/test-suite/go/overload_template_runme.go +++ b/Examples/test-suite/go/overload_template_runme.go @@ -1,6 +1,6 @@ package main -import . "./overload_template" +import . "overload_template" func main() { _ = Foo() diff --git a/Examples/test-suite/go/preproc_runme.go b/Examples/test-suite/go/preproc_runme.go index a15062241..3c55aae72 100644 --- a/Examples/test-suite/go/preproc_runme.go +++ b/Examples/test-suite/go/preproc_runme.go @@ -1,6 +1,6 @@ package main -import "./preproc" +import "preproc" func main() { if preproc.GetEndif() != 1 { diff --git a/Examples/test-suite/go/primitive_ref_runme.go b/Examples/test-suite/go/primitive_ref_runme.go index 973806955..a1de2f8a5 100644 --- a/Examples/test-suite/go/primitive_ref_runme.go +++ b/Examples/test-suite/go/primitive_ref_runme.go @@ -1,6 +1,6 @@ package main -import . "./primitive_ref" +import . "primitive_ref" func main() { if Ref_int(3) != 3 { diff --git a/Examples/test-suite/go/profiletest_runme.go b/Examples/test-suite/go/profiletest_runme.go index 30b6cee69..c2b922ba3 100644 --- a/Examples/test-suite/go/profiletest_runme.go +++ b/Examples/test-suite/go/profiletest_runme.go @@ -1,7 +1,7 @@ package main import "fmt" -import "./profiletest" +import "profiletest" func main() { a := profiletest.NewA() diff --git a/Examples/test-suite/go/refcount_runme.go b/Examples/test-suite/go/refcount_runme.go index fdb271cc6..07d407273 100644 --- a/Examples/test-suite/go/refcount_runme.go +++ b/Examples/test-suite/go/refcount_runme.go @@ -1,6 +1,6 @@ package main -import . "./refcount" +import . "refcount" // very innocent example diff --git a/Examples/test-suite/go/reference_global_vars_runme.go b/Examples/test-suite/go/reference_global_vars_runme.go index b8cbb304a..908358f95 100644 --- a/Examples/test-suite/go/reference_global_vars_runme.go +++ b/Examples/test-suite/go/reference_global_vars_runme.go @@ -1,6 +1,6 @@ package main -import . "./reference_global_vars" +import . "reference_global_vars" func main() { // const class reference variable diff --git a/Examples/test-suite/go/rename_scope_runme.go b/Examples/test-suite/go/rename_scope_runme.go index 995f8c64d..13bd3f178 100644 --- a/Examples/test-suite/go/rename_scope_runme.go +++ b/Examples/test-suite/go/rename_scope_runme.go @@ -1,6 +1,6 @@ package main -import . "./rename_scope" +import . "rename_scope" func main() { a := NewNatural_UP() diff --git a/Examples/test-suite/go/rename_simple_runme.go b/Examples/test-suite/go/rename_simple_runme.go index a63023bd1..bd559ef27 100644 --- a/Examples/test-suite/go/rename_simple_runme.go +++ b/Examples/test-suite/go/rename_simple_runme.go @@ -1,7 +1,7 @@ package main import "fmt" -import . "./rename_simple" +import . "rename_simple" func main() { s := NewNewStruct() diff --git a/Examples/test-suite/go/rename_strip_encoder_runme.go b/Examples/test-suite/go/rename_strip_encoder_runme.go index 1d0bcb660..ae670600c 100644 --- a/Examples/test-suite/go/rename_strip_encoder_runme.go +++ b/Examples/test-suite/go/rename_strip_encoder_runme.go @@ -1,6 +1,6 @@ package main -import . "./rename_strip_encoder" +import . "rename_strip_encoder" func main() { _ = NewSomeWidget() diff --git a/Examples/test-suite/go/ret_by_value_runme.go b/Examples/test-suite/go/ret_by_value_runme.go index 44743d2b7..9659d21e9 100644 --- a/Examples/test-suite/go/ret_by_value_runme.go +++ b/Examples/test-suite/go/ret_by_value_runme.go @@ -1,6 +1,6 @@ package main -import "./ret_by_value" +import "ret_by_value" func main() { a := ret_by_value.Get_test() diff --git a/Examples/test-suite/go/return_const_value_runme.go b/Examples/test-suite/go/return_const_value_runme.go index 790921b74..aadb1265e 100644 --- a/Examples/test-suite/go/return_const_value_runme.go +++ b/Examples/test-suite/go/return_const_value_runme.go @@ -1,6 +1,6 @@ package main -import "./return_const_value" +import "return_const_value" func main() { p := return_const_value.Foo_ptrGetPtr() diff --git a/Examples/test-suite/go/smart_pointer_extend_runme.go b/Examples/test-suite/go/smart_pointer_extend_runme.go index ee5ce0538..a851e26b7 100644 --- a/Examples/test-suite/go/smart_pointer_extend_runme.go +++ b/Examples/test-suite/go/smart_pointer_extend_runme.go @@ -1,6 +1,6 @@ package main -import . "./smart_pointer_extend" +import . "smart_pointer_extend" func main() { f := NewFoo() diff --git a/Examples/test-suite/go/smart_pointer_member_runme.go b/Examples/test-suite/go/smart_pointer_member_runme.go index bf09fe5fc..e7fe7c4c2 100644 --- a/Examples/test-suite/go/smart_pointer_member_runme.go +++ b/Examples/test-suite/go/smart_pointer_member_runme.go @@ -1,7 +1,7 @@ package main import "fmt" -import . "./smart_pointer_member" +import . "smart_pointer_member" func main() { f := NewFoo() diff --git a/Examples/test-suite/go/smart_pointer_multi_runme.go b/Examples/test-suite/go/smart_pointer_multi_runme.go index d1a5f92f4..7c76061af 100644 --- a/Examples/test-suite/go/smart_pointer_multi_runme.go +++ b/Examples/test-suite/go/smart_pointer_multi_runme.go @@ -1,6 +1,6 @@ package main -import . "./smart_pointer_multi" +import . "smart_pointer_multi" func main() { f := NewFoo() diff --git a/Examples/test-suite/go/smart_pointer_multi_typedef_runme.go b/Examples/test-suite/go/smart_pointer_multi_typedef_runme.go index f71740bbb..e584cf7a2 100644 --- a/Examples/test-suite/go/smart_pointer_multi_typedef_runme.go +++ b/Examples/test-suite/go/smart_pointer_multi_typedef_runme.go @@ -1,6 +1,6 @@ package main -import . "./smart_pointer_multi_typedef" +import . "smart_pointer_multi_typedef" func main() { f := NewFoo() diff --git a/Examples/test-suite/go/smart_pointer_overload_runme.go b/Examples/test-suite/go/smart_pointer_overload_runme.go index 5ffeae17c..9481554f0 100644 --- a/Examples/test-suite/go/smart_pointer_overload_runme.go +++ b/Examples/test-suite/go/smart_pointer_overload_runme.go @@ -1,6 +1,6 @@ package main -import . "./smart_pointer_overload" +import . "smart_pointer_overload" func main() { f := NewFoo() diff --git a/Examples/test-suite/go/smart_pointer_rename_runme.go b/Examples/test-suite/go/smart_pointer_rename_runme.go index 678c305c8..44841f5e6 100644 --- a/Examples/test-suite/go/smart_pointer_rename_runme.go +++ b/Examples/test-suite/go/smart_pointer_rename_runme.go @@ -1,6 +1,6 @@ package main -import . "./smart_pointer_rename" +import . "smart_pointer_rename" func main() { f := NewFoo() diff --git a/Examples/test-suite/go/smart_pointer_simple_runme.go b/Examples/test-suite/go/smart_pointer_simple_runme.go index 328654225..b468bd2e5 100644 --- a/Examples/test-suite/go/smart_pointer_simple_runme.go +++ b/Examples/test-suite/go/smart_pointer_simple_runme.go @@ -1,6 +1,6 @@ package main -import . "./smart_pointer_simple" +import . "smart_pointer_simple" func main() { f := NewFoo() diff --git a/Examples/test-suite/go/smart_pointer_templatevariables_runme.go b/Examples/test-suite/go/smart_pointer_templatevariables_runme.go index bf58ba52c..6d4ea91de 100644 --- a/Examples/test-suite/go/smart_pointer_templatevariables_runme.go +++ b/Examples/test-suite/go/smart_pointer_templatevariables_runme.go @@ -1,6 +1,6 @@ package main -import . "./smart_pointer_templatevariables" +import . "smart_pointer_templatevariables" func main() { d := NewDiffImContainerPtr_D(Create(1234, 5678)) diff --git a/Examples/test-suite/go/smart_pointer_typedef_runme.go b/Examples/test-suite/go/smart_pointer_typedef_runme.go index a67a0ccda..e89a8b150 100644 --- a/Examples/test-suite/go/smart_pointer_typedef_runme.go +++ b/Examples/test-suite/go/smart_pointer_typedef_runme.go @@ -1,6 +1,6 @@ package main -import . "./smart_pointer_typedef" +import . "smart_pointer_typedef" func main() { f := NewFoo() diff --git a/Examples/test-suite/go/sneaky1_runme.go b/Examples/test-suite/go/sneaky1_runme.go index ee38ae21b..57c779724 100644 --- a/Examples/test-suite/go/sneaky1_runme.go +++ b/Examples/test-suite/go/sneaky1_runme.go @@ -1,6 +1,6 @@ package main -import "./sneaky1" +import "sneaky1" func main() { _ = sneaky1.Add(3, 4) diff --git a/Examples/test-suite/go/special_variable_macros_runme.go b/Examples/test-suite/go/special_variable_macros_runme.go index c4f687ea9..9338e6558 100644 --- a/Examples/test-suite/go/special_variable_macros_runme.go +++ b/Examples/test-suite/go/special_variable_macros_runme.go @@ -1,6 +1,6 @@ package main -import "./special_variable_macros" +import "special_variable_macros" func main() { name := special_variable_macros.NewName() diff --git a/Examples/test-suite/go/static_const_member_2_runme.go b/Examples/test-suite/go/static_const_member_2_runme.go index 0d345c3d6..ff8cbbbcd 100644 --- a/Examples/test-suite/go/static_const_member_2_runme.go +++ b/Examples/test-suite/go/static_const_member_2_runme.go @@ -1,6 +1,6 @@ package main -import . "./static_const_member_2" +import . "static_const_member_2" func main() { _ = NewTest_int() diff --git a/Examples/test-suite/go/struct_initialization_runme.go b/Examples/test-suite/go/struct_initialization_runme.go index 58ac25010..a815bd3f5 100644 --- a/Examples/test-suite/go/struct_initialization_runme.go +++ b/Examples/test-suite/go/struct_initialization_runme.go @@ -1,6 +1,6 @@ package main -import . "./struct_initialization" +import . "struct_initialization" func main() { if GetInstanceC1().GetX() != 10 { diff --git a/Examples/test-suite/go/struct_rename_runme.go b/Examples/test-suite/go/struct_rename_runme.go index 845dac5be..de99fc320 100644 --- a/Examples/test-suite/go/struct_rename_runme.go +++ b/Examples/test-suite/go/struct_rename_runme.go @@ -1,6 +1,6 @@ package main -import "./struct_rename" +import "struct_rename" func main() { _ = struct_rename.NewBar() diff --git a/Examples/test-suite/go/struct_value_runme.go b/Examples/test-suite/go/struct_value_runme.go index d0b60bd23..3b5e5c1dc 100644 --- a/Examples/test-suite/go/struct_value_runme.go +++ b/Examples/test-suite/go/struct_value_runme.go @@ -1,6 +1,6 @@ package main -import "./struct_value" +import "struct_value" func main() { b := struct_value.NewBar() diff --git a/Examples/test-suite/go/template_default_arg_runme.go b/Examples/test-suite/go/template_default_arg_runme.go index 3d9346b05..d67e63fa7 100644 --- a/Examples/test-suite/go/template_default_arg_runme.go +++ b/Examples/test-suite/go/template_default_arg_runme.go @@ -1,6 +1,6 @@ package main -import "./template_default_arg" +import "template_default_arg" func main() { helloInt := template_default_arg.NewHello_int() diff --git a/Examples/test-suite/go/template_extend1_runme.go b/Examples/test-suite/go/template_extend1_runme.go index 5d6d376f5..0912fa6ed 100644 --- a/Examples/test-suite/go/template_extend1_runme.go +++ b/Examples/test-suite/go/template_extend1_runme.go @@ -1,6 +1,6 @@ package main -import "./template_extend1" +import "template_extend1" func main() { a := template_extend1.NewLBaz() diff --git a/Examples/test-suite/go/template_extend2_runme.go b/Examples/test-suite/go/template_extend2_runme.go index 312410e27..ced3d93cc 100644 --- a/Examples/test-suite/go/template_extend2_runme.go +++ b/Examples/test-suite/go/template_extend2_runme.go @@ -1,6 +1,6 @@ package main -import "./template_extend2" +import "template_extend2" func main() { a := template_extend2.NewLBaz() diff --git a/Examples/test-suite/go/template_inherit_runme.go b/Examples/test-suite/go/template_inherit_runme.go index c0aca77c4..a8d5126dc 100644 --- a/Examples/test-suite/go/template_inherit_runme.go +++ b/Examples/test-suite/go/template_inherit_runme.go @@ -1,6 +1,6 @@ package main -import . "./template_inherit" +import . "template_inherit" func main() { a := NewFooInt() diff --git a/Examples/test-suite/go/template_ns4_runme.go b/Examples/test-suite/go/template_ns4_runme.go index 4caf8f587..6c658ec97 100644 --- a/Examples/test-suite/go/template_ns4_runme.go +++ b/Examples/test-suite/go/template_ns4_runme.go @@ -1,6 +1,6 @@ package main -import . "./template_ns4" +import . "template_ns4" func main() { d := Make_Class_DD() diff --git a/Examples/test-suite/go/template_ns_runme.go b/Examples/test-suite/go/template_ns_runme.go index 6385eccf9..cfc56fa3c 100644 --- a/Examples/test-suite/go/template_ns_runme.go +++ b/Examples/test-suite/go/template_ns_runme.go @@ -1,6 +1,6 @@ package main -import . "./template_ns" +import . "template_ns" func main() { p1 := NewPairii(2, 3) diff --git a/Examples/test-suite/go/template_opaque_runme.go b/Examples/test-suite/go/template_opaque_runme.go index 201f7ba16..71701df53 100644 --- a/Examples/test-suite/go/template_opaque_runme.go +++ b/Examples/test-suite/go/template_opaque_runme.go @@ -1,6 +1,6 @@ package main -import "./template_opaque" +import "template_opaque" func main() { v := template_opaque.NewOpaqueVectorType(int64(10)) diff --git a/Examples/test-suite/go/template_ref_type_runme.go b/Examples/test-suite/go/template_ref_type_runme.go index e4bf626fb..a01ce3d31 100644 --- a/Examples/test-suite/go/template_ref_type_runme.go +++ b/Examples/test-suite/go/template_ref_type_runme.go @@ -1,6 +1,6 @@ package main -import "./template_ref_type" +import "template_ref_type" func main() { xr := template_ref_type.NewXC() diff --git a/Examples/test-suite/go/template_rename_runme.go b/Examples/test-suite/go/template_rename_runme.go index 757ac7355..6e04f8845 100644 --- a/Examples/test-suite/go/template_rename_runme.go +++ b/Examples/test-suite/go/template_rename_runme.go @@ -1,6 +1,6 @@ package main -import "./template_rename" +import "template_rename" func main() { i := template_rename.NewIFoo() diff --git a/Examples/test-suite/go/template_static_runme.go b/Examples/test-suite/go/template_static_runme.go index 7fa50760a..f10ea78f7 100644 --- a/Examples/test-suite/go/template_static_runme.go +++ b/Examples/test-suite/go/template_static_runme.go @@ -1,6 +1,6 @@ package main -import . "./template_static" +import . "template_static" func main() { FooBar_double(1) diff --git a/Examples/test-suite/go/template_tbase_template_runme.go b/Examples/test-suite/go/template_tbase_template_runme.go index 9a52e2fac..e1c46aaf7 100644 --- a/Examples/test-suite/go/template_tbase_template_runme.go +++ b/Examples/test-suite/go/template_tbase_template_runme.go @@ -1,6 +1,6 @@ package main -import . "./template_tbase_template" +import . "template_tbase_template" func main() { a := Make_Class_dd() diff --git a/Examples/test-suite/go/template_type_namespace_runme.go b/Examples/test-suite/go/template_type_namespace_runme.go index a3712ff59..1356f9b08 100644 --- a/Examples/test-suite/go/template_type_namespace_runme.go +++ b/Examples/test-suite/go/template_type_namespace_runme.go @@ -1,6 +1,6 @@ package main -import . "./template_type_namespace" +import . "template_type_namespace" func main() { if Foo().Get(0) == "" { diff --git a/Examples/test-suite/go/template_typedef_cplx3_runme.go b/Examples/test-suite/go/template_typedef_cplx3_runme.go index d616777e0..0a2b31301 100644 --- a/Examples/test-suite/go/template_typedef_cplx3_runme.go +++ b/Examples/test-suite/go/template_typedef_cplx3_runme.go @@ -1,6 +1,6 @@ package main -import . "./template_typedef_cplx3" +import . "template_typedef_cplx3" func main() { // this is OK diff --git a/Examples/test-suite/go/template_typedef_cplx4_runme.go b/Examples/test-suite/go/template_typedef_cplx4_runme.go index 3e536d6f2..d8952cfb6 100644 --- a/Examples/test-suite/go/template_typedef_cplx4_runme.go +++ b/Examples/test-suite/go/template_typedef_cplx4_runme.go @@ -1,6 +1,6 @@ package main -import . "./template_typedef_cplx4" +import . "template_typedef_cplx4" func main() { // this is OK diff --git a/Examples/test-suite/go/threads_exception_runme.go b/Examples/test-suite/go/threads_exception_runme.go index 742a827bd..e3da1dc25 100644 --- a/Examples/test-suite/go/threads_exception_runme.go +++ b/Examples/test-suite/go/threads_exception_runme.go @@ -1,7 +1,7 @@ package main import "strings" -import "./threads_exception" +import "threads_exception" func main() { t := threads_exception.NewTest() diff --git a/Examples/test-suite/go/typedef_class_runme.go b/Examples/test-suite/go/typedef_class_runme.go index ec25162de..d94126d3b 100644 --- a/Examples/test-suite/go/typedef_class_runme.go +++ b/Examples/test-suite/go/typedef_class_runme.go @@ -1,6 +1,6 @@ package main -import "./typedef_class" +import "typedef_class" func main() { a := typedef_class.NewRealA() diff --git a/Examples/test-suite/go/typedef_funcptr_runme.go b/Examples/test-suite/go/typedef_funcptr_runme.go index 49d7086b1..9d55f3f04 100644 --- a/Examples/test-suite/go/typedef_funcptr_runme.go +++ b/Examples/test-suite/go/typedef_funcptr_runme.go @@ -1,6 +1,6 @@ package main -import . "./typedef_funcptr" +import . "typedef_funcptr" func main() { a := 100 diff --git a/Examples/test-suite/go/typedef_inherit_runme.go b/Examples/test-suite/go/typedef_inherit_runme.go index 49097999c..7a65569f2 100644 --- a/Examples/test-suite/go/typedef_inherit_runme.go +++ b/Examples/test-suite/go/typedef_inherit_runme.go @@ -1,6 +1,6 @@ package main -import "./typedef_inherit" +import "typedef_inherit" func main() { a := typedef_inherit.NewFoo() diff --git a/Examples/test-suite/go/typedef_scope_runme.go b/Examples/test-suite/go/typedef_scope_runme.go index 1c4314427..af282b16f 100644 --- a/Examples/test-suite/go/typedef_scope_runme.go +++ b/Examples/test-suite/go/typedef_scope_runme.go @@ -1,6 +1,6 @@ package main -import "./typedef_scope" +import "typedef_scope" func main() { b := typedef_scope.NewBar() diff --git a/Examples/test-suite/go/typemap_namespace_runme.go b/Examples/test-suite/go/typemap_namespace_runme.go index 45184fd1e..a2880d4a8 100644 --- a/Examples/test-suite/go/typemap_namespace_runme.go +++ b/Examples/test-suite/go/typemap_namespace_runme.go @@ -1,6 +1,6 @@ package main -import . "./typemap_namespace" +import . "typemap_namespace" func main() { if Test1("hello") != "hello" { diff --git a/Examples/test-suite/go/typemap_ns_using_runme.go b/Examples/test-suite/go/typemap_ns_using_runme.go index 877e44b3a..c4c21cf75 100644 --- a/Examples/test-suite/go/typemap_ns_using_runme.go +++ b/Examples/test-suite/go/typemap_ns_using_runme.go @@ -1,6 +1,6 @@ package main -import "./typemap_ns_using" +import "typemap_ns_using" func main() { if typemap_ns_using.Spam(37) != 37 { diff --git a/Examples/test-suite/go/typemap_out_optimal_runme.go b/Examples/test-suite/go/typemap_out_optimal_runme.go index 7cbd0ad9b..7cc3b38e3 100644 --- a/Examples/test-suite/go/typemap_out_optimal_runme.go +++ b/Examples/test-suite/go/typemap_out_optimal_runme.go @@ -1,6 +1,6 @@ package main -import . "./typemap_out_optimal" +import . "typemap_out_optimal" func main() { SetXXDebug(false) diff --git a/Examples/test-suite/go/typename_runme.go b/Examples/test-suite/go/typename_runme.go index 0bc15f11a..d1665099c 100644 --- a/Examples/test-suite/go/typename_runme.go +++ b/Examples/test-suite/go/typename_runme.go @@ -1,6 +1,6 @@ package main -import "./typename" +import "typename" func main() { f := typename.NewFoo() diff --git a/Examples/test-suite/go/unions_runme.go b/Examples/test-suite/go/unions_runme.go index ba9c27b17..b76ca5c75 100644 --- a/Examples/test-suite/go/unions_runme.go +++ b/Examples/test-suite/go/unions_runme.go @@ -3,7 +3,7 @@ package main -import "./unions" +import "unions" func main() { // Create new instances of SmallStruct and BigStruct for later use diff --git a/Examples/test-suite/go/using1_runme.go b/Examples/test-suite/go/using1_runme.go index 8cc571288..a6a6fa738 100644 --- a/Examples/test-suite/go/using1_runme.go +++ b/Examples/test-suite/go/using1_runme.go @@ -1,6 +1,6 @@ package main -import "./using1" +import "using1" func main() { if using1.Spam(37) != 37 { diff --git a/Examples/test-suite/go/using2_runme.go b/Examples/test-suite/go/using2_runme.go index f679b0c40..f6b8d49b5 100644 --- a/Examples/test-suite/go/using2_runme.go +++ b/Examples/test-suite/go/using2_runme.go @@ -1,6 +1,6 @@ package main -import "./using2" +import "using2" func main() { if using2.Spam(37) != 37 { diff --git a/Examples/test-suite/go/using_composition_runme.go b/Examples/test-suite/go/using_composition_runme.go index 47e245719..712d1fad5 100644 --- a/Examples/test-suite/go/using_composition_runme.go +++ b/Examples/test-suite/go/using_composition_runme.go @@ -1,6 +1,6 @@ package main -import . "./using_composition" +import . "using_composition" func main() { f := NewFooBar() diff --git a/Examples/test-suite/go/using_extend_runme.go b/Examples/test-suite/go/using_extend_runme.go index 830c958e5..27d1ccc62 100644 --- a/Examples/test-suite/go/using_extend_runme.go +++ b/Examples/test-suite/go/using_extend_runme.go @@ -1,6 +1,6 @@ package main -import . "./using_extend" +import . "using_extend" func main() { f := NewFooBar() diff --git a/Examples/test-suite/go/using_inherit_runme.go b/Examples/test-suite/go/using_inherit_runme.go index db29efb64..a88171817 100644 --- a/Examples/test-suite/go/using_inherit_runme.go +++ b/Examples/test-suite/go/using_inherit_runme.go @@ -1,6 +1,6 @@ package main -import . "./using_inherit" +import . "using_inherit" func main() { b := NewBar() diff --git a/Examples/test-suite/go/using_private_runme.go b/Examples/test-suite/go/using_private_runme.go index d683ef856..2da62dc2e 100644 --- a/Examples/test-suite/go/using_private_runme.go +++ b/Examples/test-suite/go/using_private_runme.go @@ -1,6 +1,6 @@ package main -import . "./using_private" +import . "using_private" func main() { f := NewFooBar() diff --git a/Examples/test-suite/go/using_protected_runme.go b/Examples/test-suite/go/using_protected_runme.go index 65edb5001..3fd5029f7 100644 --- a/Examples/test-suite/go/using_protected_runme.go +++ b/Examples/test-suite/go/using_protected_runme.go @@ -1,6 +1,6 @@ package main -import . "./using_protected" +import . "using_protected" func main() { f := NewFooBar() diff --git a/Examples/test-suite/go/varargs_overload_runme.go b/Examples/test-suite/go/varargs_overload_runme.go index 5978be005..8ce580d65 100644 --- a/Examples/test-suite/go/varargs_overload_runme.go +++ b/Examples/test-suite/go/varargs_overload_runme.go @@ -1,6 +1,6 @@ package main -import "./varargs_overload" +import "varargs_overload" func main() { if varargs_overload.Vararg_over1("Hello") != "Hello" { diff --git a/Examples/test-suite/go/varargs_runme.go b/Examples/test-suite/go/varargs_runme.go index 4009c3ed3..60bd8829a 100644 --- a/Examples/test-suite/go/varargs_runme.go +++ b/Examples/test-suite/go/varargs_runme.go @@ -1,6 +1,6 @@ package main -import "./varargs" +import "varargs" func main() { if varargs.Test("Hello") != "Hello" { diff --git a/Examples/test-suite/go/virtual_derivation_runme.go b/Examples/test-suite/go/virtual_derivation_runme.go index 48a7033a2..4e2c6e585 100644 --- a/Examples/test-suite/go/virtual_derivation_runme.go +++ b/Examples/test-suite/go/virtual_derivation_runme.go @@ -1,6 +1,6 @@ package main -import . "./virtual_derivation" +import . "virtual_derivation" // very innocent example diff --git a/Examples/test-suite/go/virtual_poly_runme.go b/Examples/test-suite/go/virtual_poly_runme.go index 487b371ba..32906b391 100644 --- a/Examples/test-suite/go/virtual_poly_runme.go +++ b/Examples/test-suite/go/virtual_poly_runme.go @@ -1,6 +1,6 @@ package main -import "./virtual_poly" +import "virtual_poly" func main() { d := virtual_poly.NewNDouble(3.5) diff --git a/Examples/test-suite/go/voidtest_runme.go b/Examples/test-suite/go/voidtest_runme.go index 0a685f081..133545cea 100644 --- a/Examples/test-suite/go/voidtest_runme.go +++ b/Examples/test-suite/go/voidtest_runme.go @@ -1,6 +1,6 @@ package main -import "./voidtest" +import "voidtest" func main() { voidtest.Globalfunc() diff --git a/Examples/test-suite/go/wrapmacro_runme.go b/Examples/test-suite/go/wrapmacro_runme.go index dc7e7bf5b..a251a05e8 100644 --- a/Examples/test-suite/go/wrapmacro_runme.go +++ b/Examples/test-suite/go/wrapmacro_runme.go @@ -1,6 +1,6 @@ package main -import "./wrapmacro" +import "wrapmacro" func main() { a := 2 diff --git a/Examples/test-suite/go_subdir_import.list b/Examples/test-suite/go_subdir_import.list index e117d32fa..074c795b3 100644 --- a/Examples/test-suite/go_subdir_import.list +++ b/Examples/test-suite/go_subdir_import.list @@ -1,3 +1,3 @@ testdir/go_subdir_import/go_subdir_import_c -go_subdir_import_b +testdir/go_subdir_import/go_subdir_import_b go_subdir_import_a diff --git a/Source/Modules/go.cxx b/Source/Modules/go.cxx index 9e8162b5d..0163f71df 100644 --- a/Source/Modules/go.cxx +++ b/Source/Modules/go.cxx @@ -125,6 +125,8 @@ class GO:public Language { String *prefix_option; // -fgo-pkgpath option. String *pkgpath_option; + // Prefix for translating %import directive to import statements. + String *import_prefix; // Whether to use a shared library. bool use_shlib; // Name of shared library to import. @@ -204,6 +206,7 @@ public: go_prefix(NULL), prefix_option(NULL), pkgpath_option(NULL), + import_prefix(NULL), use_shlib(false), soname(NULL), intgo_type_size(0), @@ -293,6 +296,15 @@ private: } else { Swig_arg_error(); } + } else if (strcmp(argv[i], "-import-prefix") == 0) { + if (argv[i + 1]) { + import_prefix = NewString(argv[i + 1]); + Swig_mark_arg(i); + Swig_mark_arg(i + 1); + i++; + } else { + Swig_arg_error(); + } } else if (strcmp(argv[i], "-use-shlib") == 0) { Swig_mark_arg(i); use_shlib = true; @@ -743,7 +755,11 @@ private: if (modname) { if (!Getattr(go_imports, modname)) { Setattr(go_imports, modname, modname); - Printv(f_go_imports, "import \"", modname, "\"\n", NULL); + Printv(f_go_imports, "import \"", NULL); + if (import_prefix) { + Printv(f_go_imports, import_prefix, "/", NULL); + } + Printv(f_go_imports, modname, "\"\n", NULL); } imported_package = modname; saw_import = true; @@ -6983,9 +6999,10 @@ const char * const GO::usage = "\ Go Options (available with -go)\n\ -cgo - Generate cgo input files\n\ -no-cgo - Do not generate cgo input files\n\ - -gccgo - Generate code for gccgo rather than 6g/8g\n\ + -gccgo - Generate code for gccgo rather than gc\n\ -go-pkgpath

- Like gccgo -fgo-pkgpath option\n\ -go-prefix

- Like gccgo -fgo-prefix option\n\ + -import-prefix

- Prefix to add to %import directives\n\ -intgosize - Set size of Go int type--32 or 64 bits\n\ -package - Set name of the Go package to \n\ -use-shlib - Force use of a shared library\n\