Commit graph

640 commits

Author SHA1 Message Date
William S Fulton
35ec8ca210 Add argcargv test case to test-suite 2022-05-15 19:49:59 +01:00
William S Fulton
b35ebc81a9 Doxygen comments take precedence over the autodoc feature.
If a "docstring" feature is present it will still override a Doxygen comment.
If the "autodoc" feature is also present, the combined "autodoc" and "docstring"
will override the Doxygen comment. If no "docstring" is present then the
"autodoc" feature will not be generated when there is a Doxygen comment.

This way the "autodoc" feature can be specified and used to provide documentation
for 'missing' Doxygen comments.

Closes #1635
2022-04-06 08:08:14 +01:00
William S Fulton
27d6f5c2fe git commit -m "Fix test-suite's make clean to clean cpp11 testcases
Always clean cpp11 tests even if --enable-cpp11-testing is not active
May result in cpp11 tests being deleted twice though" ../
2022-03-27 18:28:49 +01:00
William S Fulton
282fdb1715 MzScheme 'passes' with c++11 testing now
Test c++17 on Github Actions to try keep it passing when
configure detects g++ can test c++17.
2022-03-27 15:06:47 +01:00
William S Fulton
c5f209706e Further makefile refactoring for multicpptests 2022-03-27 11:27:58 +01:00
William S Fulton
f2dd436a5b Rework swig_and_compile_multi_cpp makefile helper
Seems less cryptic and more maintainable to me
2022-03-26 15:16:22 +00:00
Eugene Toder
f733efd3c0 Use different capsule names with and without -builtin
Types generated with and without -builtin are not compatible. Mixing
them in a common type list leads to crashes. Avoid this by using
different capsule names: "type_pointer_capsule" without -builtin and
"type_pointer_capsule_builtin" with.

See #1684
2022-03-18 13:44:54 -04:00
William S Fulton
b6ece11fc1 Fixes for the family of %interface macros for overloaded methods
When C++ methods are not able to be overloaded in a derived class,
such as when they differ by just const, or the target language
parameters types are identical even when the C++ parameter types
are different, SWIG will ignore one of the overloaded methods with
a warning. A %ignore is required to explicitly ignore one of the
overloaded methods to avoid the warning message. Methods added
in the derived classes due to one of the %interface macros are now
similarly ignored/not added to the derived class.

The adding of additional methods into the parse tree is now more
robust and complete resulting in support for %feature and %rename
for the added methods.

Closes #1277
2022-03-12 23:04:24 +00:00
William S Fulton
c88a9436bc Fix segfault in C# layer handling using declarations
Segfault was actually avoided in previous commit ab23cb29.
This commit makes handling more robust in the event of
using %ignore just on the derived method, not tested as it is not
what one should do with directors, and possibly other cases.

Go still segfaults with the new testcase director_using_member_scopes.i.

Issue #1441.
2022-03-10 22:18:23 +00:00
William S Fulton
bd5ffe86e4 Using declarations in derived class parameters scoping fix
Fix using declaration in derived class incorrectly introducing a method
from a base class when the using declaration is declared before the method
declaration. Problem occurred when within a namespace and the parameter types
in the method signatures were not fully qualified.

Issue #1441
2022-03-10 22:18:23 +00:00
Olly Betts
4f5613b4e9 Reenable rename_camel testcase
It was on the "broken" list, but it should now work.
2022-03-07 09:22:13 +13:00
Olly Betts
e36e898c0a
Merge pull request #2205 from swig-fortran/extend-tests
Fix and add additional tests to test suite
2022-02-25 10:16:22 +13:00
Olly Betts
1707d6b89b [PHP] Fix cleanup code handling issues
Fix to call cleanup code in exception situations and not to invoke
the freearg typemap twice in certain situations.

Fixes https://sourceforge.net/p/swig/bugs/1211/
2022-02-17 13:52:44 +13:00
Seth R Johnson
77cdba81ad Add test case for very simple director classes
Test both abstract and concrete base classes, with simple int/bool data.
This level of complexity is very helpful when setting up director
functionality for a new target language.
2022-02-12 19:40:03 -05:00
Seth R Johnson
0da8a9bb44 Test ability to manipulate a daughter class from its base class wrapper
Even in the case of just creating a `DerivedClass` this test says:
```
swig/python detected a memory leak of type 'DerivedClass *', no destructor found.
```
even though the destructor is defined in the base class.
2022-02-12 19:40:03 -05:00
Seth R Johnson
fb0cddfd2b Add C "contract" test
Tests that the `%contract` code (viz., each target language's
implementation of SWIG_contract_assert) compiles in C as expected. Update
the note in the source code since `%contract` is in the official
documentation.
2022-02-12 19:40:03 -05:00
Olly Betts
b06ab566cb -DFOO on the SWIG command line now sets FOO to 1
This is consistent with C/C++ compiler preprocessors.  Previously
SWIG set FOO to an empty value.

