* commit '8245277ad3':
Remove test for unsupported complex or _Complex by itself
More C99 complex fixes, plus Python tests
Restore _Complex as standalone type
Small corrections for handling C99 _Complex
Properly handle C99 complex types even in C++ mode
Conflicts:
Examples/test-suite/python/complextest_runme.py
* remove-dependency-on-2to3:
Remove need for Python 2to3
Modify examples to be both Python 2 and 3 compatible
Remove python3 specific runme3.py test files
Convert python tests using 2to3
Convert python test scripts to be Python 2 and 3 compatible
Convert swigobject python test to be python 2 and 3 compatible
Convert two tests to work with both Python 2 and 3
Improve director_exception Python test
Remove further print statements from Python tests
Improve Python testing catching exceptions
Improve contract Python testcase testing
Remove print statements from Python tests
All Python examples and tests have been written to be both Python 2 and Python 3
compatible, removing the need for 2to3 to run the examples or test-suite.
The 2to3 executable is not always available and even when available does not
always work, e.g. with pyenv. An alternative would be to use the lib2to3 Python
module instead, but this isn't available in some older versions of Python 3.
I had this problem on Ubuntu Bionic on Travis:
checking Examples/python/callback
pyenv: 2to3-3.8: command not found
The `2to3-3.8' command exists in these Python versions:
3.8
3.8.1
Reference issues:
https://github.com/pypa/virtualenv/issues/1399https://travis-ci.community/t/2to3-command-not-found-in-venv-in-bionic/4495
This error is given for any use of variable called "l" (and also "I" and
"O", but we don't seem to have any of those) and it doesn't seem to be
worth changing this variable name in the tests code, as it's really not
that meaningful there anyhow, so just disable the warning to let the CI
builds, which now use pycodestyle 2.6, instead of 2.5 which didn't have
this error and which is still the latest available in Debian Sid, pass.
The "endlink" command is processed in processWordCommands, which by
default skips space occuring after the command, which is intended for
removing leading space from a command argument. For "end" commands,
we don't want to do this. Note that certain end commands such as
"endcode" aren't processed by processWordCommands (believe
addCommandUnique ends up handling them).
Update usage of \link in doxygen_translate_all_tags.i to test handling
of space after \endlink.
Tweaking some of the usage in doxygen_misc_constructs.i to remove what
seems to be an extra space from the input (otherwise we would need to
add an extra space to the expected output).
In addition to the changes in the previous commit, also avoid syntax
errors in the generated Python docstrings by splitting them into several
parts if there are 3 quotes in a row in the input, as it's impossible to
have them inside triple-quoted strings, generally speaking (i.e. if
there are occurrences of both """ and ''' inside the string).
Single-line Doxygen comments ending with a double quote resulted in
syntactically-invalid Python docstrings in the output, so use triple
single quotes as delimiters in this case to avoid it.
This test code tests the upcast code:
swig_assert_equal_simple(-1, base_num2([Derived(7)]))
Although there is no explicit memory leak fix test, it does at least run the code.
Handling of None needs fixing in Python (it is working in Ruby)
Note that the Ruby implementation has a partial template specialization
for shared_ptr, whereas the Python implementation is in the generic
code!
Issue #1512
Don't attempt to use the class's __dict__ for setting 'this' when
a user has extended a class with:
__slots__ = ['this'].
Was segfaulting. Now we fall back to a simple PyObject_SetAttr if the
usual approach to setting 'this' in __dict__ does not work.
Closes#1673Closes#1674
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.
* 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
* 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
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
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.
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
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.
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.
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).