Commit graph

4,967 commits

Author SHA1 Message Date
William S Fulton
8587fd7b0d Merge branch 'ZackerySpytz-OCaml-overloaded-bools-typecheck'
* ZackerySpytz-OCaml-overloaded-bools-typecheck:
  [OCaml] Remove the last remnants of libswigocaml
  [OCaml] Fix the handling of bools in overloaded functions
2019-01-19 23:06:56 +00:00
William S Fulton
65cab79071 Merge branch 'ZackerySpytz-OCaml-dead-code-overloaded-funcs'
* ZackerySpytz-OCaml-dead-code-overloaded-funcs:
  [OCaml] Fix dead code generation in overloaded function wrappers
2019-01-19 23:03:07 +00:00
William S Fulton
88b83a3a75 Merge branch 'ZackerySpytz-OCaml-fvirtual-overload_polymorphic-runtime-tests'
* ZackerySpytz-OCaml-fvirtual-overload_polymorphic-runtime-tests:
  [OCaml] Runtime tests for fvirtual, overload_polymorphic and some others
2019-01-19 23:00:18 +00:00
William S Fulton
8e1893f355 D warning suppressions in autodoc testcase 2019-01-19 19:52:40 +00:00
William S Fulton
721f6ddef1 Add autodoc and keyword argument tests 2019-01-19 19:52:40 +00:00
William S Fulton
1329ed7a5c Suppress rename warnings when parameter names are keywords
Parameter renaming is not fully implemented. Mainly because there is no
C/C++ syntax to
for %rename to fully qualify a function's parameter name from outside
the function. Hence it
is not possible to implemented targetted warning suppression on one
parameter in one function.

Issue #1420
2019-01-19 19:52:34 +00:00
Zackery Spytz
b879ccdc3e [OCaml] Fix the handling of bools in overloaded functions
Use the SWIG_TYPECHECK_BOOL precedence level instead of
SWIG_TYPECHECK_INTEGER when checking for bools.

Add a runtime test in the form of overload_bool_runme.ml.
2019-01-18 23:42:59 -07:00
Zackery Spytz
f71ee5be67 [OCaml] Runtime tests for fvirtual, overload_polymorphic and some others
Add runtime tests for conversion, extend_typedef_class,
extend_constructor_destructor, fvirtual, overload_polymorphic,
template_rename, and using1.
2019-01-17 15:58:48 -07:00
William S Fulton
2e9b270cbb Merge branch 'vadz-better-param-names'
* vadz-better-param-names:
  Enable keyword arguments for keyword_rename unit test
  Update error messages test suite
  Add more tests for Python parameter renaming
  Improve handling parameters clashing with language keywords
2019-01-17 18:19:36 +00:00
Zackery Spytz
fa1a0a378c [OCaml] Fix dead code generation in overloaded function wrappers
The OCaml module was generating dead code in the wrappers for
overloaded functions. Only the generated dispatch function needs to
allocate an array for the passed arguments.

In addition, add overload_extend, overload_rename and overload_subtype
runtime tests.
2019-01-16 20:00:40 -07:00
Vadim Zeitlin
cb426b1074 Enable keyword arguments for keyword_rename unit test
This is required for the recently added Python test checking that an
argument clashing with a Python keyword is also renamed when using
keyword arguments and fixes this test failure when using -builtin Python
option.
2019-01-17 01:25:43 +01:00
William S Fulton
00fbf09137 Merge branch 'ZackerySpytz-OCaml-callback-example'
* ZackerySpytz-OCaml-callback-example:
  [OCaml] Add a callback example
2019-01-16 21:48:26 +00:00
William S Fulton
32a8cd8f2f Merge branch 'ZackerySpytz-OCaml-constant-char-wrapping'
* ZackerySpytz-OCaml-constant-char-wrapping:
  [OCaml] Fix the wrapping of static const member chars
2019-01-16 21:46:57 +00:00
William S Fulton
1bd1142d02 Fix python callback test-suite failure 2019-01-16 20:10:37 +00:00
Vadim Zeitlin
7e9181d70e Update error messages test suite
List the expected warnings about renaming "def" to "_def" too.
2019-01-16 18:52:19 +01:00
William S Fulton
cf1624ebc4 Python static method wrapper changes
- Static method wrappers were using the 'fastproxy' approach by default.
  This is inconsistent with instance method wrappers. The fastproxy approach
  is now turned off by default to be consistent with instance methods.
  Static method wrappers can now also be controlled using the -fastproxy and
  -olddefs options.

  Example:

    struct Klass {
      static int statmethod(int a = 2);
    };

  generates:

  class Klass(object):
      ...
      @staticmethod
      def statmethod(a=2):
          return _example.Klass_statmethod(a)

  instead of:

    class Klass(object):
      ...
      statmethod = staticmethod(_example.Klass_statmethod)

