Commit graph

5,251 commits

Author SHA1 Message Date
William S Fulton
ebc324dfd5 Merge branch 'ruby-autoptr'
* ruby-autoptr:
  Extend std::auto_ptr<> support to Ruby
2020-01-31 19:26:19 +00:00
William S Fulton
0c00daf3a1 Merge branch 'autodoc-doxygen-fix'
* autodoc-doxygen-fix:
  Fix crash in Python backend when using empty docstrings
2020-01-31 18:57:47 +00:00
Arnaud Barré
3fa5c8c652 Fix R memory leak on exception
There is a possible memory leak in case the SWIG_exception_fail macro
is called. The problem is related to its definition that call the
function Rf_warning. This function (as well as Rf_error) involves
a longjmp over C++ destructors on the stack. Thus, all the objects
allocated on the heap are not freed.

Closes #914
2020-01-30 20:43:39 +00:00
Vadim Zeitlin
e14532ce52 Fix crash in Python backend when using empty docstrings
Due to confusion in build_combined_docstring(), we could call
DohDelete() on the "feature:docstring" string, which resulted in a crash
when trying to use it later.

Fix this and simplify the code at the same time by ensuring that we
always use a copy of "feature:docstring" if it's not empty or don't use
it at all if it's empty -- like this we don't have to check for its
length each time before using it.

Closes #1648.
2020-01-30 16:11:18 +01:00
William S Fulton
7648542775 Merge branch 'RMemberListTrialSimplify2019'
* RMemberListTrialSimplify2019:
  ENH R abstract_access_runme
  ENH R accessor processing test
  Removed some remaining commented sections
  moved registration routine and use swig_name_get
  calling Swig_name_setget
  Used Swig_name_register so that Swig_name_wrapper produces the correct name without a separate replace call.
  Removed last instance of using Strcmp to check for a set/get method. Replaced with check for flag.
  Alternative version of using memberlist processing. This clarifies the logic within OutputMemberReferenceMethod by filtering the lists into classes, rather than doing it internally. Code isn't any shorter.
  commenting out unused code
  first pass at removing string comparisons for set/get methods
  trial changing member list processing
2020-01-30 07:29:45 +00:00
William S Fulton
7405bd6a88 Minor tweak to director_wstring_runme.py test 2020-01-28 20:35:29 +00:00
William S Fulton
45963937d5 Test shared_ptr upcasts in Python 2020-01-24 19:54:29 +00:00
William S Fulton
6910e5f09c Merge branch 'shared-ptr-template-upcast'
* shared-ptr-template-upcast:
  comments
  Applying shared_ptr template upcast fix to CSharp, adding CSharp test, and cleanup
  Adding test case demonstrating issue where SWIG does not generate a correctly typed, upcasted shared_ptr for a template instantiation deriving from a base class
  WIP - Use the non-encoded type string for upcasting a shared_ptr of a derived type to a shared_ptr of the base type
  comments
  Applying shared_ptr template upcast fix to CSharp, adding CSharp test, and cleanup
  Adding test case demonstrating issue where SWIG does not generate a correctly typed, upcasted shared_ptr for a template instantiation deriving from a base class
  WIP - Use the non-encoded type string for upcasting a shared_ptr of a derived type to a shared_ptr of the base type
2020-01-17 18:45:30 +00:00
Vadim Zeitlin
7cc94808b6 Extend std::auto_ptr<> support to Ruby
This is trivial as exactly the same typemap as for Python can be used
for Ruby too, all the differenced are abstracted by the unified typemap
library.
2020-01-17 15:09:17 +01:00
William S Fulton
7051753fdf Correct recently expanded testcase from a merge for doxygen default parameter support 2020-01-16 19:49:16 +00:00
William S Fulton
3585ee23cf Fix sort order of doxygen testcases 2020-01-16 19:37:07 +00:00
William S Fulton
bdc9aa0038 Update anther newly merged doxygen Java test for Java 9 API
See 66a7826192
2020-01-16 19:30:44 +00:00
William S Fulton
aa59c81205 Merge branch 'Issue-1643'
* Issue-1643:
  Fix pydoc null pointer dereference with missing arg type
