Commit graph

5,389 commits

Author SHA1 Message Date
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
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
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
Olly Betts
40da8bcbb6 php: Wrap classes using only swig_object_wrapper
We no longer use PHP resources to wrap classes, and the proxy classes no
longer has a _cPtr property.
2021-04-04 07:45:20 +12:00
Olly Betts
904f5a65d8 Merge branch 'master' into gsoc2017-php7-classes-via-c-api 2021-03-31 04:53:40 +13:00
Olly Betts
c9d64f0bed php: Test multiple return values in pointer example 2021-03-31 04:49:38 +13:00
Olly Betts
1eab01ad1f Fix comment typo 2021-03-31 04:46:32 +13:00
Olly Betts
8cd98ec74e Eliminate use of fn in testcases
Fix cpp11_lambda_functions and rname to use fn1 instead of fn, since
fn is a reserved word as of PHP 7.4.
2021-03-30 11:01:51 +13:00
Olly Betts
49d923b917 php: Fix director_overload_runme.php printing empty line 2021-03-30 10:56:23 +13:00
Olly Betts
2ba0f82720 Merge branch 'master' into gsoc2017-php7-classes-via-c-api 2021-03-26 12:00:59 +13:00
Olly Betts
c78325a82a php: Remove out-dated remark from funcptr example
The function pointers are wrapped as resources not "swig style string
pointers".
2021-03-26 08:24:12 +13:00
Olly Betts
eb8024f18b php: Use qualified constant names in funcptr example 2021-03-26 08:24:12 +13:00
Olly Betts
8ded9d8dae Merge branch 'master' into gsoc2017-php7-classes-via-c-api 2021-03-25 17:45:17 +13:00
William S Fulton
33513d5118 testcase fixes for gcc-9 2021-03-25 16:17:06 +13:00
Olly Betts
704ec59f29 [php] Fix widespread use of bare strings in testsuite
These generate warnings with PHP 7.3, which will become errors in a
future version.
2021-03-25 16:17:06 +13:00
Olly Betts
12026c66f1 php: Remove out-dated remark from funcptr example
The function pointers are wrapped as resources not "swig style string
pointers".
2021-03-25 13:28:43 +13:00
Olly Betts
a596fd05ed php: Use qualified constant names in funcptr example 2021-03-25 13:28:11 +13:00
William S Fulton
90cdbee6a6 Python -builtin fix wrapping constructors with varargs
Fix compilation error when using -builtin and wrapping varargs in constructors

Closes #1942
2021-03-23 23:57:49 +00:00
Olly Betts
1eee194a88 [php] Fix test failures due to undefined GETSET constant
Move the constant into the class - the definition outside the class
doesn't seem to work with PHP 7.3.
2021-03-24 12:16:29 +13:00
Olly Betts
9df60351e4 Don't pass -q when running CLI PHP in testsuite
This suppressed output of HTTP headers with PHP < 4.3, but in more
recent versions it doesn't do anything for CLI PHP.
2021-03-23 11:47:19 +13:00
Olly Betts
e54d44c4be php: Omit closing ?> in manual and examples
PSR-12 says "The closing ?> tag MUST be omitted from files containing
only PHP".
2021-03-23 11:47:19 +13:00
Olly Betts
ecddf13ecb Stop trying to disable PHP safe_mode in testsuite
PHP no longer supports safe_mode (since PHP 5.4) so this doesn't do
anything for any PHP version we currently support!
2021-03-22 15:42:52 +13:00
William S Fulton
b3bc87d551 template template parameters patch tidyup
- Document change in CHANGES file
- Minor tweaks and whitespace fixes in stype.c
- Enhance testcase
- Synchronise Java and Python runt test in testcase
2021-03-22 01:08:05 +00:00
William S Fulton
cbfc0d15b1 Fix handling of Template template parameters
Closes #1977
Fixes #1603

Squashed commit of the following:

commit 61f794184e127e4a4b46fb306b2dfea71f7cd7bb
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sat Mar 20 15:20:25 2021 +0100

    added python version for second part of testcase

commit bb80e236b8a7033d1ee45e392352ec0539730db3
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sat Mar 20 15:10:14 2021 +0100

    reworked comment in fixed code

