Commit Graph

5983 Commits

Author SHA1 Message Date
Olly Betts 8a73e25fe2 argcargv.i: NULL terminate argv with empty input
Fixes needed for: C# R
2023-05-23 10:12:49 +12:00
Erez Geva e358864523 Add argc and argv multi-argument typemap.
Closes: #2585
2023-05-23 09:50:37 +12:00
Olly Betts d3c98322d2 [D] argcagv.i: Allow empty D array as input
Fixes #2603
2023-05-23 09:20:31 +12:00
Olly Betts 4ba7e68c28 Test empty array and empty string with argcargv.i
Adding test coverage for target languages where this already works.
2023-05-22 16:08:09 +12:00
Olly Betts 216a490afd [scilab] Allow empty matrix as input 2023-05-22 16:07:43 +12:00
Olly Betts cc240c8677 [mzscheme] argcargv.i: Allow empty array 2023-05-22 14:08:13 +12:00
Olly Betts eaefa489c5 [js] argcargv.i: Allow empty array or empty string 2023-05-22 14:08:13 +12:00
Olly Betts 1594a89afa [Java] Handle empty Java array 2023-05-22 14:08:13 +12:00
Olly Betts 0108f6b71d [guile] argcargv.i: Allow empty array or empty string 2023-05-22 14:08:13 +12:00
Olly Betts ea050f5cb4 [go] argcargv.i: Allow empty array or empty string 2023-05-22 14:08:13 +12:00
Olly Betts 858c637353 [c#] argcargv.i: Allow empty array or empty string 2023-05-22 13:42:02 +12:00
Olly Betts 915dc93b0d [octave] Fix argcargv.i bug
The strings from the Octave array are returned in a temporary
std::string object so we need to make a copy of them or else the
final string ends up replicated as all elements.

Unfortunately argcargvtest.i was only checking the final element's
value, so fix it to test both the elements as a regression test for
this, and to catch any similar issues with other target languages.
2023-05-22 13:38:59 +12:00
Erez Geva 42383f5567 [MzScheme] Add argc and argv multi-argument typemap.
Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
2023-05-22 02:31:35 +02:00
Erez Geva 1bff377fc3 [C#] Update argv argc typemap to generic format. 2023-05-21 22:36:33 +02:00
Olly Betts 5eedba422f [js] Add _runme.js files for ynit tests that pass
Fixes #2600
2023-05-22 08:18:31 +12:00
Olly Betts 511926f94f Remove another redundant NULL check before free() 2023-05-21 10:21:50 +12:00
William S Fulton 7c7f4b3115 Keep tests in alphabetical order 2023-05-20 09:32:43 +01:00
Erez Geva 7b9b5565b3 Add D language typemaps
- "char *STRING, size_t LENGTH"
 - argc and argv multi-argument

Fixes #2552

Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
2023-05-20 16:17:00 +12:00
Erez Geva bdc2190cde Add argc and argv multi-argument typemap to Java, Guile, JavaScript, Scilab and C#
Fixes #2552

Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
2023-05-20 16:17:00 +12:00
Erez Geva 2e7dedde56 Add li_constraints test for D Language.
Fixes #2567

Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
2023-05-20 16:17:00 +12:00
Olly Betts ad7d342090 [D] Fix D examples to work when srcdir != builddir 2023-05-20 16:16:19 +12:00
Olly Betts 9d51ce87a2 [D] Require gdmd to be used to run tests with gdc
gdmd is a wrapper which translates command line options from a
dmd-compatible syntax to the syntax gdc uses, which makes the
machinery to run D tests simpler.
2023-05-20 15:22:26 +12:00
Olly Betts 61fdfc78a7 [D] Drop explicit -fversion=/-version=
There are pre-defined version identifiers for each of the different
compiler implementations so there's no need to define them ourselves.

See list at https://dlang.org/spec/version.html#predefined-versions
- for example, version identifier `LDC` is already defined by ldc.
2023-05-20 15:22:26 +12:00
Erez Geva eaabe152b3 [D] Fix to support recent D releases
Fixes #56
Fixes #2538
Fixes #2570
2023-05-20 15:22:12 +12:00
Olly Betts d8887091fe Support deducing decltype for false and true 2023-05-20 09:09:48 +12:00
Olly Betts 4e4369a4a4 Improve #2446 fix
It seems the parser limitation isn't actually a problem as non of
the cases are valid C++ so drop that from the docs.

Extend test coverage by adding some class methods, including `static` and
`const`.
2023-05-19 14:27:34 +12:00
Olly Betts f215365609 Merge branch 'cpp14-auto-return-type' 2023-05-19 12:02:30 +12:00
Olly Betts 7eed7fdd55 [Perl] Add string_view support
Seems to be a problem with the directorout typemap for string_view
currently (see the extra $TODO in
Examples/test-suite/perl5/director_string_view_runme.pl).

See #1567
2023-05-19 11:16:48 +12:00
Olly Betts 0cca30b4c7
Merge pull request #2594 from ojwb/preprocessor-predefined-improvements
Preprocessor predefined improvements
2023-05-19 09:43:09 +12:00
Olly Betts 1c309da897 Implement cpp11_decltype_runme.php 2023-05-18 18:48:06 +12:00
Olly Betts 2ec8c01b55 [Ruby] Add string_view support
See #1567
2023-05-18 17:52:38 +12:00
Olly Betts 5104040dc9 Partial support for auto without trailing return type
This is a C++14 feature.

SWIG can now parse some cases of this.  The limitation is that there
can either be nothing or `const` between the `)` and the end of the
parameter list and the `{` at the start of the body.

Fixes #2446
2023-05-18 15:19:23 +12:00
Olly Betts 1782a70a5e Add test that __cplusplus isn't defined in C mode 2023-05-18 12:45:31 +12:00
Olly Betts da8d7f0ec3 Define __STDC__ to 1 rather than an empty value
The new value matches how C/C++ compilers define __STDC__.
2023-05-18 12:45:31 +12:00
Olly Betts fba4a82865 Add new -U command line option
This undefines a preprocessor symbol.

See #2591
2023-05-18 12:45:31 +12:00
Olly Betts 59794e710f Update comment wrt #1589 2023-05-18 07:23:38 +12:00
Olly Betts 86f437e3f6 Support parsing arbitrary expression in decltype
Use parser error recovery to skip to the closing matching `)` and
issue a warning that we can't deduce the decltype for the expression
(like we already do for any expression which isn't a simple variable
or similar).

Fixes #1589
Helps #2335 (fixes the decltype-related examples)
2023-05-17 18:09:27 +12:00
Olly Betts 56f82e5541 Remove obsolete debug line from callback_runme.py
We stopped wrapping C++ static method A::bar as A_bar in SWIG 4.1.0.
2023-05-17 13:38:04 +12:00
Olly Betts 73872022fb [tcl] Add string_view support
See #1567
2023-05-17 13:23:16 +12:00
Olly Betts a3db89c6ee Document what c_spaceship.i is testing 2023-05-16 11:45:36 +12:00
Olly Betts af87945aea Clean up double spaces between words in comments 2023-05-16 09:55:49 +12:00
Olly Betts 5b709dd163 Merge branch 'JS-check-fix' 2023-05-12 16:18:46 +12:00
Olly Betts a44a7de348 Expand li_std_string_runme.*
Add testing of the empty and null cases for all languages which
already have a runme.
2023-05-12 16:05:48 +12:00
Erez Geva b6eaee8d12 Add li_constraints test, testing 'constraints.i'.
For: JavaScript, C#, go, Java, Lua, Perl, PHP, python, Ruby, TCL and Octave.

Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
2023-05-12 01:23:31 +02:00
Olly Betts 1a31e9dc0c [java] Suppress removal warnings for finalize()
The "deprecation" warning has been changed to a "removal" warning
with newer JDK versions.  This needs to be addressed, but meanwhile
it makes running the testsuite unusably noisy so suppressing it
seems more helpful than not.

Closes: #2556
2023-05-12 08:48:20 +12:00
Olly Betts c67e4dd06f Fix SWIG warning from testcase cpp11_constexpr
Introduced by previous commit.
2023-05-11 14:30:29 +12:00
Olly Betts b1388bcbf9 Parse storage class more flexibly
Previously we had a hard-coded list of allowed combinations in the
grammar, but this suffers from combinatorial explosion, and results
in a vague `Syntax error in input` error for invalid (and missing)
combinations.

This means we now support a number of cases which are valid C++
but weren't supported.

Fixes #302
Fixes #2079 (friend constexpr)
Fixes #2474 (virtual explicit)
2023-05-11 13:54:30 +12:00
Olly Betts 6085a9661e Initial support for std::string_view
So far C#, Java, Lua and PHP are supported.

Closes: #2540
See #1567
2023-05-08 15:56:37 +12:00
Olly Betts 15b739d60e [PHP] Wrap method with both static and non-static overloads
We now wrap this as a non-static method in PHP, which means the static
form only callable via an object.

Previously this case could end up wrapped as static or non-static
in PHP.  If it was wrapped as static, attempting to call non-static
overloaded forms would crash with a segmentation fault.

See #2544
2023-05-08 15:44:24 +12:00
William S Fulton 281af00437 Tweak to struct name in testcase for R 2023-05-06 15:09:07 +01:00