Commit graph

5,421 commits

Author SHA1 Message Date
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
Olly Betts
5f38f9cc78 [Chicken] Remove code for Chicken
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
353baebfcf [Allegrocl] Remove code for Allegro 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-13 10:38:40 +12:00
Olly Betts
b671a37e89 [php] Fix reserved class names TRUE, FALSE, NULL
PHPCN(x) does a string compare of x with the lower-cased class name,
so x needs to be in lowercase or else the entry has no effect.  The
entries for TRUE, FALSE and NULL weren't working as a result.
2021-05-12 16:45:42 +12:00
Olly Betts
ead90be779 [php] Fix -prefix when there are subclasses
The calls to the parent class' magic __get, __set and __isset methods
weren't getting the prefix.
2021-05-12 15:04:31 +12:00
Olly Betts
7983c83116 Fix case of expected functions and globals
The updated tests.php is case sensitive.
2021-05-04 15:49:30 +12:00
Olly Betts
c45fb9d2e1 Add member_pointer_const_runme.php 2021-05-04 15:29:46 +12:00
Olly Betts
0d028d8942 Rework tests.php
Previously this relied on getting all known classes/functions/etc
when it was loaded, and then again after the PHP module being
tested was loaded.  This approach no longer works now we've
stopped loading modules using dl(), so use ReflectionExtension
instead to get information about a specific extension.

This is likely also faster than wading through lists including
everything predefined by PHP.
2021-05-04 15:26:45 +12:00
Olly Betts
f2009ef681 Fix and restore disabled code in PHP value example 2021-05-04 14:21:13 +12:00
Olly Betts
32283991c5 Don't generate a .php wrapper file by default
It's now only generated if something to put in it is specified via:

%pragma(php) include=...

or

%pragma(php) code=...
2021-05-04 14:14:56 +12:00
Olly Betts
61f00daee4 Fix extension= value for PHP < 7.2 2021-05-04 08:04:36 +12:00
Olly Betts
586eb24efe php: Stop using dl()
With modern PHP it only works with the CLI version of PHP, so it's
better to direct users to load the extension via "extension=" in
php.ini.

Suggested by ferdynator in #1529.
2021-05-03 18:42:28 +12:00
Olly Betts
c87047fd39 Merge branch 'master' into gsoc2017-php7-classes-via-c-api 2021-05-03 16:17:02 +12:00
Olly Betts
81d1618777 Adjust director_finalizer_runme.php
Without inventing a SWIG/PHP-specific mechanism, we can't really
finalise objects in the way the testcase expects, so adjust the
testcase minimally so we avoid triggering C++ undefined behaviour
(use-after-free).
2021-05-03 16:07:50 +12:00
Olly Betts
9ddc9dceb7 Remove support for $source and $target
These were officially deprecated in 2001, and attempts to use them have
resulted in a warning (including a pointer to what to update them to)
for most if not all of that time.

Fixes #1984
2021-04-30 10:20:14 +12:00
William S Fulton
5f8768daed Support testing on AIX for tcl
Contributed by Tony Reix

Closes #1922
2021-04-28 00:04:50 +01:00
William S Fulton
429288fa1c Fix Java %interface family of macros
when returning by const pointer reference