commit 5a94bcc481ea1c068b62a3dbc6cbc2032c9896db
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sat Mar 20 15:07:34 2021 +0100

    removed new unittests; I switched to the official test cases

commit 36603f3c8dd27ee7b27d4a40804a844e1964b5aa
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sat Mar 20 15:05:33 2021 +0100

    removed new unittests; I switched to the official test cases

commit 1f20ea00d22e6c59edb9ae69d6bb31aacab09c4b
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sat Mar 20 14:39:19 2021 +0100

    adapted testcase

commit ab492794c0f26a27761b205fe1d67e2e9aa1f5b6
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sat Mar 20 14:29:10 2021 +0100

    fixed test

commit 9b5dd0c8f9b110a3492753b466e707d7f786c909
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sat Mar 20 13:04:06 2021 +0100

    C99 compatible comments

commit 1a89425ac8c85d68c6af1974e07573b9468d421e
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sat Mar 20 11:41:48 2021 +0100

    added extra checks to prevent accidental partial matches

commit 20e76f511ac139c8ea2a9a7fd89c29391579665f
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Thu Mar 18 21:42:56 2021 +0100

    minor

commit 0e383bbb764f9a019f62b9f620f80908dead50d2
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Thu Mar 18 21:41:45 2021 +0100

    cleanup

commit b644767121440c77f4caeb45f672e3c698ee9d78
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Thu Mar 18 21:39:43 2021 +0100

    cleanup

commit 2574468c0f9352040759e680214b40ee59b03650
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Thu Mar 18 21:38:35 2021 +0100

    cleanup

commit 9dc7f1ed30171649e8a70b12ff4f76d93e545074
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Thu Mar 18 21:35:28 2021 +0100

    removed ide files

commit a442a9df460c52d4dbf7adf8e4f0c5bc5ad3b0cf
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Thu Mar 18 21:32:36 2021 +0100

    removed printf

commit da4c6e91e3b70e72e89cf09dfabfef7416274637
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Thu Mar 18 21:29:02 2021 +0100

    possible fix found

commit 6fad8d40e36195be422d5822e6f49d610e3ab693
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Thu Mar 18 21:01:11 2021 +0100

    found difference between good/bad case... next: analyze why replacement did not work here...

commit 72a7693340358d2067e63c5489191917ccb818dd
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Wed Mar 17 22:43:08 2021 +0100

    ideintified location where the template-template type is inserted in the final type (with the missing specialization).

commit 1b53312c07ab0696d9cade144bdbad1c84ebf6a3
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Wed Mar 17 22:28:19 2021 +0100

    more notes (to be reverted)

commit a9a0b589389784e0e95dc6f9edd27c78a16b481d
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Wed Mar 17 22:19:16 2021 +0100

    some experiments (to be reverted)

commit 0e7a24bbd5944d6e4f5c96ffd03003465f6d80f5
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Wed Mar 17 21:46:20 2021 +0100

    added some notes

commit 2f77911a12a38735cadeb93223981f3a6d9e7450
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Tue Mar 16 22:01:01 2021 +0100

    comment changed

commit 2cb7213b06f9b912c0ba56350ec6c318edba1ffb
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Tue Mar 16 21:55:47 2021 +0100

    renamed example template parameters to easily distinguish them.

commit ff457d73977e05adf84b095bcfa1dccd21203c48
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Tue Mar 16 21:21:10 2021 +0100

    added reset parser functionality (required for unittests, to reset parser)

commit 617bbde3b4b3d9dd16d3a2d85041fc78a87ae81f
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Tue Mar 16 20:47:41 2021 +0100

    adjusted test for simple templates

commit beb7e7f77cedd4ecfa4165534781d417710aff7e
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Mon Mar 15 07:41:17 2021 +0100

    added note how it should be...