2020-01-16 18:54:47 +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
9cfeb592ed Remove unused import in java testcase 2020-01-15 22:17:18 +00:00
William S Fulton
d1a4174bf3 Fix deprecation warning in java testcase
Fixes:
./director_string_runme.java:53: warning: [deprecation] Integer(int) in Integer has been deprecated
2020-01-14 20:02:15 +00:00
William S Fulton
fa58fd53b4
Merge pull request #1656 from mcfarljm/Issue-1647
Fix doxygen crash with empty comment (Issue #1647)
2020-01-14 19:54:38 +00:00
William S Fulton
af504ccddd Update newly merged doxygen Java test for Java 9 API
See 66a7826192
2020-01-14 18:43:58 +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
558f0ba485 Ruby globalmodule variables test enhancement
Check that the variables values are as expected in C++.
Note that the check_values global function is global in Ruby when
using -globalmodule.
2019-12-30 23:52:02 +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
Vadim Zeitlin
66a7826192 Rewrite Doxygen unit tests for Java using Java 9 API
In particular, do not use com.sun.javadoc deprecated since Java 9 and
finally removed in Java 13, to allow the tests to run under modern JRE.

They don't run under Java 8 and earlier any more, but this shouldn't be
a huge problem nowadays and as SWIG output is independent from the Java
version used, it's enough to test it with modern Java versions.

Note that the tests themselves were changed only in the most minimal
way, to adapt them to the new way of running javadoc (which is now also
integrated into CommentParser itself instead of being duplicated in
every test).
2019-12-18 02:45:06 +01:00
Vadim Zeitlin
5a8875ca9d Don't crash if unexpected comment is found in Java Doxygen tests
Don't pass null pointer to BufferedWriter.write(), as this results in
NullPointerException.
2019-12-18 02:26:03 +01:00
Vadim Zeitlin
fe6968e5e2 Reuse existing variable in CommentParser code used in Java tests
No real changes, just a tiny simplification.
2019-12-18 02:24:01 +01:00
William S Fulton
aa47b4c438 Fix some C++11 identifiers with special meaning parsing problems
Fix parsing of C++11 identifiers with special meaning (final and override) when
they are used as part of the scope name of an identifier, such as a namespace name.

Closes #1679
2019-12-10 19:26:05 +00:00
William S Fulton
18b2dcd222 C# 'out' or 'ref' removal improvements in director typemaps.
- Add support to DOH Replace for not replacing inside C comments
- Fix removing 'out' or 'ref' when these are present in C comments
  in cstype typemaps.

Closes #1628
2019-11-26 19:39:28 +00:00
William S Fulton
6fb345feb2 'out' or 'ref' usage in a cstype typemap in directors
'out' / 'ref' was not always stripped out in parts of the
director code generation.

Issue #1628
2019-11-26 19:32:34 +00:00
John McFarland
e46e1655cd Minor workaround in doxygen_basic_translate_style3 test
With the "///" doxygen comment style, comments within a code block do
not get handled correctly.  Modifying the test to remove this case and
adding a note about it for future reference.
2019-11-02 10:43:52 -05: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
William S Fulton
cb5d7398b5 Fix bug in Python builtin support for keyword args
The fix is when using kwargs feature or -keyword.
The fix is in the argument error checking when wrapping zero
argument constructors only. Supplied keyword args were silently
ignored.

Issue #1595
2019-11-01 19:46:42 +00:00
John McFarland
0f07a8a08d Fix doxygen crash with empty comment
Parsing "/**/" with -doxygen would result in a crash due to
calculation of comment start/end that does not work for an empty
comment.  Fixed by catching this case prior to processing.  Added
simple regression test to doxygen_basic_translate.
2019-10-30 08:15:18 -05:00
John McFarland
f99eb0058b Fix pydoc null pointer dereference with missing arg type
Processing doxygen @param comments for a parameter whose name did not
appear in the function declaration would cause a segfault due to a
null pointer dereference.

Adding test cases for both variadic function (no specified arguments)
and @param comment that references an argument that is not named in
the function prototype.  Both of these cases previously segfaulted.
2019-10-27 18:19:42 -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
f8ed9d71a7 Fix doxygen translation of \p command for python
Doxygen writes this using typewriter font, so wrap in `` for python
2019-09-15 10:59:03 -05:00
John McFarland
c11172587c Fix doxygen handling of \em tag for python
In doxygen, \em is used for italics, so it should be wrapped in "*".
2019-09-15 10:59:03 -05:00
Richard Beare
25a9e3552c ENH R abstract_access_runme
Improved the exception handling components of test.
2019-08-31 17:02:46 +10:00
Richard Beare
bb65049517 ENH R accessor processing test
Test of accessors generated via the new internal structures.
This test confirms that the old incorrect accessors are not
present and runs the correct version, confirming the values.
2019-08-30 22:31:46 +10:00
John McFarland
08ff05c14c Add doxygen_code_blocks_runme.java
The code blocks test is intended to test code block language options
and python doctest translation that is supported for Python, but the
doxygen constructs are still recognized when translating comments for
Java (it is just that the code language option is not used).
2019-08-21 08:43:12 -05:00
William S Fulton
6925ec796b Merge branch 'contrib/TekuConcept'
* contrib/TekuConcept:
  Dev Checkpoint 201908200213
  Dev Checkpoint 201906261312
  Dev Checkpoint 201906252227
  Dev Checkpoint 201906252221
  Dev Checkpoint 201906252210
  Dev Checkpoint 201906252113
  Add JS Native Directive Testcase
  JS Example Campatibility Update
  Add Native Directive Example
  Update JavaScript Documentation
  Add JS Native Wrapper API
2019-08-20 18:53:02 +01:00
Ian Lance Taylor
62136ff782 Fix Go version check and Go in-tree example tests
Fixes #1607
2019-08-09 14:06:45 -07:00
Ian Lance Taylor
7aafe3d8b2 Fix all Go tests to build with "go build"
Tested against Go 1.6 through Go 1.13beta1, and gccgo.

Fixes #1607
2019-08-08 14:30:50 -07:00
William S Fulton
5e2b8f3ec9 Merge branch 'python-stl-overloading'
* python-stl-overloading:
  Python STL container method overloading fix
2019-08-08 18:58:49 +01:00
William S Fulton
fb776e1900 Merge branch 'cshar-fix-enum-constants'
* cshar-fix-enum-constants:
  Fix invalid code generated for "%constant enum EnumType ..." and add a test.
2019-08-08 07:44:21 +01:00
John McFarland
4a5a86ba91 Special handling for python doctest code blocks
A doctest code block begins with ">>>" and is not indented.  Identify
these in doxygen comments and treat them accordingly.  Also add check
to padCodeAndVerbatimBlocks for these because Sphinx requires an empty
line before.

Add test case to doxygen_code_blocks.i.
2019-08-07 17:04:12 -05: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
John McFarland
fd33bdf8a5 Flag optional arguments in doxygen pydoc output
If the parameter has a default value, add the string ", optional" to
the parameter type description in the translated python comments.
Three examples with default values were already present in the test
cases, so their expected python output has been updated accordingly.
2019-08-07 16:42:39 -05:00
John McFarland
36f0e9919f Add parameter direction to doxygen pydoc output
For doxygen comments that specify parameter direction (i.e.,
\param[in], \param[out], and \param[in,out]), the direction is
appended to the type definition in the generated Python documentation.

Updated expected python output for doxygen test case.
2019-08-07 16:42:39 -05:00