Closes #1987
2021-04-27 23:37:18 +01:00
William S Fulton
f14c712001 Correct disabling of c++11 testing
C++11 testing was not being turned off when the
C++ compiler check for C++11 features failed and
'configure --enable-cpp11-testing' was used
2021-04-26 22:32:52 +01:00
Olly Betts
50426aae20 Make PHP directors work more like other languages
A PHP exception now gets translated to a C++ exception to skips over C++
code to get back to PHP, avoiding the need to gate every directorout
typemap on EG(exception).
2021-04-22 14:40:21 +12:00
Olly Betts
3e8373b09a Merge branch 'master' into gsoc2017-php7-classes-via-c-api 2021-04-21 16:05:24 +12:00
Olly Betts
1d617c2b9b perl5: Enable more testcases 2021-04-21 15:46:41 +12:00
Olly Betts
5840aca0d9 php: Enable more testcases 2021-04-21 15:46:41 +12:00
Olly Betts
c705ef8f32 Use PHP objects instead of resources to wrap pointers
Pointer to member is currently still wrapped as a resource.
2021-04-21 15:40:35 +12:00
Olly Betts
f1aaeeea1c Fix -prefix to prefix PHP class names 2021-04-20 18:23:23 +12:00
Olly Betts
f24ea7c162 php: Enable prefix testcase
This tests that the SWIG/PHP -prefix command line option works.  It
has a _runme.php and the testcase passes, but it wasn't listed to
be run.
2021-04-20 12:11:13 +12:00
Olly Betts
f45bf4db23 php: Fix director_profile_runme.php
Since 76c2c4675b the fn method is
renamed to c_fn, because `fn` was added as a keyword in PHP 7.4.
2021-04-20 12:04:02 +12:00
Olly Betts
d084173ee7 php: Enable testcase director_stl
This already had a _runme.php which passes as-is, but wasn't listed to
be run.
2021-04-20 12:02:21 +12:00
Olly Betts
e44ac904c4 java: Remove duplicate li_std_map entry
It's in CPP_STD_TEST_CASES so no need for Java to specifically add
it to CPP_TEST_CASES.
2021-04-20 11:56:27 +12:00
Olly Betts
ff1c88f5ba Hook up sym testcase
This has existed since at least the "great merge" and even has a
_runme.php, but seems to have never actually been listed as a testcase
to run.
2021-04-20 11:56:27 +12:00
Olly Betts
b1923af3ee Remove left-over arrayptr_runme.php
The arrayptr testcase was eliminated back in 2003 by
da53ad7bf2.
2021-04-19 19:06:10 +12:00
Olly Betts
1bf23edc06 Remove PHP-specific testcase workarounds
The changes on this branch mean these are no longer required.
2021-04-19 18:57:17 +12:00
Olly Betts
9a82261e4a Fix GCC -Wstringop-truncation warning
The code in testcase memberin_extend_c would end up without a
terminating nul if passed a 50 byte string, and then make_upper()
would run off the end of the buffer.

Fix by using strncat() (which always nul terminates the result, and
also doesn't zero-fill the tail of the buffer if the result is
shorter).
2021-04-19 18:13:02 +12:00
Olly Betts
d6f9f4b6c0 Make examples fail on any PHP diagnostic
Previously we called set_error_handler() in tests.php to do this, but
that only sets it for the test-suite.  Now we set it in on the PHP
command line, which works for both.
2021-04-19 13:40:46 +12:00
Olly Betts
09d06843d1 Fix PHP sync example
Mostly it was missing `%include <std_string.i>`
2021-04-19 11:26:32 +12:00
Olly Betts
a49cc60772 Adjust PHP sync example
Make it work with how globals are actually wrapped.  It looks like
this example has never been right, but nobody noticed before PHP 8
started warning about the use of unset variables.

This reveals that handling of std::string properties needs fixing.
2021-04-18 10:00:34 +12:00
Olly Betts
0a437cddcc Simplify magic property methods 2021-04-17 19:01:32 +12:00
Olly Betts
db358d1e42 Expand li_std_string_runme.php
Re-enable a disabled check and implement more checks based on those
in perl5/li_std_string_runme.pl.
2021-04-17 18:53:50 +12:00
Olly Betts
3e4b7b3368 Drop special case for PHP in allowexcept.i
Now the varinit typemaps are gone we no longer take the address of
the variable in the generated code.
2021-04-17 07:38:23 +12:00
Olly Betts
14edc26c8d Add PHP run test for global_vars 2021-04-17 06:11:49 +12:00
Olly Betts
a51a5c77f2 Modernise checks for PHP NULL and resources 2021-04-17 05:36:13 +12:00
Olly Betts
12bcd36923 Filter less in check::functions()
Stop filtering /^new_/ - we no longer generate these for classes, so
only the li_carrays and li_carrays_cpp testcases generate new_* flat
functions, and it's helpful to check those are generated.

Stop filtering /_(alter|get)_newobject$/' - we no longer generate
these, as they weren't used or documented.
2021-04-17 04:14:33 +12:00
Olly Betts
451998f27b Fix in typemap for void** and void*&
Mark the parameter as "byref" and write back through the reference
after the call.

Adjust testcase argout to uncomment the part that's meant to test this,
and to remove lingering traces of PHP's old call-time pass-by-reference
(which was completely removed before PHP 7).

Fixes #1457
2021-04-14 17:05:19 +12:00
Olly Betts
b430832a08 Restore checks for flat functions in php testcases 2021-04-14 12:44:48 +12:00
Olly Betts
8cb0c185ac Restore checks for globals in php testcases 2021-04-14 11:15:43 +12:00
Olly Betts
50f92dca08 Mark wrapped abstract classes
This allows restoring reflection checks in testcase director_abstract.
2021-04-14 10:59:12 +12:00
Olly Betts
40906ae856 Reenable check::classes() and check::classmethods() 2021-04-14 10:05:20 +12:00