commit 7b3328431ce41f7ec05657c69d3cb1a886cb8437
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sun Mar 14 17:07:24 2021 +0100

    found a place which is maybe problematic for the template_template problem (#1603)

commit 46c2443d15a6288318723b7e730687791475cf7b
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sun Mar 14 16:11:56 2021 +0100

    unitests: reset parser for each testcase

commit b3a0f1516ffdbf9f0fbb2d8362e2375fd1893c3f
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sun Mar 14 15:30:47 2021 +0100

    first experiment with templates

commit 32a11c6c77b840f11b9e926edd465e6a7108267f
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sun Mar 14 14:31:17 2021 +0100

    wip

commit 37b805ba6eaadb4a34a929204d539f555f8313be
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sun Mar 14 14:21:05 2021 +0100

    integrated unittests in ctest

commit 79f7bee168ecfbd2f2f5feeb9ca43fb7113bc2a4
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sun Mar 14 14:18:26 2021 +0100

    wip: new test created; problem: not in c++ mode

commit 345d503d557d67fa431f528e637bac5816f50ab1
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sun Mar 14 14:08:09 2021 +0100

    cleanup test code

commit 0a26adec10435af36bfad4e1f6a073460c63fbc6
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sun Mar 14 14:05:24 2021 +0100

    some more tests (first steps with c++ code)

commit 6f628e0fa9e2659f5a7ca08b9954e81d4cd4f012
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sun Mar 14 12:56:41 2021 +0100

    experiments

commit c4a13bf3e12cd83886cbc54e32194bf916a643d3
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sat Mar 13 18:18:01 2021 +0100

    first experiment

commit 7d265861052f205d48b1ccec8ab0fe053de19858
Author: goto40 <pierre.bayerl@googlemail.com>
Date:   Sat Mar 13 17:23:13 2021 +0100

    setup catch2 framework (w/o tests)
2021-03-22 01:02:42 +00:00
Olly Betts
56d7435573 Merge branch 'php8-support'
Fixes #1929, Fixes #1978
2021-03-21 10:57:35 +13:00
William S Fulton
34e663a61a Test a different C# keyword rename
Worked around warning in java jdk-15:
  warning: 'sealed' may become a restricted type name in a future release
  and may be unusable for type declarations or as the element type of an array

Adding sealed to the list of automatically renamed keywords in Java does
not seem prudent.
2021-03-20 09:49:30 +00:00
William S Fulton
82fb0540ca Modernise C++11 compiler support detection in autotools
Replace AX_CXX_COMPILE_STDCXX_11 with AX_CXX_COMPILE_STDCXX
from autoconf archive.
2021-03-20 00:53:13 +00:00
William S Fulton
84259dfc6e Suppress Visual C++ warning in cpp_typedef testcase 2021-03-19 22:04:25 +00:00
Olly Betts
fd96627b2f Temporary hack so testsuite passes for PHP8 2021-03-19 19:30:27 +13:00
Olly Betts
3584c7d49c Add initial support for PHP8
Testcase director_overload2 is failing, but the rest of the testsuite
passes.
2021-03-19 19:30:27 +13:00
William S Fulton
cf639b2794
Merge pull request #1909 from treitmayr/ruby-additional-tests
Add and improve Ruby test cases in the context of nesting and namespaces
2021-03-18 23:09:20 +00:00
Olly Betts
b7dedecfdd php: Fix char* typecheck typemap to accept Null
The corresponding in typemap already does.

Fixes #1655, reported by CJSlominski.
2021-03-19 08:34:15 +13:00
Olly Betts
2e7da86b2c php: Fix overloaded directed methods with non-void return
We were treating  such methods like constructors and assigning to the
internal _cPtr, which just seems bizarrely wrong.

Fixes #1900
2021-03-18 10:58:44 +13:00
Thomas Reitmayr
505ffde655 Add justification for suppressing warnings in Ruby test case
In the same file removed a useless class for comparing versions.
2021-03-16 22:09:50 +01:00
Olly Betts
4e0997cd5a Conditionalise math.i for PHP
PHP already provides all the wrapped constants and all the wrapped
functions except fabs() (PHP provides abs() instead).  Rewrapping
the constants causes warnings or errors (depending on PHP version)
and the rewrapped functions seem to be hidden by the built-in
versions, so only wrap fabs() for PHP.

(Even a wrapper for fabs() seems of little use since abs() is already
provided, but really math.i seems of little use more generally since
any general purpose programming language will provide its own maths
functions and constants - the key motivation here is to eliminate
warnings and errors from running the testsuite.)
2021-03-17 09:43:15 +13:00