Commit graph

4,164 commits

Author SHA1 Message Date
William S Fulton
fa5f3abf4d Correct testcase warning fix 2016-02-22 07:06:47 +00:00
William S Fulton
1a26710106 test-suite warning fixes 2016-02-21 21:36:58 +00:00
William S Fulton
1e7c04c1eb Duplicate tests that are run twice as both C and C++ tests to fix parallel make: li_cdata_carrays 2016-02-21 21:36:58 +00:00
William S Fulton
7e1d95de09 Move subdirectory .gitignore to top level 2016-02-21 21:36:58 +00:00
William S Fulton
bbc06c5254 Don't run some tests twice 2016-02-21 21:36:43 +00:00
William S Fulton
ed1074829f Duplicate tests that are run twice as both C and C++ tests to fix parallel make: typedef_struct 2016-02-21 19:24:27 +00:00
William S Fulton
155e31626c Duplicate tests that are run twice as both C and C++ tests to fix parallel make: overload_extend 2016-02-21 19:24:11 +00:00
William S Fulton
0bd41dc14d rename overload_extendc testcase 2016-02-21 18:04:04 +00:00
William S Fulton
a00b4f4463 Duplicate tests that are run twice as both C and C++ tests to fix parallel make: li_cpointer 2016-02-21 18:04:04 +00:00
William S Fulton
819bd9c97e Duplicate tests that are run twice as both C and C++ tests to fix parallel make: li_cdata 2016-02-21 18:04:04 +00:00
William S Fulton
9600c95234 Duplicate tests that are run twice as both C and C++ tests to fix parallel make: li_carrays 2016-02-21 18:04:04 +00:00
William S Fulton
78b113558f Duplicate tests that are run twice as both C and C++ tests to fix parallel make: keyword_rename 2016-02-21 18:04:04 +00:00
William S Fulton
bc3bf51af2 Duplicate tests that are run twice as both C and C++ tests to fix parallel make: empty 2016-02-21 18:03:14 +00:00
Karl Wette
125329466d octave: map unary functions to __...___ Python-style unary members
- Only available in Octave 3.8.0 and higher
2016-02-07 20:22:39 +01:00
Karl Wette
000ab753df octave: recognize Python __float__ numeric conversion operator 2016-02-07 20:22:39 +01:00
Karl Wette
b93b1871a9 octave: export function swig_octave_prereq() for easily testing Octave version 2016-02-07 20:22:39 +01:00
William S Fulton
bb01ed3286 Merge branch 'ahnolds-classic_python'
* ahnolds-classic_python:
  Updating changelog and marking -classic as passing CI
  Support checking names of old-style classic classes
  Don't claim to new-style support in classic mode
  Clean up setting _object
  Removing __swig_getmethods__ for static methods
  Support python(pre|ap)pend on static methods in classic mode
  Add support for static methods in classic mode
  When possible, use PyInt rather than PyLong
2016-02-06 08:01:08 +00:00
Alec Cooper
17a4143dd0 Tests for Python Bytes/Unicode distinction 2016-02-04 21:07:40 -05:00
Alec Cooper
acbe04b548 Support checking names of old-style classic classes 2016-02-04 15:27:54 -05:00
Alec Cooper
b45164e098 Support python(pre|ap)pend on static methods in classic mode
Adding a test that covers this case to the python_append test-suite
Note: staticmethod function has been available since Python 2.2
2016-02-04 15:27:54 -05:00
William S Fulton
26d0b7f5b9 Disable tests broken in python 2.4 and 2.5
These tests were added in 2f8a7b82 and fc8e7654 in #572 and #573
but a change from a few months ago meant that the requested version of
Python was not actually being used during testing when these were added.
2016-02-04 08:36:58 +00:00
William S Fulton
2817e02e35 Merge branch 'ahnolds-clean_osx_go'
* ahnolds-clean_osx_go:
  Go test-suite should now work on OSX
  Don't write empty swigargs structs
  Fail if nocgo version fails
  Handle weak linking on OSX

Conflicts:
	CHANGES.current
