Commit graph

22,629 commits

Author SHA1 Message Date
William S Fulton
9525d75533 GHA: Tidy up scilab install 2022-02-26 21:07:03 +00:00
William S Fulton
961424a986 Fix line/file info for methods added by using declarations 2022-02-26 20:07:58 +00:00
William S Fulton
eb32a6298d Add omitted testcase cpp_using_rename.i 2022-02-26 20:01:57 +00:00
William S Fulton
f995bad785 Add detailed docs and info on match in %rename 2022-02-26 12:49:07 +00:00
William S Fulton
546062fdf1 Add %rename matching docs and improvements
Add in %$isusing macro for %rename.
Improve docs for %$not and notmatch.
2022-02-26 12:49:07 +00:00
William S Fulton
79a1bbee8b Using declarations in inheritance hierarchy improvements.
- Improved documentation for using declarations.
- Issue new warning WARN_LANG_USING_NAME_DIFFERENT when there
  is a conflict in the target language name to be used when
  introducing a method via a using declaration. Previously
  the method was silently ignored. Issue #1840. Issue #655.
2022-02-26 12:46:06 +00:00
Olly Betts
e36e898c0a
Merge pull request #2205 from swig-fortran/extend-tests
Fix and add additional tests to test suite
2022-02-25 10:16:22 +13:00
Olly Betts
7f37bfe2b5 Mark error messages more consistent
Always include English name of a mentioned character.
2022-02-25 10:07:17 +13:00
Olly Betts
d22b7dfaea scilab.cxx: Fix source code misindentation 2022-02-24 10:45:24 +13:00
Olly Betts
e95af9c474 Merge branch 'scilab-6' of https://github.com/davidcl/swig
Fixes #1751
2022-02-24 10:45:13 +13:00
Olly Betts
4986b8793d Emit preprocessor expr error for unary + on string
Previously other unary operators on a string all gave an error, but
unary + was handled as a no-op and so didn't.
2022-02-24 09:50:22 +13:00
Olly Betts
4db4b999ca Document strings in preprocessor expressions
These appear to have been supported for at least 20 years and are used
in SWIG's library files.
2022-02-24 09:39:21 +13:00
Olly Betts
74d12d8c4c Don't report "Warning 202: Error: ..."
An invalid preprocessor expression is reported as a pair of
warnings with the second giving a more detailed message from the
expression evaluator.  Previously SWIG prefixed the second message
with "Error:" - that was confusing as it's actually only a warning
by default so we've now dropped this prefix.

Before:

x.i:1: Warning 202: Could not evaluate expression '1.2'
x.i:1: Warning 202: Error: 'Floating point constant in preprocessor expression'

Now:

x.i:1: Warning 202: Could not evaluate expression '1.2'
x.i:1: Warning 202: Floating point constant in preprocessor expression

See #1465
2022-02-24 08:40:27 +13:00
Olly Betts
0deb8a855d Add another testcase for #1384
A string in parentheses could be treated as an integer (depending on
the state the stack was left in by previously evaluated expressions).
2022-02-24 08:30:32 +13:00
Olly Betts
81caed4f1d Clean up preprocessor expression evaluation code
Remove redundant code and add/improve comments.
2022-02-24 08:15:07 +13:00
Olly Betts
204a5f7bf3 Fix a preprocessor expression evaluation bug
A subexpression in parentheses lost its string/int type flag and
instead used whatever type was left in the stack entry from
previous use.  In practice we mostly got away with this because
most preprocessor expressions are integer, but it could have
resulted in a preprocessor expression incorrectly evaluating as
zero.  If -Wextra was in use you got a warning:

Warning 202: Error: 'Can't mix strings and integers in expression'

Fixes #1384
2022-02-23 18:53:59 +13:00
Olly Betts
471b9f734e Fix comment and testsuite check message typos 2022-02-23 17:40:09 +13:00
Clément DAVID
5a18105f26 Scilab: describe 6.0 and 6.1 changes 2022-02-21 10:03:00 +01:00
Clément DAVID
62d3bc04ff Scilab - pass tests on 5.5.2, 6.0.2 and 6.1.0 2022-02-21 10:02:03 +01:00
Clément DAVID
f93f8ad1d5 [Scilab] remove targetversion argument
This commit handles multi-version support at runtime, it
fixes:
 * 5.5.2 - with cutted long identifier name
 * 6.0.0 - with full string identifier
 * 6.1.0 - with 1 or 0 output argument

It also improves the codebase by:
 * Using `Char(X)` instead of `DohCheck(X)` and `Data(X)`
 * Using `Len(X)` instead of `strlen()`
 * Correctly detecting old Scilab versions
2022-02-21 10:01:59 +01:00
Clément DAVID
ce6c0c47f6 Add Scilab 5.5.2 6.0.2 and 6.1.0 from upstream
This commit log Scilab version at ./configure to ease maintenance. It
uses Scilab include next to the bin directory which will work for both
system-wide install and binaries from scilab.org.

SCILAB_VERSION is define as an automake variable for easier
failure investigation.

Note: the Ubuntu Scilab version is used when available, in the current
CI config there is:
 * Scilab 5.5 from scilab.org
 * Scilab 6.0 from Ubuntu 18.04
 * Scilab 6.1 from Ubuntu 20.04
2022-02-21 10:01:27 +01:00
William S Fulton
5e85cf617a Fix linker error in constant_expr testcase 2022-02-20 17:57:38 +00:00
William S Fulton
d2e9b80be3 Merge branch 'using-declarations' into upstream-master
* using-declarations:
  Typo fixes
  Fix warning suppression for WARN_PARSE_USING_UNDEF
  Using declarations fix in symbol tables
  Revert recent using-declarations code changes