- Modernise wrappers for static methods to use decorator syntax - @staticmethod.

- Add missing runtime test for static class methods and using the actual
  class method.
2019-01-16 08:21:00 +00:00
Zackery Spytz
a641966e0b [OCaml] Add a callback example
It is based on the the Python and Go examples.
2019-01-16 00:53:13 -07:00
Vadim Zeitlin
22158807fa Add more tests for Python parameter renaming
These tests were proposed by @wsfulton.

See https://github.com/swig/swig/issues/1272
2019-01-16 04:29:04 +01:00
Zackery Spytz
c61c221057 [OCaml] Fix the wrapping of static const member chars
OCaml's constantWrapper() was adding unneeded quotes when wrapping
static const member chars.

Add runtime tests for char_constant, chartest, and
static_const_member.
2019-01-15 16:37:26 -07:00
William S Fulton
fa0c3fe5c2 Merge branch 'ZackerySpytz-OCaml-cpp_nodefault-constructor_rename-runtime-tests'
* ZackerySpytz-OCaml-cpp_nodefault-constructor_rename-runtime-tests:
  [OCaml] Runtime tests for constructor_rename, cpp_nodefault and some others
2019-01-14 23:21:13 +00:00
William S Fulton
3fe9bbe907 Merge branch 'ZackerySpytz-OCaml-copy_string-test'
* ZackerySpytz-OCaml-copy_string-test:
  [OCaml] Fix and re-enable the string_simple, minherit, and unions tests
2019-01-14 23:20:24 +00:00
William S Fulton
36846e9342 Merge branch 'ZackerySpytz-OCaml-class-example'
* ZackerySpytz-OCaml-class-example:
  [OCaml] Re-enable the using_protected unit test
  [OCaml] Add a class example
2019-01-14 23:16:59 +00:00
Zackery Spytz
5b6c57e6ae [OCaml] Runtime tests for constructor_rename, cpp_nodefault and some others
Add runtime tests for constructor_rename, cpp_nodefault, extend,
extend_special_variables, extend_template, extern_c, and
global_ns_arg.
2019-01-13 22:44:31 -07:00
Zackery Spytz
83df4e8ed6 [OCaml] Fix and re-enable the string_simple, minherit, and unions tests
copy_string() is a macro in the OCaml C API, so rename the function
to copy_str(). Add a runtime test.

The minherit runtime test was fixed by b64d685.

Use the proper syntax for accessing member variables in
unions_runme.ml
2019-01-13 17:28:00 -07:00
William S Fulton
694bec91a4 Merge branch 'ZackerySpytz-OCaml-abstract_access-abstract_typedef-runtime-tests'
* ZackerySpytz-OCaml-abstract_access-abstract_typedef-runtime-tests:
  [OCaml] Runtime tests for abstract_access, abstract_typedef and some others
2019-01-12 10:39:43 +00:00
Zackery Spytz
e5b470327b [OCaml] Runtime tests for abstract_access, abstract_typedef and some others
Add runtime tests for abstract_access, abstract_typedef,
abstract_typedef2, abstract_virtual, aggregate, cast_operator, and
constover. The aggregate and cast_operator tests are based on the
corresponding ruby tests, and the rest are based on python tests.
2019-01-11 22:26:11 -07:00
Zackery Spytz
ded4abab62 Some renaming
Add OCaml to Tools/testflags.py.
2019-01-11 21:31:42 -07:00
Zackery Spytz
51bfdce781 Merge remote-tracking branch 'upstream/master' into OCaml-make-j-race-conds 2019-01-11 21:21:56 -07:00
Zackery Spytz
a851e0a9ac [OCaml] Re-enable the using_protected unit test
Use the [member-variable] syntax in using_protected_runme.ml as
required by the OCaml module's documentation and implementation.

Fix the return type for vec_write() in example.h in the OCaml stl
example.
2019-01-11 17:59:23 -07:00
Zackery Spytz
96c5a95878 [OCaml] Add a class example
It is based on the Python class example. The Makefile is based on the
Makefile used in the OCaml shapes example.
2019-01-11 17:53:38 -07:00
Zackery Spytz
5bdb52b319 [OCaml] class_scope_weird, cpp_static, and ignore_parameter runtime tests
They are based on the corresponding python runtime tests.
2019-01-11 19:35:17 +00:00
William S Fulton
b64d685d5f Merge branch 'ZackerySpytz-OCaml-fix-member-var-access'
* ZackerySpytz-OCaml-fix-member-var-access:
  OCaml's classHandler() requires name, not sym:name.
  [OCaml] Fix member var getters and setters