Fixes #2193
2022-02-06 10:18:49 +13:00
Olly Betts
7813793511 [R] Fix CopyToR() generated for struct in namespace
Fixes https://sourceforge.net/p/swig/bugs/1147/
2022-01-31 12:05:09 +13:00
Frank Schlimbach
63452e9fc1 better handling of using directives 2022-01-30 10:55:00 +13:00
Olly Betts
d2d2bfa05f Add CHANGES entry and regression test for #676 2022-01-29 22:35:29 +13:00
Olly Betts
f2de21eb83 Parse common cases of < and > comparisons
Adding full support for these in expressions seems hard to do without
introducing conflicts into the parser grammar, but in fact all reported
cases have had parentheses around the comparison and we can support that
with a few restrictions on the left side of `<`.

Fixes #80 and #635.  Also https://sourceforge.net/p/swig/bugs/1139/
2022-01-25 14:09:41 +13: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
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
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
Thomas Reitmayr
7963445048 Add and improve Ruby test cases in the context of nesting and namespaces
This is done in preparation for adding namespace support to the Ruby
part of SWIG. Some existing test cases were reorganized or duplicated
for flat/nonflat nesting. For some a Ruby test script was added.
Finally the ruby/Makefile.in was improved so that for test cases
without an explicit test script, the generated wrapper library will
be loaded by the Ruby interpreter to ensure loading works fine.
2020-12-16 22:30:46 +01:00
William S Fulton
bc09d05174 testname typo fix 2020-10-10 17:59:17 +01:00
William S Fulton
638ca8152d complex can now be used as an identifier
Remove final vestiges of 'complex' keyword.

Closes #252
2020-10-10 16:07:55 +01:00
Zackery Spytz
4e57c5536d Fix wrapping of virtual comparison operators with directors
Closes #1642.
2020-06-05 10:25:20 -06:00
Thomas REITMAYR
eb2be58a12 Add test cases for abstract user-defined conversion operators 2020-02-13 20:16:44 +01:00
William S Fulton
3585ee23cf Fix sort order of doxygen testcases 2020-01-16 19:37:07 +00:00
William S Fulton
55d36e3fd3 Merge branch 'Issue-1632'
* Issue-1632:
  Minor workaround in doxygen_basic_translate_style3 test
  Add new test doxygen_basic_translate_style3.i
  Fix for newline handling in doxygen "///" style comments
2020-01-16 07:19:29 +00:00
William S Fulton
00b47d4d1d Merge branch 'doxy/commands'
* doxy/commands:
  Update documentation for doxygen tags
  Fix doxygen translation of \p command for python
  Fix doxygen handling of \em tag for python
  Minor formatting updates to doxygen docs
  Reformat tag lists in doxygen documentation
  Add doxygen_code_blocks_runme.java
  Special handling for python doctest code blocks
  Add new doxygen test doxygen_code_blocks
  Handle doxygen code command with language option
  Improve doxygen parser handling of \code content
  Flag optional arguments in doxygen pydoc output
  Add parameter direction to doxygen pydoc output
  Support doxygen \param[] commands
2020-01-14 18:36:50 +00:00
William S Fulton
3759fcf999 Merge branch 'builtin-ctor-kwargs'
* builtin-ctor-kwargs:
  Python -builtin constructors silently ignored keyword arguments.
2020-01-13 19:29:47 +00:00
William S Fulton
67e8334ac8 Python -builtin constructors silently ignored keyword arguments.
Instead of silenty ignoring them, now a "TypeError: f() takes no keyword arguments"
exception is thrown if keyword arguments are used. Hence constructors and normal
methods/functions behave in the same way.