Conflicts:
	CHANGES.current
2022-02-20 17:04:56 +00:00
William S Fulton
1b0a9ccfc5 Typo fixes 2022-02-20 16:45:11 +00:00
William S Fulton
9b131a03d5 Fix warning suppression for WARN_PARSE_USING_UNDEF
New warnings for unknown using declarations since fix in previous commit
2022-02-20 16:45:10 +00:00
William S Fulton
cb963a1440 Using declarations fix in symbol tables
Implementation is very similar to typedef implementation.
Issue #655 and closes #1488.
Testcase using_member.i.
Better implementation to that reverted in previous commit 3f36157b.
Symbol tables shown with -debug-csymbols and -debug-symbols now correct
and are similar to when using a typedef.
2022-02-20 15:33:32 +00:00
William S Fulton
3f36157b39 Revert recent using-declarations code changes
Reverts code changes from 7b5a615e50
merge commit in preparation for better fix.
Issue #655 and issue #1488.
2022-02-20 11:12:16 +00:00
Olly Betts
1707d6b89b [PHP] Fix cleanup code handling issues
Fix to call cleanup code in exception situations and not to invoke
the freearg typemap twice in certain situations.

Fixes https://sourceforge.net/p/swig/bugs/1211/
2022-02-17 13:52:44 +13:00
Olly Betts
dffa74bbe5 php/cpp_basic_runme.php: Add new class to list 2022-02-16 11:17:51 +13:00
Olly Betts
0b12398b2c Perl.html: Fix incorrect references to python 2022-02-16 11:16:36 +13:00
Seth R Johnson
0268dde201 Extend diamond multi test to fix go 2022-02-15 07:53:46 -05:00
Olly Betts
a7ff0da1f3 Improve parsing of % followed immediately by identifier
If it's not a recognised directive the scanner now emits MODULO and then
rescans what follows, and if the parser then gives a syntax error we
report it as an unknown directive. This means that `a%b` is now allowed
in an expression, and that things like `%std::vector<std::string>` now
give an error rather than being quietly ignored.

Fixes #300
Fixes #368
2022-02-15 15:09:44 +13:00
Olly Betts
fd6c0255a2 Remove superfluous semicolons 2022-02-15 14:00:12 +13:00
Olly Betts
abfd630c6d Remove comment on how to add new target lang
This information really doesn't belong in lua.cxx, and is covered better
in Doc/Manual/Extending.html already.
2022-02-15 10:35:17 +13:00
William S Fulton
8e4868af75 More director const std::string& testing and C# leak fix
Issue #998
2022-02-13 23:00:04 +00:00
Seth R Johnson
8cf62a3325 Remove assertions from python test cases 2022-02-14 10:33:10 +13:00
William S Fulton
88f1389f80 director_property testcase for C# and Java
Testing std::string as director method parameter
2022-02-13 16:08:57 +00:00
Seth R Johnson
b08713f09f Add test of null shared pointers emitted from C++
This tests nulls emitted as pointers and values of shared pointers,
created from null, from references, and from default constructors.
2022-02-12 19:40:03 -05:00
Seth R Johnson
01995ec14f Add test cases for reference/const-reference of integers 2022-02-12 19:40:03 -05:00
Seth R Johnson
47eb9c8078 Extend "ignore" parameter test
- Ensure that `argout` is called even when a parameter is ignored
- Ensure that ignored parameters with default arguments are handled
  correctly
2022-02-12 19:40:03 -05:00
Seth R Johnson
ef112087cc Add test of callback with enum argument
This is an odd use case often with numerical solver flags
that's not covered in the existing test suite.
2022-02-12 19:40:03 -05:00
Seth R Johnson
77cdba81ad Add test case for very simple director classes
Test both abstract and concrete base classes, with simple int/bool data.
This level of complexity is very helpful when setting up director
functionality for a new target language.
2022-02-12 19:40:03 -05:00
Seth R Johnson
266766d7c7 Test identity operation on class references 2022-02-12 19:40:03 -05:00
Seth R Johnson
0da8a9bb44 Test ability to manipulate a daughter class from its base class wrapper
Even in the case of just creating a `DerivedClass` this test says:
```
swig/python detected a memory leak of type 'DerivedClass *', no destructor found.
```
even though the destructor is defined in the base class.
2022-02-12 19:40:03 -05:00
Seth R Johnson
fb0cddfd2b Add C "contract" test
Tests that the `%contract` code (viz., each target language's
implementation of SWIG_contract_assert) compiles in C as expected. Update
the note in the source code since `%contract` is in the official
documentation.
2022-02-12 19:40:03 -05:00
Seth R Johnson
c9fbb81e4a Mark in-header function definitions as "inline"
Otherwise, generating the `clientdata_prop` modules will duplicate symbols,
leading to linker errors if the resulting modules are linked (or possibly
loaded) simultaneously.
2022-02-12 19:40:03 -05:00
Seth R Johnson
a8e73e3ad7 Test scope resolution of global struct A 2022-02-12 19:40:03 -05:00
Seth R Johnson
fc2b90acd1 Add a "diamond" pattern to multi-impmort test
This tests whether multiple modules can correctly import
the same common module.

```
a -> d
  -> b -> c -> d*
```
2022-02-12 19:40:03 -05:00
Seth R Johnson
c2c3f968df "Include what you use" for tests
Using strcpy/strlen in global namespace requires `<string.h>`. Include
explicitly instead of assuming another SWIG or library header brings it
in.
2022-02-12 17:46:20 -05:00
William S Fulton
f32a20fc2f Enhance Python director_property test 2022-02-12 12:17:43 +00:00