Commit graph

21,486 commits

Author SHA1 Message Date
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
John McFarland
4ebc3e05ad Minor formatting updates to doxygen docs 2019-09-15 10:59:03 -05:00
John McFarland
1ac371369e Reformat tag lists in doxygen documentation
Reformat the tables of unsupported and ignored tags.  Previous table
format was not maintainable.  Changing to use multi-column lists, so
that entries can be easily sorted and updated.  The displayed order is
now by row instead of by column, which is decidedly easier to read.
Other than removing duplicates, no change to content.
2019-09-15 10:57:58 -05: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
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
569ac5ec4f Handle doxygen code command with language option
Previously, code blocks were always written to the pydoc output with
"code-block:: c++", and use of language options (e.g., \code{.py}) was
not supported.  Now the option provided to the doxygen code command is
checked, and several basic cases are handled (python, java, and c),
defaulting otherwise to C++ as before (handling for additional cases
can easily be added).
2019-08-07 16:55:38 -05:00
John McFarland
fcf30940cd Improve doxygen parser handling of \code content
Set the m_isVerbatimText flag in the parser for code commands.  This
allows some additional special characters to appear within the code
block (in particular, the ">" character).
2019-08-07 16:55:35 -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
John McFarland
eb11c025c7 Support doxygen \param[] commands
Recognize \param[in], \param[out], and \param[in,out].  Currently they
are all treated the same as \param, but the information is now
available for inclusion in the translated comments.  This is done
using new utility functions getBaseCommand and getEndOfWordCommand,
which will also generalize to treatment of code command options,
e.g. \code{.py}.  Preliminary treatment of the extended version of
\code is already in place in these functions.

Added examples of all three new \param commands to the
doxygen_translate_all_tags test and updated the python and java
expected output.
2019-08-07 16:42:24 -05:00
William S Fulton
87bf8ae7aa
Merge pull request #1604 from vadz/init-doc
Correct %init documentation for C#/Java
2019-08-01 19:58:03 +01:00
William S Fulton
3cc4b21163 Parameter name expansion fix for template functions.
Fix regression in 4.0.0 where a template function containing a parameter
with the same name as the function name led to the parameter name used in the
target language being incorrectly modified.

Closes #1602
2019-08-01 19:46:16 +01:00
William S Fulton
0d76eb3b56 The errors testcases use -module to obtain a unique module name
Fixes parallel make where each invocation of swig was writing and
deleting the same file resulting in lots of the newly introduced
warning messages:

  On exit, could not delete file xxx.py: No such file or directory
2019-07-31 00:08:49 +01:00
William S Fulton
2cf075558c Replace all exit() with SWIG_exit()
For consistent cleanup on error
2019-07-31 00:08:49 +01:00
William S Fulton
b36ae64185 Remove all generated files on error.
Previously generated files were not removed,
potentially breaking Makefiles using file dependencies, especially when
-Werror (warnings as errors) was used.
2019-07-31 00:08:49 +01:00
William S Fulton
f69da524f0 Exit code change when using -Werror
Exit code is now sum of all errors, not just warnings as errors.
I'm can't think why the exit code wasn't like this in the first
place.
2019-07-31 00:08:49 +01:00
William S Fulton
98f29f8ad9 Remove deprecated DohClose in DOH 2019-07-31 00:08:49 +01:00
Vadim Zeitlin
a4432a68da Correct %init documentation for C#/Java
For these languages, %init doesn't inject the code into the
initialization function (because there is none), but just puts it into
the global scope instead.

[skip ci]
2019-07-30 21:12:04 +02:00
William S Fulton
753c50afd7 Update docs on %typecheck precedence levels 2019-07-25 18:57:10 +01:00
William S Fulton
15a0681b11 Add note about wchar_t marshalling fix required for Windows 2019-07-25 18:57:10 +01:00
Vadim Zeitlin
0ff6893b2d Make Python module source non-executable again
0f88f9997c (probably accidentally) changed
this file to be executable, undo this as it doesn't make sense for a
source file to have this mode.