2016-01-28 20:03:54 +00:00
Alec Cooper
14178be139 Fail if nocgo version fails 2016-01-23 16:17:33 -05:00
Alec Cooper
bec00500d6 Handle weak linking on OSX
If symbol is not defined at link time (even if it's weak/weak_import), the
linker must explicitly be told that's ok.
2016-01-23 16:16:00 -05:00
Ben Webb
2a5bbb6018 Qualify use of "__builtin__.Exception" class.
It is possible that the module we're wrapping defines an Exception
class. This will confuse code that uses an unqualified "Exception"
class (e.g. "try: ... except Exception") since it now won't match
the Python builtin Exception. Fix this by explicitly using
the class from the __builtin__ module ("builtins" in Python 3).
2016-01-11 21:43:10 -08:00
William S Fulton
575b4e58e5 Merge branch 'ahnolds-Win64_ptrdiff_t'
* ahnolds-Win64_ptrdiff_t:
  Adding required define at beginning
  Unit tests for ptrdiff_t/size_t max/min in Python
  Python2 build on x64 should no longer fail
  Don't use long long if it isn't available
  Add support for ptrdiff_t and size_t == long long
2016-01-10 17:30:57 +00:00
Alec Cooper
1875ff9002 Adding required define at beginning 2016-01-09 10:41:24 -05:00
İsmail Dönmez
b1f45053bb Fix test failure on PPC{64} where the char is unsigned by default 2016-01-08 12:00:03 +02:00
Alec Cooper
fc8e76544c Unit tests for ptrdiff_t/size_t max/min in Python 2016-01-06 17:45:21 -05:00
Alec Cooper
2f8a7b822d Adding unit tests for Python primitive type conversions
Adding unit tests for operator overloading to determine which overload was chosen
  Allow TypeError when testing overloads since it is generated instead
  of NotImplementedError when swig is run with -O or -fastdispatch
2015-12-23 19:04:27 -05:00
William S Fulton
adc773455d Merge branch 'missing-initializers'
* missing-initializers:
  Tcl fix when using -Wmissing-field-initializers warnings
  Php fix for -Wmissing-field-initializers warning
  Fixes for Octave and missing -Wmissing-field-initializers in swig_octave_member
  Fixes for Ruby and using -Wmissing-field-initializers
  R test case warning fixes
  Use -Wmissing-field-initializers warning testing all languages on Travis
2015-12-19 16:34:38 +00:00
William S Fulton
04539a930d R test case warning fixes 2015-12-19 16:21:22 +00:00
William S Fulton
01611702ec Python 2 Unicode strings can be used as inputs to char * or std::string types
Requires SWIG_PYTHON_2_UNICODE to be defined when compiling generated code.
2015-12-19 03:55:26 +00:00
William S Fulton
b15ad9349e Merge branch 'coleb-python35_dtor_exception_fix'
* coleb-python35_dtor_exception_fix:
  Add test case for Python 3.5 assertion with a pending StopIteration
  Amend python_destructor_exception runtime test
  Call PyErr_WriteUnraisable if a destructor sets a Python exception (-builtin)
  Extended zjturner's changes to encompass all function dispatch and use PyErr_WriteUnraisable to handle exceptions during __del__.
  Python - Save and restore exception state before calling destroy.
2015-12-16 12:58:01 +00:00
William S Fulton
26f52c53f4 Add test case for Python 3.5 assertion with a pending StopIteration
Testcase for issue #559 #560 #573
2015-12-16 12:57:06 +00:00
William S Fulton
dd73d81933 Amend python_destructor_exception runtime test
Suppress the message that PyErr_WriteUnraisable writes to stderr,
but check that it is called by checking some of the expected message contents.
The output varies slightly for different versions of Python and -builtin
2015-12-16 12:57:05 +00:00
Brian Cole
a863e98874 Extended zjturner's changes to encompass all function dispatch and use PyErr_WriteUnraisable to handle exceptions during __del__.
Also added test cases for the unnamed temporary destruction that is throwing assertions in Python 3.5.
2015-12-15 08:39:55 -07:00
William S Fulton
6b4e57245d Fix STL wrappers to not generate <: digraphs.
For example std::vector<::X::Y> was sometimes generated, now
corrected to std::vector< ::X::Y >.
2015-12-12 14:05:46 +00:00
William S Fulton
3bfffab9f9 Fix boost::array test for Visual Studio
Visual Studio doesn't set __cplusplus correctly when supporting c++11
2015-12-05 09:00:04 +00:00
William S Fulton
80a8a7f0d8 boost::array test fix when using C++11 2015-11-28 18:49:22 +00:00
William S Fulton
93eb7eae0b Limited Python/Ruby support for boost::array
Hack to use the std::array support for boost::array.
Is limited as it currently exposes some 'using' bugs in SWIG.
For example, the type system fails to see that pointers to std::array
and pointers to boost::array are the same.

This approach saves having to maintain separate boost::array support.
The 'using' bug ought to be fixed, otherwise separate boost_array.i
files could be easily made from the std_array.i files.
2015-11-27 19:30:22 +00:00
William S Fulton
bb2523a003 Ruby STL container setting slices fixes
Setting an STL container wrapper slice better matches the way Ruby
arrays work. The behaviour is now the same as Ruby arrays. The only
exception is the default value used when expanding a container
cannot be nil as this is not a valid type/value for C++ container
elements.
2015-11-25 10:13:30 +00:00
William S Fulton
cd33aba427 Ruby STL container ranges and slices fixes.
Access via ranges and slices now behave identically to Ruby arrays.
The fixes are mostly for out of range indices and lengths.
- Zero length slice requests return an empty container instead of nil.
- Slices which request a length greater than the size of the container
  no longer chop off the last element.
- Ranges which used to return nil now return an empty array when the
  the start element is a valid index.
2015-11-25 09:19:13 +00:00
William S Fulton
97b129de6c Add out of bounds Ruby std::vector and std::array access testing
Also fix swig_assert_equal to work with nil as an expected input
2015-11-25 09:19:13 +00:00
William S Fulton
fe09f05beb Ruby STL container negative indexing support improved
Using negative indexes to set values works the same as Ruby arrays, eg

%template(IntVector) std::vector<int>;

iv = IntVector.new([1,2,3,4])
iv[-4] = 9 # => [1,2,3,9]
iv[-5] = 9 # => IndexError
2015-11-25 09:19:13 +00:00
William S Fulton
19c24a4f60 Ruby container testing enhancement - setting slices 2015-11-25 09:19:13 +00:00
William S Fulton
b8feb85f0e Add Ruby std_array.i - std::array wrappers 2015-11-25 09:19:05 +00:00
William S Fulton
55bbf68512 Add std::array container wrappers for Python
These work much like any of the other STL containers except Python slicing
is somewhat limited because the array is a fixed size. Only slices of
the full size are supported.
2015-11-17 07:27:48 +00:00
William S Fulton
593c452c37 Fix overloaded templates and default arguments
The defaultargs attribute was not being correctly set for functions with
default arguments when instantiated with %template.

Closes #529
2015-10-11 17:30:34 +01:00
William S Fulton
3e9854d308 Fix incorrect director_classic_runme.py test
Python 3.5 and -builtin threw an error as the incorrect base was being
initialized.
2015-10-10 01:26:29 +01:00