Commit graph

5,466 commits

Author SHA1 Message Date
Olly Betts
87c2e7d71a [php] Fix long long handling on 32 bit platforms
The typemaps for long long and unsigned long long didn't handle a
string input correctly, and long_long_runme.php had a flawed test
in this case.

Fixes #2155
2022-01-22 13:09:34 +13:00
Olly Betts
4d3d4839b0 [python] Add multivalue_runme.py 2022-01-21 11:10:30 +13:00
Olly Betts
d43f28a666 [php] Use -prefix setting in type declarations 2022-01-21 11:08:24 +13:00
Olly Betts
c417250b4e [php] Allow testing if an object is SWIG-wrapped
Since the switch to wrapping classes using PHP's C API, we now
internally need to be able to tell if a PHP object is of or derived
from a class that is wrapped by SWIG so we know if we can offset the
zend_object pointer to get to the swig_object_wrapper.  If we try to
do this to an object which isn't wrapped by SWIG then we invoke C/C++
undefined behaviour (and typically get a segmentation fault).

This check is implemented by having a SWIG\wrapped empty interface which
we make all SWIG-wrapped classes implement simply so we can test for it
to detect such classes.

Fixes #2125
2022-01-20 14:42:02 +13:00
Olly Betts
1f1349741f
[php] Generate PHP type declarations
We now automatically generate PHP type declarations for PHP >= 8.0.

The generated code still compiles with PHP 7.x but without type declarations.
2022-01-20 10:07:44 +13:00
William S Fulton
76d5a9ec27 gcc-12 warning fix in test-case
Closes #2145
2022-01-18 21:37:02 +00:00
Olly Betts
748a9a5452 [perl] Require at least Perl 5.8.0
As discussed and agreed in #1629, it's become hard to test with Perl
5.6 or earlier, such old versions are no longer in active use, and
4.1.0 is an appropriate time to make such a change.

I've dropped the compatibility code that was obvious to me, but there's
probably more that can be cleaned up now.
2022-01-19 10:07:30 +13:00
William S Fulton
2272d00c1a Add Python testcase for testing flatstaticmethod syntax
For testing legacy flattened static method access for when
issue #2137 is applied.
2022-01-15 00:05:06 +00:00
William S Fulton
3aa302c08f %callback and Python class access for C++ static member functions fixes
Fix access to C++ static member functions using Python class
staticmethod syntax, such as Klass.memberfunction instead of
Klass_memberfunction, when using -fastproxy and -builtin in
combination with %callback.

