Commit graph

22,763 commits

Author SHA1 Message Date
sethg
ae0e62dd1a Test using version rather than help 2022-08-20 16:02:45 +02:00
sethg
dbebb2dac8 Add GitHub Action to test Windows builds using Nuget as described in the docs 2022-08-20 15:54:27 +02:00
sethg
e60a02941f Update Windows CMake builds to use NuGet package for PCRE2 2022-03-31 19:08:46 +02:00
William S Fulton
e4c972c328
Merge pull request #2239 from igt-gteubl/csharp-capacity-cs0034
C#: Fix CS0034 in Capacity method of std::vector
2022-03-30 20:04:08 +01:00
William S Fulton
4c07441549 GHA: MzScheme go back to c++98 testing
MzScheme headers have a problem when using -Werror that the test-suite uses:

/usr/include/racket/sconfig.h:126:43: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix]
  126 | #  define SCHEME_PLATFORM_LIBRARY_SUBPATH "x86_64-"SPLS_LINUX
2022-03-29 09:01:18 +01:00
William S Fulton
0b15740663 Fix warning in D test-suite 2022-03-28 19:30:47 +01:00
William S Fulton
8be06d0e8c Correct MzScheme and OCaml GHA testing 2022-03-28 19:25:17 +01:00
William S Fulton
e1e4e4df28 Add rvalue reference typemaps for D 2022-03-28 19:25:17 +01:00
William S Fulton
2ded25d138 Fixes for ISO C89 2022-03-28 19:25:11 +01:00
William S Fulton
5cc4591ae7 Consistent cpp11 testing in test-suite
Move HAVE_CXX11 into makefiles so that running test-suite
from top level directory or in the language's test-suite directory
is consistent. For example, running 'make check-java-test-suite'
behaves the same as 'cd Examples/test-suite/java && make check'.
2022-03-27 19:34:20 +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
cbd9bd6d71 Fix running make-cpp11 for ocaml 2022-03-27 16:43:30 +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
f44153069b Ocaml test-suite '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 13:50:30 +01:00
William S Fulton
a71c318b06 Stop testing two recently failing ocaml tests
Problem here seems to be one also affecting other ocaml broken tests:
1. Enum value names should be using sym:name not name (ie %rename is broken for ocaml enum items)
2. directorin typemaps are not correct
2022-03-27 13:33:02 +01:00
William S Fulton
ffe2f85417 go_multicpp_setup make function correction 2022-03-27 12:44:19 +01:00
William S Fulton
c5f209706e Further makefile refactoring for multicpptests 2022-03-27 11:27:58 +01:00
William S Fulton
d1b93f2c0e Merge branch 'feature/python-builtin-separate-runtime-data'
* feature/python-builtin-separate-runtime-data:
  Rework swig_and_compile_multi_cpp makefile helper
  Different capsule names for builtin changes entry
  Use different capsule names with and without -builtin

Conflicts:
	CHANGES.current
2022-03-26 15:18:55 +00: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
William S Fulton
3ab288dfa4 Different capsule names for builtin changes entry 2022-03-26 15:06:13 +00:00
William S Fulton
5c68705a21 Comment broken part of using_member.i 2022-03-26 12:03:09 +00:00
William S Fulton
51a7f27d1c Minor fix to Swig_print_node 2022-03-25 23:44:07 +00:00
William S Fulton
1db04bf322 Improvements to the -debug command line options
The debug command line options that display parse tree nodes
(-debug-module, -debug-top, -debug-symtabs) now display previously hidden
linked list pointers which are useful for debugging parse trees.

Added new command line option -debug-quiet. This suppresses the display
of most linked list pointers and symbol table pointers in the parse tree nodes.

The keys in the parse tree node are now shown in alphabetical order.
2022-03-25 23:34:52 +00:00
William S Fulton
b737a64ec5 Remove minimum Python version check
The version checking was historically done to deal with
different versions and importing the low-level Python
module. Then it was used to try and help when using -py3.
A minimum version check implies that the wrappers work
with any version >= 2.7, which is not really correct.
The correct thing to do is to check that the exact
version used matches the one that the C layer was compiled
against, which can only be left for the user to do, perhaps
using %pythonbegin.

Issue #1779
2022-03-25 19:09:17 +00:00
William S Fulton
469f694ae6 Fix using declaration in derived class bugs
Problem when all the base class's overloaded methods were
overridden in the derived class - fixes "multiply defined" errors.

Linked lists of the overloaded methods were not set up correctly
when handling the using declaration.

Closes #2244
2022-03-24 20:52:58 +00:00
William S Fulton
a343b7e254 Remove -py3 command line option
Closes #1779
2022-03-23 18:13:07 +00:00
William S Fulton
df86fbc54e Remove option to use Python 3 only syntax for %pythonnondynamic feature
A metaclass is added using a decorator @_swig_add_metaclass which
is designed to provide a metaclass that works for both Python 2 and Python 3.
The option to use the Python 3 only syntax: metaclass=_SwigNonDynamicMeta
via the -py3 command line option has been removed as part of a
simplification to remove the -py3 option.