2019-01-11 18:42:19 +00:00
Zackery Spytz
7c653ba7df Add rules for swig.cmi, swig.cmo, and swigp4.cmi
In addition, give runme executables unique names (based on the go
Makefile).
2019-01-10 14:11:16 -07:00
Zackery Spytz
98af86f58b Merge remote-tracking branch 'upstream/master' into OCaml-make-j-race-conds 2019-01-10 13:32:19 -07:00
Zackery Spytz
4ca6fdc551 OCaml's classHandler() requires name, not sym:name.
In classHandler(), assign sym:name to the classname global so that it
can be used in membervariableHandler().

Add a small runme test for li_std_vector.
Use swigp4 when compiling the runme tests.
2019-01-08 20:10:07 -07:00
William S Fulton
4e4bb54fe7
Merge pull request #1393 from ZackerySpytz/OCaml-examples
[OCaml] Fix some of the OCaml examples
2019-01-08 08:04:20 +00:00
Zackery Spytz
8d9d4cc5f1 [OCaml] Improve "make clean" and similar
When cleaning, remove the runme file and generated *.mli files.
Remove unneeded MLFILE variables from Makefiles.
2019-01-07 14:24:58 -07:00
Zackery Spytz
8f7bc4cc10 [OCaml] Rename example_prog.ml to runme.ml in the OCaml examples
Name the output executable "runme" in the examples.
Replace use of "foolib" in the string_from_ptr example.
Fix a warning in the std_vector example.
Add strings_test to Examples/ocaml/check.list.
Disable two tests that were causing the OCaml test suite to fail.
2019-01-07 11:59:07 -07:00
Zackery Spytz
747ea5bfb6 Fix race conds when running the OCaml test suite with parallel make
Don't try to rm files that have been checked out of the SWIG library.
Don't repeatedly attempt to compile swig.ml, swig.mli, and swigp4.ml.
2019-01-06 10:29:17 -07:00
Zackery Spytz
4a912668fc [OCaml] Fix member var getters and setters
Add `membervariableHandler()` to the `OCAML` class in ocaml.cxx (it is
partly based on the code in python.cxx and octave.cxx).

In Lib/ocaml/class.swg, wrapped classes/structs were not being added
to `class_master_list`. This is fixed by adding a call to
`register_class_byname`.

Add a unit test in the form of struct_value_runme.ml.
2019-01-06 09:40:25 -07:00
William S Fulton
0c4491eaae Add more tests for C++11 raw string literals
Test added to check fixes for:

- Issue #948 and issue #1019 and issue #1273 - raw string delimiters
  not being stripped off
- Issue #538 - Ruby support for "docstring" feature
2019-01-06 00:10:01 +00:00
Zackery Spytz
1be9f5fec3 [OCaml] Fix some of the OCaml examples
Update some of the OCaml examples so that they run successfully with
`make check-ocaml-examples` (important for the CI). Some of the
examples were written to depend on passed arguments.

Temporarily disable the broken std_string example.
2019-01-03 07:34:25 -07:00
William S Fulton
6a80ec314a Merge branch 'typecheck-null-nonpointers'
* typecheck-null-nonpointers:
  Fix overloading for non-pointers and NULL - MzScheme
  Overloading for non-pointers and NULL - Chicken
  Fix overloading for non-pointers and NULL - Scilab
  Fix overloading for non-pointers and NULL - R
  Fix overloading for non-pointers and NULL - Php
  Fix overloading for non-pointers and NULL - Octave
  Fix overloading for non-pointers and NULL - Lua
  Overloading for non-pointers and NULL - Javascript
  Fix overloading for non-pointers and NULL - Guile
  Fix overloading for non-pointers and NULL - Tcl
  Fix overloading for non-pointers and NULL - Perl
  Fix overloading for non-pointers and NULL - Ruby
  Add test for overloading and NULL
  Correct Python implicitconv code
  Fix typecheck typemaps for non-pointers and NULL
2019-01-03 08:13:19 +00:00
William S Fulton
f17e993ed7 Remove some non-standard cruft from OCaml test-suite 2019-01-03 07:54:29 +00:00
William S Fulton
d247388fdf Merge branch 'ZackerySpytz-OCaml-out-of-source'
* ZackerySpytz-OCaml-out-of-source:
  Don't override SCRIPTDIR.
  Replace mv hack.
  [OCaml] Update OCaml for out-of-source builds
2019-01-03 07:12:31 +00:00
Zackery Spytz
f2a05bda8b Don't override SCRIPTDIR. 2019-01-02 05:01:54 -07:00
Zackery Spytz
5f941bc3c7 Replace mv hack. 2019-01-02 01:33:53 -07:00
Zackery Spytz
5c19f4de2f [OCaml] Add missing warning filters for OCaml keywords in the test suite 2018-12-31 05:55:10 -07:00
William S Fulton
b48339cfca Fix overloading for non-pointers and NULL - Scilab 2018-12-30 14:22:13 +00:00
William S Fulton
f181d20dd1 Fix overloading for non-pointers and NULL - R 2018-12-30 13:46:51 +00:00