The docstring containing the callback pointers were not being patched
during module initialisation.
2022-01-14 23:00:59 +00:00
William S Fulton
627f7214db [Python] Add missing Python kwargs builtin support
Accept keyword arguments accessing C++ static member functions when
using -builtin and kwargs feature and Python class staticmethod syntax.
The missing keyword argument support was only when using the
class staticmethod syntax, not when using the flat static method
syntax.
2022-01-14 23:00:42 +00:00
William S Fulton
cf8788c411 Update Python tests to not use flatstaticmethod access
Use Python class staticmethod syntax to access C++ static member functions,
such as Klass.memberfunction, instead of Klass_memberfunction.
Examples and test-suite changes in preparation for issue #2137.
2022-01-14 22:48:11 +00:00
ERROR
d73f933c4b
Support std::array in Golang (#2045)
Support std::array in Golang

Closes #2045
2022-01-04 12:12:56 +13:00
Olly Betts
9e95f7f996 [php] Add director_ownership_runme.php
This serves as a regression test for
https://sourceforge.net/p/swig/bugs/1339/ which was presumably fixed by
the change to use PHP's C API to wrap classes.
2021-12-29 15:48:40 +13:00
Olly Betts
9f87d81fae Clean up testcase source whitespace 2021-12-23 16:18:07 +13:00
Olly Betts
860731e0ea Remove redundant test cases
With C++ comments changed to C comments, these are now identical to
the two cases just above, aside from the `2` suffix on the names.

Follow-on for #2027.
2021-12-23 11:55:47 +13:00
William S Fulton
2d76057571 preproc_cpp test for testing preprocessor and C++
Move C++ comment testing into here.
See 7a9bf3307f.
2021-12-22 19:06:00 +00:00
Olly Betts
1b22fef8ad [php] Add missing runmes for overload_* testcases 2021-12-22 13:40:29 +13:00
William S Fulton
7a9bf3307f Remove C++ comments from preproc C test
Closes issue #2127
2021-12-21 22:36:42 +00:00
Olly Betts
a7f2c3d19b [php] Add overload_simple_runme.php 2021-12-18 18:45:52 +13:00
Olly Betts
7d75e3eb7e [PHP] Add new PHP 8.1 keyword
Add PHP keyword 'readonly' (added in 8.1) to the list SWIG knows to
automatically rename.  This keyword is special in that PHP allows it to
be used as a function (or method) name.
2021-12-18 15:30:38 +13:00
Olly Betts
dee8b65823 [php] Always use <?php to start .php file
A few files had just <? which only works when the short_open_tag option
is on.  It is on by default (at least in current PHP versions) and we
explicitly tell PHP not to read php.ini, but the PHP docs recommended to
avoid it, and PHP can be built with --disable-short-tags.
2021-12-18 15:00:56 +13:00
Olly Betts
cc5395a669 [php] Add more checks to some PHP testcases 2021-12-18 14:38:49 +13:00
Olly Betts
f04d741d1c [php] Actually implement abstract_inherit_runme.php
The previous version didn't really test anything useful.  Now we
check that trying to instantiate any of the abstract classes fails
with the expected error.
2021-12-18 14:09:56 +13:00
Olly Betts
b78f0ee263 [php] Add runme for long_long testcase 2021-12-13 09:30:42 +13:00
Olly Betts
883b42dc70 [php] Ensure _runme.php calls check::done()
This function doesn't do anything currently so these missing calls are a
latent issue.  It could be used for e.g. memory leak checking in the
future though, and it's potentially a useful place to add code when
debugging.
2021-12-05 12:40:44 +13:00
Olly Betts
ee3c9bd697 [php] Check fooCount() in newobject1_runme.php 2021-12-05 12:40:44 +13:00
Olly Betts
c25df74807 [php7] Use destructor action if present
If there's a destructor, use its action instead of free(ptr)
(for C)/delete ptr (for C++).

Fixes #2108
2021-12-02 19:15:34 +13:00
Dimitris Apostolou
f586d920f7
Fix typos 2021-11-17 07:07:02 +02:00
William S Fulton
63733a3b5c Short struct name in cpp11_final_override for Scilab 2021-11-15 22:56:29 +00:00
William S Fulton
99954d6d4e Shorten testcase variable names for Scilab 6 to work 2021-11-15 22:45:56 +00:00
William S Fulton
b53b2f1a27 Shorter names in cpp11_rvalue_reference3 testcase for Scilab 2021-11-15 22:13:27 +00:00
William S Fulton
e6b6fa93aa Fix guile examples for C11 and later conformance 2021-11-15 19:25:41 +00:00
William S Fulton
54e2ad073f Fix cpp11_type_aliasing test
Ordering fix for Guile wrappers to compile
2021-11-15 08:00:46 +00:00
William S Fulton
10af8fd921 Workaround Lua failing cpp11_raw_string_literals test 2021-11-12 19:45:25 +00:00
William S Fulton
842ed6ca9d Testcase warning fix using gcc-11
warning: ‘this’ pointer is null [-Wnonnull]
2021-11-12 19:00:20 +00:00
William S Fulton
6cafc93135 -Wfree-nonheap-object warning fix using gcc-11 2021-11-12 19:00:20 +00:00
William S Fulton
d15a3cb1d4 Fix testcase -Wstringop-truncation warning in gcc11 2021-11-12 19:00:20 +00:00
William S Fulton
1bd3e771a0 Fix C tests for Javascript and c++17 2021-11-11 19:56:37 +00:00
William S Fulton
76d8e2cfaf
Merge pull request #2064 from jschueller/py310
[Python] Fix overload_simple_cast test with 3.10
2021-10-20 19:45:55 +01:00
Vadim Zeitlin
f038fcb44d Do nothing in li_std_functors test when using Ruby 2.6
This test sporadically crashes when run in GitHub Actions environment,
so skip it for now when using the Ruby 2.6 version installed by rvm.
2021-10-01 04:26:15 +02:00
Vadim Zeitlin
4b05d8d947 Don't run ccomplextest as part of JavaScript test suite
This test currently fails due to "I" being undefined, so disable it to
let the rest of the tests to pass and add it later when this can be
fixed.
2021-10-01 02:11:11 +02:00
Vadim Zeitlin
58a49bac66 Suppress more -Wignored-qualifiers in JavaScript tests
This is probably not the greatest idea, and it would be better to change
the generated code to avoid these tests instead, but it was already done
like this for several tests, so just add two more of them that generate
warnings such as

../../member_funcptr_galore_wrap.cxx: In function ‘SwigV8ReturnValue _wrap_MemberFuncPtrs_aaa6(const SwigV8Arguments&)’:
../../member_funcptr_galore_wrap.cxx:3495:90: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
 3495 |   result = (int)((MemberFuncPtrs const *)arg1)->aaa6((short (Funcs::*const )(bool) const)arg2);
      |                                                                                          ^~~~

when using gcc 9.
2021-10-01 01:39:12 +02:00
Vadim Zeitlin
f0b3010440 Avoid another warning about deprecated implicit copy ctor
This is similar to the previous commit, but in the other direction, with
the warning being generated for the implicitly-declared copy ctor due to
having an explicitly-declared assignment operator.

And the fix is different too because we need to have an assignment
operator in this test, so define the copy ctor explicitly too.
2021-10-01 01:39:12 +02:00
Vadim Zeitlin
1f7cd009c9 Remove unnecessary warning triggering copy ctors from the test
Defining a copy ctor results in -Werror=deprecated-copy when using
implicitly-generated assignment operator with recent gcc versions, so
simply remove this copy ctor, which was apparently never needed anyhow,
to avoid it and rely on the compiler generating both the copy ctor and
assignment operator implicitly.
2021-10-01 01:39:12 +02:00
Julien Schueller
a2850397ba [Python] Fix overload_simple_cast test with 3.10
Closes #2044
2021-08-05 14:07:30 +02:00
Olly Betts
a54d62b22e [UFFI] Remove code for Common Lisp UFFI
We dropped support for it in SWIG 4.0.0 and nobody has stepped forward
to revive it in over 2 years.

See #2009.
2021-05-16 08:42:39 +12:00
Olly Betts
b7a99f22f5 [S-EXP] Remove code for Common Lisp S-Exp
We dropped support for it in SWIG 4.0.0 and nobody has stepped forward
to revive it in over 2 years.

See #2009.
2021-05-16 08:42:39 +12:00
Olly Betts
11bb422bd3 [Pike] Remove code for Pike
We dropped support for it in SWIG 4.0.0 and nobody has stepped forward
to revive it in over 2 years.

See #2009.
2021-05-16 08:42:39 +12:00
Olly Betts
12f3a85916 [Modula3] Remove code for Modula3
We dropped support for it in SWIG 4.0.0 and nobody has stepped forward
to revive it in over 2 years.

See #2009.
2021-05-16 08:42:39 +12:00
Olly Betts
f3ba54c3bb [CLISP] Remove code for GNU Common Lisp
We dropped support for it in SWIG 4.0.0 and nobody has stepped forward
to revive it in over 2 years.

See #2009.
2021-05-16 08:42:39 +12:00