summaryrefslogtreecommitdiff
path: root/Examples/test-suite/python
Commit message (Collapse)AuthorAgeFilesLines
* Remove obsolete debug line from callback_runme.pyOlly Betts2023-05-171-1/+0
| | | | We stopped wrapping C++ static method A::bar as A_bar in SWIG 4.1.0.
* Add li_constraints test, testing 'constraints.i'.Erez Geva2023-05-121-0/+54
| | | | | | For: JavaScript, C#, go, Java, Lua, Perl, PHP, python, Ruby, TCL and Octave. Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
* Merge branch 'python-iterator-protocol'William S Fulton2023-04-265-40/+42
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * python-iterator-protocol: Finish removal of SwigPySequence_Cont Remove undocumented and non-existent STL std::carray Remove assign method uses by the removed Python Sequence Protocol Remove now redundant use of Python Sequence protocol in STL wrappers Add support for all STL containers to be constructible from a Python set Iterator Protocol support for std::array wrappers STL support for copying Python objects supporting Iterator protocol Closes #2515 Conflicts: CHANGES.current
| * Remove undocumented and non-existent STL std::carrayWilliam S Fulton2023-04-262-40/+0
| |
| * Add support for all STL containers to be constructible from a Python setWilliam S Fulton2023-04-263-0/+42
| |
* | Adjust new testsOlly Betts2023-04-191-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | Add a regression test based on https://sourceforge.net/p/swig/bugs/1163/ since this patch solves that case too. Replace the __attribute__ test case from #2525 with a variant of the 1163 regression test, since __attribute__ is specific to certain compilers. Adjust the self-referential test case to actually work - it wasn't valid C code before.
* | actually test the valueMomtchil Momtchev2023-04-141-0/+3
|/
* Instantiation of C++11 variadic function templatesWilliam S Fulton2023-01-031-0/+20
| | | | | | Complete support for C++11 variadic function templates. Support was previously limited to just one template parameter. Now zero or more template parameters are supported in the %template instantiation.
* Support multiple arguments in variadic templates.William S Fulton2022-12-221-0/+152
| | | | | | | Remove warning SWIGWARN_CPP11_VARIADIC_TEMPLATE which was issued if more than one argument was used for a variadic template. SwigType enhancement: 'v.' now represents a variadic argument.
* Improved template template parameters support.William S Fulton2022-12-021-2/+5
| | | | | | | | | | | | Previously, specifying more than one simple template template parameter resulted in a parse error. Now multiple template template parameters are working including instantiation with %template. Example: template <template<template<class> class, class> class Op, template<class> class X, class Y> class C { ... }; Closes #624 Closes #1021
* Test cases fixWilliam S Fulton2022-11-261-4/+4
|
* Slightly better decltype() support for expressionsWilliam S Fulton2022-11-261-4/+4
| | | | | | | | | | | | | | | | | decltype now accepts C++ expressions instead of just an ID, such as: int i,j; ... decltype(i+j) ... ... decltype(&i) ... These result in a warning for non-trivial expressions which SWIG cannot evaluate: Warning 344: Unable to deduce decltype for 'i+j'. See 'Type Inference' in CPlusPlus.html for workarounds. Issue #1589 Issue #1590
* Polymorphism in R wrappers fixed for C++ structsWilliam S Fulton2022-10-241-0/+4
|
* Remove some final testingWilliam S Fulton2022-10-061-6/+9
| | | | Given Visual C++ does not work with these tests (tested with VS2022 17.3 and earlier)
* Doxygen Java fix quoting for \image commandWilliam S Fulton2022-10-061-0/+1
| | | | Closes #2048
* Add support for parsing C++11 final classesWilliam S Fulton2022-10-052-0/+68
| | | | | | | | | | | | | | | | | | | Such as: class X final {}; This no longer gives a syntax error. This change has introduced one more shift-reduce conflict in the parser. with a conflict with a C style variable declaration with name final: class X final; resulting in a syntax error (for C++ not C). This is an an unusual style for C++ code and more typical declarations do work: X final; Closes #672
* std::string throws typemapsWilliam S Fulton2022-09-191-0/+10
| | | | | | | Go, Guile, Racket, Scilab: Add throws typemaps for std::string so that thrown string exception messages can be seen. Test all language for std::string throws typemaps
* Add catches_strings test to test throws char * typemapWilliam S Fulton2022-09-191-0/+11
|
* Add missing typecheck typemaps for std::auto_ptr and std::unique_ptrWilliam S Fulton2022-09-172-0/+18
| | | | To fix overloading when using these types.
* Provide SWIGTYPE MOVE typemaps in swigmove.iWilliam S Fulton2022-09-161-0/+29
| | | | | | | | | | | | For implementing full move semantics when passing parameters by value. Based on SWIGTYPE && and std::unique_ptr typemaps which implement move semantics. Added for all languages, but untested for: Go, Ocaml, R, Scilab (and unlikely to be fully functional for same reasons as for std::unique_ptr support). Issue #999
* rvalue reference outputsWilliam S Fulton2022-09-082-9/+25
| | | | | Document rvalue reference outputs behaviour Test rvalue reference outputs
* Temporarily remove rvalue reference python runtime testWilliam S Fulton2022-09-031-4/+5
| | | | Work in progress: SWIGTYPE && out typemaps need to take ownership
* Test/fixes to handle NULL pointer for unique_ptr/auto_ptrWilliam S Fulton2022-08-312-0/+16
| | | | Also add missing unique_ptr tests for Lua and Racket.
* SWIGTYPE && input typemaps now assume object has been movedWilliam S Fulton2022-08-311-0/+52
| | | | | | | | | | | | | | | | | | | | Replicated Java implementation. Fully implemented for: - C# - D - Guile - Javascript (UTL) - Lua - MzScheme - Octave (UTL) - Perl (UTL) - PHP - Python (UTL) - Ruby (UTL) - Tcl (UTL) PHP std::auto_ptr std::unique_ptr minor tweaks and testcase corrections
* Rename debug in testcases to traceWilliam S Fulton2022-08-202-3/+3
| | | | To remove D specific keyword rename
* Correct raw pointer handling test for virtual inheritanceWilliam S Fulton2022-08-112-2/+2
|
* Add raw pointer handling test for virtual inheritanceWilliam S Fulton2022-08-052-12/+26
| | | | | | This is a test added for D in previous commit, now expanded to all target languages. Tidy up counting object instances.
* cpp20_spaceship_operator_runme.py: Check ALIEN valueOlly Betts2022-08-051-1/+1
|
* auto_ptr and unique_ptr test tweaksWilliam S Fulton2022-08-042-2/+4
|
* Fixes for deprecated std::basic_string::reserve()William S Fulton2022-07-311-0/+5
|
* Convert cpp20_spaceship_operator php test to pythonWilliam S Fulton2022-07-311-0/+19
|
* Add tests for binary integer literal constantsOlly Betts2022-07-261-0/+9
|
* Add machinery for C++14, C++17 and C++20 testingOlly Betts2022-07-261-0/+3
| | | | | | | | Support running testcases conditional on the compiler supporting a each language version, like we already handle C++11. Currently no testcases are actually run in this way for these newer language versions.
* Fix friends_runme.*Olly Betts2022-07-221-1/+1
| | | | | | | | | | Most of these test D_d twice when they really should be testing D_d once and D_i once (the variable name is `di` and the values assigned are integers). This was wrong in the initial version for Python in 708021a809a566a410ec0e6bf5c63029392315e1 and it looks like subsequent additions for other languages have just copied that mistake.
* [python] Fix inheriting from multiple director classesOlly Betts2022-07-201-0/+36
| | | | | | | | Fix mishandling of a Python class inheriting from multiple SWIG-wrapped director classes. Fixes #422 Fixes https://sourceforge.net/p/swig/bugs/1379/
* std::unique_ptr std::auto_ptr tidyupWilliam S Fulton2022-07-192-0/+4
| | | | | Add docs on additional support Additional testing for invalid usage for parameter inputs
* Add support for std::auto_ptr inputsWilliam S Fulton2022-07-181-0/+65
| | | | Ported from std::unique, behaviour is identical with regard to memory ownership/handling
* Add Python support for std::unique_ptr inputsWilliam S Fulton2022-07-171-0/+65
| | | | Equivalent to Java/C# implementation.
* Performance optimisation for parameters passed by value that are C++11 movable.William S Fulton2022-07-081-2/+2
| | | | | | | | | | | | | | | The C++ wrappers create a temporary variable for a parameter to be passed to a function. This is initially default constructed and then copy assigned from the instance being passed in from the target language. This is unchanged, however, when the temporary variable is passed to wrapped function, it is now done using std::move. If the type is move constructible, the move constructor will be used instead of the copy constructor. Note that the implementation calls std::move for all user-defined types (non-primitive types passed by value), this excludes anything passed by pointer, reference and arrays. It does also include any type that has not been defined/parsed by SWIG, that is, unknown types. std::move is called via the SWIG_STD_MOVE macro which only calls std::move for C++11 and later code.
* Test copy constructor and assignment operator calls for movable typesWilliam S Fulton2022-07-081-0/+10
| | | | | | This is the current state of play where the copy constructor and copy assignment operators are called, even for movable types passed as function parameters.
* Performance optimisation for directors for classes passed by valueWilliam S Fulton2022-07-041-0/+2
| | | | | | | The directorin typemaps in the director methods now use std::move on the input parameter when copying the object from the stack to the heap prior to the callback into the target language, thereby taking advantage of move semantics if available.
* Add std::unique supportWilliam S Fulton2022-07-021-0/+17
| | | | | | | Simple copy of current auto_ptr support (just suppport for functions returning std::unique_ptr). Closes #1722
* Movable and move-only types supported in "out" typemaps.William S Fulton2022-06-302-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enhance SWIGTYPE "out" typemaps to use std::move when copying objects, thereby making use of move semantics when wrapping a function returning by value if the returned type supports move semantics. Wrapping functions that return move only types 'by value' now work out the box without having to provide custom typemaps. The implementation removed all casts in the "out" typemaps to allow the compiler to appropriately choose calling a move constructor, where possible, otherwise a copy constructor. The implementation alsoand required modifying SwigValueWrapper to change a cast operator from: SwigValueWrapper::operator T&() const; to #if __cplusplus >=201103L SwigValueWrapper::operator T&&() const; #else SwigValueWrapper::operator T&() const; #endif This is not backwards compatible for C++11 and later when using the valuewrapper feature if a cast is explicitly being made in user supplied "out" typemaps. Suggested change in custom "out" typemaps for C++11 and later code: 1. Try remove the cast altogether to let the compiler use an appropriate implicit cast. 2. Change the cast, for example, from static_cast<X &> to static_cast<X &&>, using the __cplusplus macro if all versions of C++ need to be supported. Issue #999 Closes #1044 More about the commit: Added some missing "varout" typemaps for Ocaml which was falling back to use "out" typemaps as they were missing. Ruby std::set fix for SwigValueWrapper C++11 changes.
* Merge branch 'typemap-colon'William S Fulton2022-06-011-0/+5
|\ | | | | | | | | | | * typemap-colon: Incoporate review suggestions Allow referencing of typemap keywords inside of "$typemap("
| * Allow referencing of typemap keywords inside of "$typemap("Seth R Johnson2022-02-251-0/+5
| |
* | Add argcargv test case to test-suiteWilliam S Fulton2022-05-151-1/+0
| |
* | Add C# wchar_t * director typemapsWilliam S Fulton2022-05-041-0/+16
| | | | | | | | More Python std::wstring directors Python testing
* | doxygen_autodoc_docstring test fix for Python builtinWilliam S Fulton2022-04-061-2/+1
| |
* | Temporarily disable doxygen_autodoc_docstring_runme.pyWilliam S Fulton2022-04-061-0/+1
| |
* | Doxygen comments take precedence over the autodoc feature.William S Fulton2022-04-061-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | 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