Commit graph

4,950 commits

Author SHA1 Message Date
William S Fulton
1bd1142d02 Fix python callback test-suite failure 2019-01-16 20:10:37 +00: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
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
William S Fulton
b7db45661a Fix overloading for non-pointers and NULL - Php 2018-12-30 12:00:49 +00:00
William S Fulton
e354ba8cdc Fix overloading for non-pointers and NULL - Octave 2018-12-30 11:25:41 +00:00
William S Fulton
cd7772a274 Fix overloading for non-pointers and NULL - Lua 2018-12-30 10:54:53 +00:00
William S Fulton
ec8d978995 Overloading for non-pointers and NULL - Javascript
Overloading support for Javascript is generally incomplete as there are
no typecheck typemaps, so the overloading and NULL support added here
doesn't work and won't work until the typecheck typemaps are
implemented.
2018-12-30 10:11:35 +00:00
William S Fulton
eb151e43be Fix overloading for non-pointers and NULL - Guile 2018-12-30 09:26:33 +00:00
Zackery Spytz
9973628268 [OCaml] Update OCaml for out-of-source builds
This is one of the steps needed to fix the OCaml test suite.

In addition, disable the creation of toplevels by default in the OCaml
examples (toplevels are currently broken).
2018-12-29 08:24:24 -07:00
William S Fulton
12eb0f81ae Fix overloading for non-pointers and NULL - Tcl 2018-12-29 14:55:43 +00:00
William S Fulton
b1178cf130 Fix overloading for non-pointers and NULL - Perl 2018-12-29 14:15:59 +00:00
William S Fulton
d14c97408d Fix overloading for non-pointers and NULL - Ruby 2018-12-29 14:15:51 +00:00
William S Fulton
2769a8763c Add test for overloading and NULL 2018-12-29 14:15:45 +00:00
William S Fulton
3efea1f4ab Fix typecheck typemaps for non-pointers and NULL
The typecheck typemaps succeed for non pointers (SWIGTYPE, SWIGTYPE&,
SWIGTYPE&&) when the equivalent to C NULL is passed from the target
language. This commit implements a fix for Python to not accept a Python
None for non-pointer types.

Issue #1202
2018-12-29 11:45:46 +00:00
William S Fulton
315c7dab06 Remove debug display in python_pythoncode testcase 2018-12-22 18:47:34 +00:00
William S Fulton
5a388863fa director_thread test fixes for MacOS
Add extra debugging and correctly detect MacOS using __APPLE__ macro
2018-12-21 19:08:15 +00:00
William S Fulton
1faf5a879f Avoid thread name checking testing on MacOS
It's not working!
2018-12-21 09:13:09 +00:00
William S Fulton
50f223f454 Fix director_thread test for MacOS
pthread_setname_np is defined differently on MacOS
2018-12-21 09:13:09 +00:00
William S Fulton
d835c69d65 Merge branch 'java-director-thread-name'
* java-director-thread-name:
  Add changes entry for setting Java thread name
  Increased Java thread name size.
  Java directors - more generic thread name setting
  Use prctl method to get thread names, which is available on all NDK versions
  Actually, pthread_getname_np is only available in recent versions of Android (API level >= 26).
  Set thread name when attaching to Android JVM in SWIG Java director
2018-12-20 21:23:29 +00:00
William S Fulton
d9ecff1fca Merge branch 'chlandsi-master'
* chlandsi-master:
  Testcase for testing __new__ override Python 3.6 fix
  fix for creating new shadow class in python 3.6
2018-12-20 08:12:41 +00:00