Commit graph

100 commits

Author SHA1 Message Date
William S Fulton
5d976b0ebe Fix php testcase warning 2019-04-30 23:44:41 +01:00
Olly Betts
9db02a1e6b Update PHP testsuite for vadz's new cars 2019-02-12 10:27:31 +13:00
Olly Betts
6833bb7e0f [PHP] Make the testsuite fail on any PHP diagnostic 2019-02-09 12:52:25 +13:00
Olly Betts
785481cc62 Fix PHP testsuite check::get() helper
This was trying to return a reference, but that doesn't actually work
for all the things it's used for, and none of the uses require the
return value to be a reference.
2019-02-09 11:45:57 +13:00
Olly Betts
cf785d7071 Avoid uses of undeclared variables in PHP testsuite 2019-02-09 11:45:29 +13:00
Olly Betts
aa7eb05071 Disable broken 'this' check in director_unroll_runme.php
This was comparing an unset property on two objects matched - they
do, but the check we actually intend here is that they wrap the same C++
object.  We don't seem to be able to accomplish the desired check for
PHP, so just disable this for now.
2019-02-09 11:43:49 +13:00
Olly Betts
660d51c7ca Remove blank line from end of php_pragma_runme.php
Because this was after the closing ?> it was resulting in a blank
line in the testcase output.
2019-02-09 09:00:31 +13:00
Olly Betts
8e4d135929 [PHP] Add quotes to another bareword string
Seems I missed one when I fixed all the others in the testsuite.
2019-02-08 18:10:32 +13:00
Olly Betts
3f9ebb31b9 [PHP] Don't generate code referencing undefined $r
This could happen in overloaded methods which returned void and took at
least one const std::string& parameter.
2019-02-08 18:09:52 +13:00
Olly Betts
7345a33ccf [php] Make test helper methods static
We call them all statically so they ought to be static (PHP issues
a diagnostic about this, but that seems to be hidden by default).
2019-02-08 18:04:07 +13:00
Olly Betts
75810c0bdc [php] Fix comment typo in testsuite 2019-02-08 15:33:37 +13:00
Olly Betts
cadd97ac4f [php] Fix widespread use of bare strings in testsuite
These generate warnings with PHP 7.3, which will become errors in a
future version.
2019-02-08 15:32:30 +13:00
Olly Betts
21b3c06de6 [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.
2019-02-08 14:58:01 +13:00
William S Fulton
b7db45661a Fix overloading for non-pointers and NULL - Php 2018-12-30 12:00:49 +00:00
William S Fulton
220a735ec5 Update php test 2018-10-09 19:37:07 +01:00
luz.paz
60dfa31a67 Misc. typos
found via `codespell` and `grep`
2018-05-17 10:04:23 -04:00
William S Fulton
50cb18087d test-suite fixes (2) for compilers that don't support varargs
Split director_exception testcase into two so that testing throw(),
with no arguments, that is nothrows, can be tested separately to throw()
taking arguments. [The throw keyword needs to be removed for C++
compilation in C++11 and later when it was deprecated.]
2018-05-06 09:46:37 +01:00
William S Fulton
08210236ef Fix newobject3 testcase
Fixes Octave problem which has a template called product.
2017-10-10 08:05:21 +01:00
Olly Betts
0ca47dd7cc CHANGES.current entry and regression test for previous commit 2017-10-09 11:09:58 +13:00
William S Fulton
0a9113dcba Correct php testcase 2017-09-19 07:37:29 +01:00
William S Fulton
9e2a12416c Fix type promotion wrapping some non-trivial constant expressions
This was previously an integral type instead of a floating point type:
2017-09-18 07:06:27 +01:00
William S Fulton
90ba174fce Fix generated code for constant expressions containing wchar_t L literals.
Such as:
  # define __WCHAR_MAX    (0x7fffffff + L'\0')

Reported on swig-user mailing list.
2017-09-17 19:02:55 +01:00
Nihal
7f72398eb6 Add tests for PHP pragma version to both PHP5 and PHP7.
Pragma version to specify version of PHP5 and PHP7 extensions.
See issue #360.
2017-05-08 12:02:18 +05:30
William S Fulton
173c028dd4 Add test and changes entry for Python -builtin %array_class fix
Issue https://github.com/swig/swig/issues/446
2016-12-18 17:50:47 +00:00
Olly Betts
c8a5f84cd1 [PHP7] Wrap bool constants as PHP booleans
Leave PHP5 wrapping them as integers as this change could cause
incompatibilities.

Fixes issue https://github.com/swig/swig/issues/686 noted by Nishant
Gupta.
2016-11-30 17:19:11 +13:00
Olly Betts
c7f593e1b1 Enable li_factory testcase for PHP
It already works and already even has a runtest!
2016-11-30 13:07:36 +13:00
Olly Betts
1169874f59 [PHP] Add support for PHP7.
PHP5's C extension API has changed substantially so you need to use
-php7 to specify you want PHP7 compatible wrappers.
Fixes https://github.com/swig/swig/issues/571
2016-11-30 13:05:59 +13:00
William S Fulton
58461c1ffd php run test fixes for new functions in testcase 2016-10-15 17:58:21 +01:00
Olly Betts
26bbc96d58 Arrange to return after calling zend_throw_exception()
Fixes github issue#240.
2016-09-16 17:54:02 +12:00
Olly Betts
a4015acaca [PHP] Fix out typemap for member function pointers
The existing typemap was just broken - it correctly created the resource
and then did nothing with it, and instead tried to register the member
pointer as a normal pointer, which is never going to work as it's larger
than a normal pointer.

Add cpp_basic_runme.php as a regression test for this.
2016-09-02 09:51:18 +12:00
Olly Betts
888e9c6fec Use preg_match() in PHP test harness code
ereg() and eregi() were deprecated in PHP 5.3.0 and removed in PHP 7.0.0,
and preg_match() has been available since PHP4.
2016-09-02 09:09:24 +12:00
William S Fulton
98a31ff633 Fix directorin SWIGTYPE typemaps to make a copy as these are used for pass by value.
Closes #434
2016-05-14 21:32:24 +01: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
Olly Betts
9e69a2c198 Use name of PHP resource not wrapped C++ type
Since callback::foo_T<int> isn't a PHP resource, that error message doesn't
really make sense as it was.  As discussed in #467.
2015-09-04 12:14:21 +12:00
William S Fulton
ca64b06229 Consistent quoting in Makefile 2015-08-21 22:48:34 +01:00
Vadim Zeitlin
a4b319ce8e Remove callback function from autodoc unit test.
It doesn't seem to belong there at all, there is a dedicated callback unit
test for it and it was added to the initial version of autodoc.i back in
124253d698 without any explanation, so just
remove it.

As this callback was used in a PHP test, perform this test for callback.i now
and use "%(uppercase)s" construct inside %callback to test that this works.
2015-07-19 18:14:06 +02:00
Vadim Zeitlin
08fa873638 Make callback unit test pass for PHP backend.
Deprecated %callback(1) doesn't work with PHP, use "%s" to give the same name
to the callback as to the C function explicitly instead.
2015-07-19 00:13:08 +02:00
Olly Betts
ecf3ab5605 Disable director_thread_runme.php
This fails in a ZTS build of PHP.
2015-01-15 09:32:34 +13:00
William S Fulton
eec306c228 Test suite warning fixes 2014-12-28 10:38:12 +00:00
William S Fulton
3efd3affbd Add c++11 strongly typed enum support for PHP 2014-11-27 19:59:20 +00:00
Olly Betts
1a99212c2c [PHP] Add support for specifying any PHP interfaces a wrapped class
implements, e.g.: %typemap("phpinterfaces") MyIterator "Iterator";
2014-09-12 12:48:37 -03:00
Olly Betts
e12322df86 [PHP] Fix throwing a PHP exception through C++ from a subclassed
director method - PHP NULL gets returned by the subclassed method
in this case, so the directorout typemap needs to allow that (at
least if an exception is active).
2014-09-11 13:09:08 -03:00
Olly Betts
0dd7b61c57 Fix segmentation faults with directors in PHP >= 5.4 2014-09-09 13:39:30 -03:00
Karl Wette
7f48b2774b Fully clean PHP test-suite 2014-05-29 02:29:27 +02:00
William S Fulton
176c697c8b Remove PHP director_basic runtime test until fixed.
See #164
2014-05-18 01:06:56 +01:00
William S Fulton
2b5499a262 Slight simplification of test-suite build for new out-of-source changes
Provide default SRCDIR and SCRIPTDIR variables in common.mk and override
only where needed.
2014-05-15 23:11:07 +01:00
Karl Wette
f574a34155 Allow examples and test-suite to be built out of source tree
- Examples/Makefile.in rules use SRCDIR as the relative source directory

- ./config.status replicates Examples/ source directory tree in build
  directory, and copies each Makefile to build directory, prefixed with
  a header which sets SRCDIR to source directory

- Examples/test-suite/.../Makefile.in set SRCDIR from Autoconf-set srcdir

- Examples/test-suite/errors/Makefile.in needs to filter out source
  directory from SWIG error messages

- Lua: embedded interpreters are passed location of run-time test

- Python: copy run-time scripts to build directory because of 2to3
  conversion; import_packages example copies __init__.py from source
  directory; test-suite sets SCRIPTDIR to location of run-time tests

- Javascript: binding.gyp renamed to binding.gyp.in so that $srcdir
  can be substituted with SRCDIR; removed './' from require() statements
  so that NODE_PATH can be used to point Node.js to build directory
2014-05-11 23:21:10 +02:00
Karl Wette
d5b765d388 Whitespace cleanup of all Makefiles*
- some of the %.clean rules in the test-suite Makefiles were using a single tab
  as an empty rule, dangerous! I've replaced these with the safer '@exit 0'.
2014-05-02 20:06:11 +02:00
Olly Betts
73bb909bae [PHP] The generated __isset() method now returns true for read-only properties. 2014-05-01 14:37:58 +12:00
Olly Betts
7df6c832c3 Remove incorrect comments 2014-02-19 18:27:14 +13:00