Closes issue #1595
2020-01-13 19:26:22 +00:00
William S Fulton
d53a54b4f7
Merge pull request #1668 from treitmayr/master
Fix code generated for Ruby global variables
2019-12-30 23:49:04 +00:00
Vadim Zeitlin
b52af40398 Disable Doxygen tests when using Java 8 or older
Check Java version in configure and define SKIP_DOXYGEN_TEST_CASES if
it's less than 9, which is required by the new implementation of
CommentParser used in the Doxygen tests.
2019-12-18 16:24:28 +01:00
John McFarland
feea39f352 Add new test doxygen_basic_translate_style3.i
This is used to test the "///" style of doxygen comments.  Previously,
newlines in these doxygen comments were not handled correctly.
2019-11-02 10:43:52 -05:00
Thomas Reitmayr
18a3ef3911 Fix code generated for Ruby global variables
This commit fixes swig#1653 by creating a Ruby virtual variable
for a C/c++ global variable when SWIG is invoked with the
-globalmodule option.
2019-10-27 21:41:03 +01:00
John McFarland
5230afb3e1 Add new doxygen test doxygen_code_blocks
This does somewhat more detailed testing of the code block parsing,
and also exercises the language identification of python doctest
features.  For now, it is only tested by python (javadoc translation
may not correctly handle some of the characters that are used here).
2019-08-07 16:55:38 -05:00
William S Fulton
86cb3a9532 Python STL container method overloading fix
Fix method overloading of methods that take STL containers of different types.
Due to some error handling that was not cleared during typehecking.
2019-08-06 19:36:14 +01:00
William S Fulton
a9a7b03ba6 Split testcases li_std_wstring.i and li_std_wstring_inherit.i
Not many languages have support for std_wstring.i, so disable testing
for these languages until added.
2019-07-22 19:05:21 +01:00
William S Fulton
aea7a6d30f Merge branch 'patch-1'
* patch-1:
  nested_inheritance_interface testcase enhancement
  Add nested_inheritance_interface test for csharp
  Fix class name for nested classes
  Add nested_inheritance_interface test
  Fix class name for nested classes

Conflicts:
	CHANGES.current
2019-07-09 19:37:35 +01:00
Isaac Pascual Monells
84e310402a Add nested_inheritance_interface test 2019-07-02 12:57:16 +02:00
John McFarland
91a90b8d27 Adding test for second doxygen comment style
This style looks like:

/** Line 1
 *  Line 2
 */

This is needed to verify fixes to some of the indentation in the
translated comments.

The test is copied from doxygen_basic_translate.i.  One adjustment was
made to change the comment style on the last function that left out
the intermediate "*" characters.  This does not produce correct output
when combined with this style of starting the text on the first
comment line.

Test results are copied directly from doxygen_basic_translate.  A
minor difference in the Python results will be updated in a subsequent
commit.
2019-05-25 16:25:54 -05:00
William S Fulton
bc0645ce2b Merge branch 'ZackerySpytz-director-classes-final-methods'
* ZackerySpytz-director-classes-final-methods:
  Warning tweaks for destructors that are final in director classes
  Documentation for directors and virtual final methods
  Fixes for final destructors in director classes
  Warning fix for final destructor in directors
  Remove a useless warning filter
  Fix the handling of director classes with final methods
2019-03-03 15:12:53 +00:00
William S Fulton
be491506a4 Java std::vector improvements for types that do not have a default constructor.
The std::vector wrappers have been changed to work by default for elements that are
not default insertable, i.e. have no default constructor. This has been achieved by
not wrapping:

  vector(size_type n);

Previously the above had to be ignored via %ignore.

If the above constructor is still required it can be added back in again via %extend:

  %extend std::vector {
    vector(size_type count) { return new std::vector< T >(count); }
  }

Alternatively, the following wrapped constructor could be used as it provides near-enough
equivalent functionality:

  vector(jint count, const value_type& value);

The equivalent change to std::list has also been made (std::list
wrappers were not in the previous release [3.0.12] though).
2019-03-01 18:01:14 +00:00
Zackery Spytz
e8cc5929de Remove a useless warning filter
Add cpp11_final_directors to Examples/test-suite/common.mk.
2019-02-24 08:04:45 -07:00
William S Fulton
1f46d9b7b9 Fix regression parsing gcc preprocessor linemarkers
These are preprocessor statement in the form:

 # linenum filename flags

Closes #1475
2019-02-19 21:32:04 +00:00
William S Fulton
9038a9987d Add std::vector back reference test 2019-02-18 21:39:17 +00:00
William S Fulton
b9350614b5 Fix typemap matching to expand template parameters when the name contains template parameters.
In the %typemap below the type is T and the name is X<T>::make
which now expands correctly to X< int >::make

template<typename T> struct X {
  %typemap(out) T X<T>::make "..."
  T make();
};

%template(Xint) X<int>;
2019-02-17 21:38:48 +00:00