Commit graph

3,097 commits

Author SHA1 Message Date
William S Fulton
cd2e301ea4 Remove nspace feature not yet supported warning 2014-02-15 18:54:28 +00:00
William S Fulton
49da10eca7 Don't run perl examples/tests if Test::More is not available
The test-suite requires Test::More and the local versions of Test::More
were removed in 1d1e8650a3. They are not
always distributed with Perl, such as Perl 5.16 in Fedora.
2014-02-14 19:00:38 +00:00
William S Fulton
98364d46da Merge branch 'wkalinin-nested-ignore'
* wkalinin-nested-ignore:
  Restore warning suppression in testcase
  Typo in comment fix
  warnings suppressed for deeply nested classes
  nested nested class warning filtered
  warning filter fixed
  error order foxed
  WARN_PARSE_UNNAMED_NESTED_CLASS check fixed
  more warnings removed
  warnfilter fixed scoping for "anonymous forward declaration" fixed
  %feature ("flatnested") is set for nested scope test
  added forward declaration instead of ignored nested class (resurrected old code)
  filtered warnings, turned on "flatnested" for nested template test
  Nested classes support is diversified, depending on the language capability. If the language cannot support nested classes, they will be unconditionally moved to the global namespace. If language module does not override Language::nestedClassesSupport() function, nested classes will be ignored, unless "feature:flatnested" is used.
2014-02-08 10:34:05 +00:00
William S Fulton
88de9f1610 Restore warning suppression in testcase 2014-02-08 09:45:20 +00:00
Vladimir Kalinin
e9ecac9298 warnings suppressed for deeply nested classes 2014-02-07 07:39:07 +04:00
William S Fulton
09bdc5f353 Merge branch 'master' of https://github.com/gjanssens/swig into gjanssens-master
* 'master' of https://github.com/gjanssens/swig:
  Guile: make scm to string conversion work with non-ascii strings
  Guile: illustrate bug in non-ascii string handling
2014-02-06 19:58:09 +00:00
Vladimir Kalinin
6b5e366567 nested nested class warning filtered 2014-02-06 23:53:33 +04:00
Vladimir Kalinin
56cea1821d warning filter fixed 2014-02-06 23:47:01 +04:00
William S Fulton
844695b674 Fix typedef_typedef test 2014-02-06 19:31:31 +00:00
Geert Janssens
c6d03a6a9f Guile: make scm to string conversion work with non-ascii strings 2014-02-05 12:17:16 +01:00
Geert Janssens
a54674eeca Guile: illustrate bug in non-ascii string handling 2014-02-05 12:17:05 +01:00
Vladimir Kalinin
54b2346c71 error order foxed 2014-02-05 02:30:48 +04:00
William S Fulton
0383d08444 Add new swigtype_inout.i library containing SWIGTYPE *& OUTPUT typemaps. 2014-02-04 06:54:22 +00:00
Vladimir Kalinin
b7fd1eacb2 WARN_PARSE_UNNAMED_NESTED_CLASS check fixed 2014-02-03 02:50:19 +04:00
Vladimir Kalinin
0320378387 more warnings removed 2014-02-03 02:31:17 +04:00
Vladimir Kalinin
bda9c90e2b warnfilter fixed
scoping for "anonymous forward declaration" fixed
2014-02-03 02:21:44 +04:00
Vladimir Kalinin
8fc4fd2893 %feature ("flatnested") is set for nested scope test 2014-02-03 01:15:05 +04:00
Vladimir Kalinin
69d849b56c filtered warnings, turned on "flatnested" for nested template test 2014-02-02 23:38:23 +04:00
Ian Lance Taylor
3785454a87 [Go] Add support for Go 1.3, not yet released. 2014-01-21 11:18:55 -08:00
William S Fulton
3055a21505 Errors test-suite overhaul
Use makefiles instead of a make.sh script
Expected results are in individual .stderr files instead of the expected.log file
Add errors test-suite to Travis testing and 'make check'
2014-01-19 00:12:12 +00:00
William S Fulton
9d003ab362 Update errors expected results 2014-01-16 19:30:48 +00:00
William S Fulton
e531578c54 Modify typedef_typedef testcase to work for all languages
Add CHANGES note