Issue #1779
2022-03-23 07:58:39 +00:00
William S Fulton
f068f2c2d6 Add Python < 3.3 support for pyabc.i
pyabc.i for abstract base classes now supports versions of Python
prior to 3.3 by using the collection module for these older versions.
Python-3.3 and later continue to use the collections.abc module.
The -py3 option no longer has any effect on the %pythonabc feature.
2022-03-23 07:58:01 +00:00
William S Fulton
9fd2356104 Merge branch 'flatstaticmember'
* flatstaticmember:
  Test -flatstaticmethod and %extend
  Python -flatstaticmethod corrections
  Enable flat static constructor methods
  Move low level static methods
  Use flat static method if it's a "friend"
  Python: Option to generate flat class methods
2022-03-21 19:28:52 +00:00
William S Fulton
2c6e7f99a6 Test -flatstaticmethod and %extend 2022-03-21 19:23:15 +00:00
William S Fulton
21c2e47661 Python -flatstaticmethod corrections
Correct logic for suppressing static methods.
Previous logic was missing director disown methods.
Add changes file entry for -flatstaticmethod.

Closes #2137
2022-03-21 19:22:49 +00:00
Olly Betts
b2c58115d7 Fix previous commit
Revert changes inadvertently included, and fix `=` to `==`.
2022-03-20 19:44:23 +13:00
Olly Betts
029ddab8b5 [ci] Try to fix failing appveyor python builds 2022-03-20 18:42:50 +13:00
Ian Lance Taylor
90aa3f75ba [Go] Implement %extend base methods in child classes.
Fixes #337
2022-03-18 18:34:28 -07:00
Olly Betts
96b2915960 [ci] appveyor.yml: Only set PY3 if SWIGLANG is python
See #2235
2022-03-19 09:06:50 +13:00
Olly Betts
a0e3825de6 Fix replace handling corner case
With flags DOH_REPLACE_ID_BEGIN, DOH_REPLACE_ID_END and
DOH_REPLACE_NUMBER_END the code looked for a match for the token
string using strstr() and then checked the extra condition - if the
extra condition didn't apply it then advanced by the length of the token
before searching again.

However that can miss matches if the strstr() matches can overlap
one another, so only advance one position, which is conservative
but can't miss matches.

For example this would not match before:

Replace("123123", "1231", r, DOH_REPLACE_NUMBER_END);

This issue seems to be entirely latent in the current SWIG codebase
due to the nature of the token strings passed when using these flags.

See #2235
2022-03-19 08:55:39 +13:00
Olly Betts
9ab3ef8e96 Update testcase comment 2022-03-19 08:55:39 +13:00
Olly Betts
d7e83c1cbc Fix checking of "optimal" typemap attribute
Previously SWIG checked that the typemap action contained ";\n" not
followed by an identifier character, and that it contained no other
`;`, but that incorrectly allows some cases it shouldn't.

Instead check that the action ends with `;\n` and contains no other
`;`, which is simpler and correctly rejects these cases.
2022-03-19 08:13:09 +13: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
Jim Easterbrook
b8f10a55f9 Enable flat static constructor methods
These are needed to provide renamed overloaded constructors and the
like.
2022-03-18 11:10:14 +01:00
Jim Easterbrook
3cfc26bc30 Move low level static methods
Like the non-static methods these are no longer present when using
-builtin
2022-03-18 11:10:14 +01:00
Jim Easterbrook
63ef91939b Use flat static method if it's a "friend"
This allows the friends test case to pass, with or without -builtin.
2022-03-18 11:10:14 +01:00
Julien Schueller
484e5316f2 Python: Option to generate flat class methods 2022-03-18 11:10:14 +01:00
gteubl
8a6290b12f Fix CS0034 in Capacity method of std::vector 2022-03-18 08:01:37 +01:00
Olly Betts
a6eae77dd5 Fix module example so generated code compiles
Fixes https://sourceforge.net/p/swig/bugs/1141/
2022-03-18 19:26:16 +13:00
Seth R. Johnson
8f9a432040
Update python manual scripts to py3 compatibility (#2204) 2022-03-18 13:29:22 +13:00
Olly Betts
23fa9804c8 Clarify messages where "Python" means 2.x
See #2235
2022-03-18 10:23:17 +13:00
William S Fulton
06364ae749 Merge remote-tracking branch 'wsfulton/appveyor-vs2022'
* wsfulton/appveyor-vs2022:
  Cygwin testing - test python3 (3.9) instead of python-2.7
  Last resort to use /usr/lib in python linking
  mingw - install python from pacman
  Fix detection of python .lib file for 2 digits in minor version
  cpp11_result_of testcase and result_of deprecation in c++17
  Testcase correction for using declaration and members
  Fix compiler warning using Java std::wstring
  Appveyor changes to use Visual Studio 2022 image
2022-03-17 08:23:13 +00:00
Olly Betts
bb5cd94cad Fix GCC warning from recent -intgosize change
Modules/go.cxx:247:10: warning: variable ‘display_help’ set but not used [-Wunused-but-set-variable]
  247 |     bool display_help = false;
2022-03-17 18:55:31 +13:00
Olly Betts
c7af8eabb3 Default to running tests with Python 3
Specify PY2=1 to use Python 2.

See #1779
Closes #2235
2022-03-17 18:55:10 +13:00