See #1242.
2019-07-24 20:10:35 +02:00
William S Fulton
c7aae28a99 Remove failing wchar c# test 2019-07-24 08:35:13 +01:00
William S Fulton
10f0329e4b Add changes entry for C# std::wstring marshalling fix 2019-07-23 22:16:04 +01:00
William S Fulton
55b5552a6a More C# wstring testing 2019-07-23 19:57:06 +01:00
William S Fulton
2d36b3468a More C# wstring testing 2019-07-23 19:41:25 +01:00
William S Fulton
eb6efdb60b C# wstring testing
Test code from issue #1530
2019-07-23 19:10:35 +01:00
smithx
03f7745364 fix undesirable wstring encoding at return value marshalling for C# 2019-07-22 19:11:21 +01:00
smithx
8f6d97ab8c fix undesirable wstring encoding at return value marshalling for C# 2019-07-22 19:11:21 +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
5131096b80 li_std_wstring test rename to li_std_wstring_inherit
This testcase was only run in Ruby and Python and implements an
obscure feature where a C++ class inherits from a std::wstring.

The li_std_wstring test is left in place to be modified in next commit
for more regular wstring testing across all languages.
2019-07-18 19:49:50 +01:00
William S Fulton
d6ec7eb278 Update changes file with recent Python improvements 2019-07-18 07:59:34 +01:00
William S Fulton
835c732506 Merge branch 'py3.8'
* py3.8:
  Use PyObject_GC_UnTrack in lieu of the old variant
2019-07-18 07:55:33 +01:00
William S Fulton
c8b1eed8ce Merge branch 'annotation_quoting'
* annotation_quoting:
  Examples: Unify string quoting in the Python sources
  Test-suite: Unify string quoting in the Python sources
  Tools: Unify string quoting in the Python sources
  Generator: Unify string quoting in generated Python sources
  Generator: Remove trailing whitespaces in the Python module
2019-07-18 07:23:06 +01:00
Christian Kellner
db9822788e Use PyObject_GC_UnTrack in lieu of the old variant
The _PyObject_GC_UNTRACK[1] macro got deprecated in 3.6 and finally
removed in 3.8. Therefore use PyObject_GC_UnTrack instead.

[1] https://docs.python.org/3/c-api/gcsupport.html#c._PyObject_GC_UNTRACK
2019-07-17 11:15:17 +02:00
William S Fulton
53b425b638 Merge branch 'bugfix/616-csharp-bool-array'
* bugfix/616-csharp-bool-array:
  Add changes entry to fix C# bool[]
  Quieten failing bool[] testcase message
  Skip failing bool[] test cases when running under mono
  Change C# bool[] typemaps to marshall as 1-byte
2019-07-16 19:51:32 +01:00
William S Fulton
a7fa720c1f Add changes entry to fix C# bool[] 2019-07-16 19:50:35 +01:00
William S Fulton
fc9c37192b Quieten failing bool[] testcase message 2019-07-16 19:46:32 +01:00
Gareth Francis
15ad67c37f Skip failing bool[] test cases when running under mono 2019-07-15 16:08:31 +01:00
Dmitry D. Chernov
f88ba7c182 Examples: Unify string quoting in the Python sources 2019-07-14 14:12:23 +10:00
Dmitry D. Chernov
fa5f519bf9 Test-suite: Unify string quoting in the Python sources 2019-07-14 12:58:21 +10:00
Dmitry D. Chernov
c4ad3480bd Tools: Unify string quoting in the Python sources 2019-07-14 11:15:36 +10:00
Dmitry D. Chernov
c20b6f5b0e Generator: Unify string quoting in generated Python sources 2019-07-14 11:08:17 +10:00
Dmitry D. Chernov
9f79fb5216 Generator: Remove trailing whitespaces in the Python module 2019-07-14 11:06:10 +10:00
William S Fulton
1e11085d5f Fix testcase warning for languages that don't fully support nested classes 2019-07-12 08:26:26 +01:00
William S Fulton
7cc5307199 Add changes entry for std::set primitive types fix 2019-07-12 08:17:52 +01:00
William S Fulton
1e66c13abd Merge branch 'csharp-set-fixes'
* csharp-set-fixes:
  Fix std::vector<> Java typemaps for primitive types
  Allow std::set<> C# typemaps to work for non-nullable types too
  Replace leftover string with the proper type in C# set typemap
2019-07-12 08:13:19 +01:00
William S Fulton
eefbeb7505 Add changes entry for trailing enum fix 2019-07-12 07:44:31 +01:00
Vadim Zeitlin
c321aca2b4 Fix missing value for first item of enums with trailing comma
The value of the first item of an enum with a trailing comma after its
last item was not correctly initialized to 0 any more after the changes
of 74adaa5738 (see #1515) because "_last"
attribute was not set correctly in this case.

Do set it for the last item when it's followed by a comma too and add
more unit tests checking for this.

Closes #1566.
2019-07-11 17:15:38 +02:00