Closes #112.
2014-01-14 07:21:40 +00:00
Yann Diorcet
2e186244d6 Add test for checking prefix resolving in typedef 2014-01-14 07:21:40 +00:00
William S Fulton
2f47bb8d67 Typedef typedef prefix test for templates
As given in Diorcet Yann's example in issue #50
2014-01-14 07:20:06 +00:00
William S Fulton
07ce3fb746 Add testcase for %attributestring on shared_ptr 2014-01-11 19:34:22 +00:00
William S Fulton
c34d7f6d23 %naturalvar feature fixes and documentation
Fix and document the naturalvar feature override behaviour - the naturalvar
feature attached to a variable name has precedence over the naturalvar
feature attached to the variable's type. The overriding was not working
when turning the feature off on the variable's name.

Fix so that any use of the naturalvar feature will override the global
setting. Previously when set globally by -naturalvar or %module(naturalvar=1),
use of the naturalvar feature was not always honoured.
2014-01-11 19:32:43 +00:00
William S Fulton
e702093c70 Template private assignment testcase
This is broken and needs fixing at some point.
Problem reported by Pierre-Henri Wuillemin on swig-devel mailing list.
2014-01-11 17:39:47 +00:00
Olly Betts
d67aed42bd Remove executable bit from various test-suite runme files 2014-01-06 15:41:06 +13:00
William S Fulton
6a72e16b37 Add C++11 virtual specifier sequences (final and/or override on methods)
Parsing support added. The final and override information is not used or
added to the parse tree atm.
2014-01-03 20:17:48 +00:00
William S Fulton
fc3098ea55 auto_ptr deprecation warning suppression 2014-01-03 08:27:41 +00:00
Paweł Tomulik
5562deec62 Fixed SF bug #1297 (Python imports)
This changeset resolves several issues related to python imports.
For example, it's possible now to import modules having same module
names, but belonging to different packages.

From the user's viewpoint, this patch gives a little bit more control on
import directives generated by swig. The user may choose to use relative
or absolute imports (docs are provided in separate PR).

Some details:
  - we (still) generate import directives in form 'import a.b.c' which
    corresponds to absolute imports in python3 and (the only available)
    ambiguous one in python2.
  - added -relativeimport option to use explicit relative import syntax
    (python3),

Tests are under Examples/python, these are in fact regression tests but
with the current swig testing framework it seems to be impossible to put
appropriate tests under test-suite.

Closes #7
2013-12-24 17:22:25 +00:00
Vadim Zeitlin
cdf1ba9120 Don't accept strings too long to fit in char[N] with trailing NUL.
It was previously possible to assign "hello" to a variable backed by char[5]
storage in C, and the array contained the correct character data but without
the trailing NUL, which was unexpected in C.

This is not allowed any more, only "helo" can fit into a char[5] now and
anything else fails the type check, just as it already happened for the longer
strings before.

Closes #122
2013-12-23 21:13:25 +00:00
Vadim Zeitlin
88a0e228a9 Change the length of strings created from fixed-size buffers.
Use the usual C rule for NUL-terminated strings instead of discarding all the
trailing NUL characters.

This was unexpected (as buffers in C code are not necessarily always padded
with NULs to their full length) and also inconsistent among languages as this
was only done for those of them using typemaps/strings.swg but not for C# or
Java, for example, which terminated the string at the first NUL even before
this change.

Notice that this patch couldn't use strlen() or wcslen() with possibly not
NUL-terminated strings, so we had to add [our own equivalents of] strnlen()
and wcsnlen() and use them instead. This required adding yet another parameter
to string typemap macros, so update the example using them accordingly too.
2013-12-23 21:12:17 +00:00
Vadim Zeitlin
ad02cb98e6 Relax Java preproc_line_file unit test to pass in a separate build directory.
Exact paths comparison doesn't work when SWIG is built in a directory
different from the source one, so check whether the path just ends with the
expected path components instead.

This allows all Java tests to pass in this build configuration.

