Commit graph

106 commits

Author SHA1 Message Date
William S Fulton
ed333b6b97 std::string throws typemaps
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
2022-09-19 09:09:29 +01:00
William S Fulton
4a29229bab Add catches_strings test to test throws char * typemap 2022-09-19 09:09:29 +01:00
William S Fulton
e97181ebc0 Add missing typecheck typemaps for std::auto_ptr and std::unique_ptr
To fix overloading when using these types.
2022-09-17 10:23:51 +01:00
William S Fulton
dad7c93ca0 Provide SWIGTYPE MOVE typemaps in swigmove.i
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
2022-09-16 08:36:25 +01:00
William S Fulton
2212af3f4f rvalue reference outputs
Document rvalue reference outputs behaviour
Test rvalue reference outputs
2022-09-08 08:46:32 +01:00
William S Fulton
7934561874 Test/fixes to handle NULL pointer for unique_ptr/auto_ptr
Also add missing unique_ptr tests for Lua and Racket.
2022-08-31 19:42:55 +01:00
William S Fulton
e139a36511 SWIGTYPE && input typemaps now assume object has been moved
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
2022-08-31 19:40:14 +01:00
William S Fulton
41fddf61ec Add Lua support for std::unique_ptr and std::auto_ptr
Equivalent to Python/Ruby implementations.
2022-08-11 21:38:21 +01:00
Olly Betts
07f0b732ba Add machinery for C++14, C++17 and C++20 testing
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.
2022-07-26 15:28:51 +12:00
Erez Geva
5851eb09a2 Add Lua test for argcargv.i
Signed-off-by: Erez Geva <erezgeva2@gmail.com>
2022-05-10 20:13:55 +02: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
Olly Betts
b127e11f1e Fix typos in docs and comments 2022-02-27 18:15:46 +13:00
Dimitris Apostolou
40c3bf30b2 Fix typos 2022-02-10 16:12:24 +13:00
William S Fulton
99954d6d4e Shorten testcase variable names for Scilab 6 to work 2021-11-15 22:45:56 +00:00
William S Fulton
4b64becbbb OUTPUT typemaps on methods that don't return void
SWIGJSC_ValueIsArray could be implemented by JSValueIsArray in later
versions of Javascript webkit, similar fix to previous commits for v8.

Enhance testing of OUTPUT typemaps to test more than one output.
2021-03-01 14:20:18 +00:00
Ryan Nevell
18608816db Clean up test cases 2020-02-17 09:16:42 -08:00
Ryan Nevell
33c59614fc Fix unwrapping of LUA lightuserdata type. Add test case. 2020-02-17 09:16:24 -08:00
William S Fulton
cd7772a274 Fix overloading for non-pointers and NULL - Lua 2018-12-30 10:54:53 +00:00
luz.paz
ed28e7cbe2 Misc. typo and whitespace fixes
Found via `codespell -q 3 -L "uint,bae,objext,cmo,goin,struc,ois,upto"`
whitespaces were unintentionally fixed due to my editors settings.

Rebased patch #1327
2018-09-19 20:29:14 +01:00
luz.paz
60dfa31a67 Misc. typos
found via `codespell` and `grep`
2018-05-17 10:04:23 -04:00
William S Fulton
f4644d7c30 Run overload_complicated testcase
Was marked as broken, seems to work now
2017-10-04 20:43:44 +01:00
William S Fulton
67edda3bf5 Remove unused cvsignore target 2017-03-10 23:25:31 +00:00
Paweł Tomulik
350d43d988 handle const pointers to functions 2016-03-24 10:59:23 +01:00
Alexander Warg
be907f96e0 Add test case for Lua __getitem + inheritance 2016-03-17 07:48:01 +01:00
William S Fulton
9600c95234 Duplicate tests that are run twice as both C and C++ tests to fix parallel make: li_carrays 2016-02-21 18:04:04 +00:00
William S Fulton
78b113558f Duplicate tests that are run twice as both C and C++ tests to fix parallel make: keyword_rename 2016-02-21 18:04:04 +00:00
William S Fulton
ca64b06229 Consistent quoting in Makefile 2015-08-21 22:48:34 +01:00
Nils Gladitz
ca208cfe35 lua: push characters as unformatted 1-character strings
Since Lua 5.3 the "%c" format character in lua_pushfstring will produce
the string "<\XXX>" (XXX being a decimal code sequence) when
given unprintable characters.

Use lua_pushlstring instead to reproduce the old behavior.
2015-07-01 12:24:12 +02:00
William S Fulton
be272ff8cd Add c++11 strongly typed enum support for Lua 2014-11-28 07:47:45 +00:00
William S Fulton
c17f77750a Merge pull request #176 from v-for-vandal/lua_eq
Add default __eq implementation for Lua
2014-06-02 19:52:07 +01:00
Karl Wette
3fe1eb7056 Set SRCDIR when calling test-suite clean targets, in case it's needed 2014-05-29 02:29:27 +02:00
Artem Serebriyskiy
46d7645c9a More tests for equality operator overloading 2014-05-28 22:02:47 +04:00
Artem Serebriyskiy
2b4c49d017 Add default __eq implementation
* Renamed SWIG_Lua_equal to SWIG_Lua_class_equal
* If class has no __eq implemented, then default __eq is provided.
  Default __eq compares actual pointers stored inside Lua userdata
2014-05-28 22:01:23 +04:00
Olly Betts
def3c08943 Fix comment typos 2014-05-18 20:20:30 +12:00
William S Fulton
2b5499a262 Slight simplification of test-suite build for new out-of-source changes
Provide default SRCDIR and SCRIPTDIR variables in common.mk and override
only where needed.
2014-05-15 23:11:07 +01:00
Karl Wette
f574a34155 Allow examples and test-suite to be built out of source tree
- Examples/Makefile.in rules use SRCDIR as the relative source directory

- ./config.status replicates Examples/ source directory tree in build
  directory, and copies each Makefile to build directory, prefixed with
  a header which sets SRCDIR to source directory

- Examples/test-suite/.../Makefile.in set SRCDIR from Autoconf-set srcdir

- Examples/test-suite/errors/Makefile.in needs to filter out source
  directory from SWIG error messages

- Lua: embedded interpreters are passed location of run-time test

- Python: copy run-time scripts to build directory because of 2to3
  conversion; import_packages example copies __init__.py from source
  directory; test-suite sets SCRIPTDIR to location of run-time tests

- Javascript: binding.gyp renamed to binding.gyp.in so that $srcdir
  can be substituted with SRCDIR; removed './' from require() statements
  so that NODE_PATH can be used to point Node.js to build directory
2014-05-11 23:21:10 +02:00
Karl Wette
d5b765d388 Whitespace cleanup of all Makefiles*
- some of the %.clean rules in the test-suite Makefiles were using a single tab
  as an empty rule, dangerous! I've replaced these with the safer '@exit 0'.
2014-05-02 20:06:11 +02:00
William S Fulton
80953ccfc9 Fix some typos 2014-05-01 18:49:42 +01:00
Artem Serebriyskiy
7c8405368e Finish implementation with proxy functions 2014-04-15 03:38:45 +04:00
William S Fulton
2071b7d157 Lua test-suite can now be run out of source 2014-04-01 19:33:20 +01:00
Artem Serebriyskiy
f2c410a8c0 Fixing issue 152 2014-03-23 14:05:05 +04:00
Artem Serebriyskiy
ddbf439db9 Working around some of the SWIG internal issues with enums 2014-03-12 18:00:15 +04:00
Artem Serebriyskiy
3028b16cee Partially disabling old names generation for classes with nspace 2014-03-06 15:24:17 +04:00
Artem Serebriyskiy
1898099620 Fixing enums 2014-03-03 09:54:13 +04:00
William S Fulton
c36800713b Use unix fileformat 2014-02-27 20:12:53 +00:00
William S Fulton
1be97ed26c Merge Lua changes - branch 'class_p1' of github.com:v-for-vandal/swig into v-for-vandal-class_p1
* 'class_p1' of github.com:v-for-vandal/swig:
  Fixing registerClass. No more wrap: unnecessary attributes
  Fixed registerMethod to work like registerVariable
  Switched to Swig_name_* functions
  Return MIN_OPT_LEVEL for elua
  add nspace_extend test case
  updated documentation following comd options renaming
  Options in alphabetical order
  Members renaming
  target_name -> lua_name
  Fixing cmd options, again
  Fixing segfault
  Removed class_parent_nspace
  Fixes to module options
  Rename methods to make it clear what 'symbols table' they operate on.
  Small documenation fixes
  Updating Lua documentation
  Eliminating namespaces_hash and using symbols table instead
  Attempt to catch unreproducable bug from Travis CI build
  Small bugfixes
  Bugfixes for eLua. eLua emulation mode
  Add compatibility option for old-style inheritance
  Add support for C-style enums in C mode. And tests.
  Style fixes. Comments fixes. Fixing cmd options. etc
  Some fixes for elua
  Attempt to fix unreproducable bug (from Travis CI build)
  Fixes for examples. Wrapped keywords into guardian in keyword_rename test
  Remove some typos
  Remove some obsolete code
  Manually beautifying luarun.swg
  Code beautifier
  Valuewrapper test
  Removing obsolete debug code
  Bugfixes
  A few bugfixes
  Some class bases iteration improvements
  Fixes for elua
  Bugfixes
  Bugfixes. CMD args handling. Code cleanup
  Bugfixes
  Preparations before pull request - part 1
  More changes. Mostly to the would-be class library
  Fixing issuse with v2-compatible static function names
  Add pointer guard
  Add runtime test
  Bugfixes
  nspace.i example is working
  Initial implementation - everything compiles but might not work
2014-02-27 20:04:08 +00:00
Artem Serebriyskiy
d1bfd8a517 add nspace_extend test case 2014-02-23 14:23:55 +04:00
Olly Betts
2f3bf144c6 Fix assorted comment and documentation typos 2014-02-23 17:15:22 +13:00
Olly Betts
1097fc99ff [Lua] Add keyword warnings for Lua keywords and Basic Functions. 2014-02-19 23:04:40 +13:00
Artem Serebriyskiy
705beb6753 Bugfixes for eLua. eLua emulation mode 2014-02-19 13:34:49 +04:00