closes #115
2013-12-23 20:42:48 +00:00
William S Fulton
e7834c8daa Perl directors changes entry added and minor tidy up 2013-12-23 18:04:14 +00:00
William S Fulton
d1bb451eab Merge branch 'perl5-directors-minimal' of https://github.com/talby-/swig into talby--perl5-directors-minimal
* 'perl5-directors-minimal' of https://github.com/talby-/swig:
  try adding travis ci to this branch
  ran "beautify-file" make target over perl5.cxx patch hunks and rewrote callback and extend examples in the style of existing examples
  prefer polymorphism on existing destructor over custom destructor method
  fix string mangled by tidy
  eliminate dead director code and convert remaining blocks
  mitigate ConvertPtr director cost when directors are not enabled
  steals python director docs and adapts to perl5
  adds "callback" and "extend" examples
  don't forget the most important part
  steals python directors and adapts to perl5
2013-12-23 07:30:37 +00:00
William S Fulton
cf92954bc0 C++11 tests re-organise - gcc-4.8 minimum expected for all to pass 2013-12-22 19:38:46 +00:00
William S Fulton
6250c288b5 Suppress gcc-4.9 auto_ptr deprecation in test 2013-12-22 17:49:16 +00:00
William S Fulton
32ad89668a Use RUNME consistently in examples makefile 2013-12-20 18:52:19 +00:00
Ian Lance Taylor
01ebdc0995 In Examples/Makefile.in, compile and link the program in go and
go_cpp, rather than in go_run.  This permits eliminating go_run_cpp.
2013-12-20 08:14:45 -08:00
William S Fulton
82990df573 Error test-suite updated for nested changes
WARN_DEPRECATED_NESTED_WORKAROUND test added
WARN_PARSE_NAMED_NESTED_CLASS test removed
2013-12-19 18:23:28 +00:00
Vladimir Kalinin
b4fef06c42 fixed %template within %extend, test added
fixed language symbol table nested classes name separator, test added
fixed %feature "flatnested" working with %extend
fixed Swig_offset_string for empty string
added simple template to save/restore values in current scope (readability reasons)
2013-12-19 02:11:22 +04:00
Ian Lance Taylor
8dba8b1fde Go: Don't require that Go environment variables be set when running
examples or testsuite.
2013-12-18 11:03:39 -08:00
Ian Lance Taylor
ba049db40b Remove Go -longsize option. 2013-12-17 17:37:55 -08:00
Ian Lance Taylor
1dca0af024 Update for Go 1.2 release. Add support for linking SWIG code directly
into executable, rather than using a shared library.
2013-12-16 19:50:17 -08:00
William S Fulton
39bf2efdc9 Revert template_nested_typemaps to what it was before nested merge
The breaks were fixed in the last couple of commits
2013-12-16 19:28:11 +00:00
Vladimir Kalinin
865408874f fixed %template declared within class, next to template declaration
added a few tests for C# nested classes support
2013-12-16 11:43:28 +04:00
Geert Janssens
0cf116128b Skip unsigned (long) long integer tests on OS X with guile 1.8 2013-12-14 23:36:35 +00:00
William S Fulton
314fae460b Merge branch 'nested' - nested structs/classes support
* nested:
  Deprecation of the 'nestedworkaround' feature
  Ensure -c++out is not used with -c++
  Add missing header to new source file
  Nested C class setters restored in c++out mode for Octave
  Classprefix fixed after private nested classes some comments and spaces added
  Fix template partial specialization detection
  Minor tweaks in Swig_feature_set
  Swig_offset_string moved to misc.c
  nested private classes are discarded while parsing nested relate functions are moved to nested.cxx and renamed accordingly
  out-of-scope template definitions fixed nested_private test disabled again
  fixed out-of-scope nested class definitions, added a test enabled nested C structs assignment (still disabled for Octave), added Java runtime test fixed nested_private test case for Java & C#
  Testcase of private nested class usage causing segfault
  C nested struct passed by value example
  Add in Travis testing for nested branch
  Add C++ nested class example
  Minor code improvements
  Cosmetics/code beautification of nested class support
  Nested classes support
2013-12-14 15:12:07 +00:00
William S Fulton
fb103f8db4 Minor expansion of nested C structs testing 2013-12-12 21:23:49 +00:00