Commit graph

5,147 commits

Author SHA1 Message Date
Isaac Pascual Monells
84e310402a Add nested_inheritance_interface test 2019-07-02 12:57:16 +02:00
William S Fulton
06e5ab8975 Workaround clang 10.0.1 C++17 linker errors in testcases
Fixes:
  Undefined symbols for architecture x86_64: "___cxa_deleted_virtual"
which clang issues when a class deletes a method (seems to be when the
function is not one of the compiler's automatically added special member
functions).
2019-06-27 07:40:49 +01:00
William S Fulton
d6ef118219 std::auto_ptr replacement for testing with C++17 and later
Keep suppressing deprecated warnings for C++11 and C++14
2019-06-27 07:40:49 +01:00
William S Fulton
f3357f1f57 Remove use of std::bind2nd which is removed in C++17 2019-06-27 07:40:49 +01:00
William S Fulton
c8cef5c2f2 Fix constexpr-not-const clang warning in testcase
'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Werror,-Wconstexpr-not-const]
2019-06-27 07:40:49 +01:00
William S Fulton
3045ba3532 Warning suppression on testcase using clang 2019-06-27 07:40:49 +01:00
William S Fulton
116b6b1028 Remove deprecated calls in Octave testcases
Fixes warning using Octave 5.1:
  warning: findstr is obsolete; use strfind instead
2019-06-27 07:40:49 +01:00
William S Fulton
d9cac176f6 Suppress testcase clang warning for auto_ptr deprecation 2019-06-06 19:52:37 +01:00
William S Fulton
7231c2a065 Fix cpp11_rvalue_refrence3 testcase clang warning
cpp11_rvalue_reference3_wrap.cxx:256:38: warning: binding reference member 'member_rvalue_ref_ptr1' to
      a temporary value [-Wdangling-field]
  Thing *&& member_rvalue_ref_ptr1 = 0;
                                     ^
2019-06-06 19:45:24 +01:00
Brad Kotsopoulos
55e835e0ae Java std::vector constructor performance improvement
Reserve before loop of push_back
Refactor li_std_vector testcase

This is a squash merge of #1552
2019-06-06 19:29:11 +01:00
luz.paz
87695dacb1 Misc. documentation and source comment typo fixes
Found via `codespell -q 3 -L uint,od,objext,ba,cmo,bae,ans,struc,fo,clos,goin,upto,thru`
Revert changes in previous commit
2019-05-28 11:41:22 +12:00
Zackery Spytz
f042543c6f
Merge pull request #1474 from ZackerySpytz/OCaml-INPUT-OUTPUT-INOUT-primitives
[OCaml] Add missing INPUT, OUTPUT, and INOUT typemaps for primitives
2019-05-13 21:44:02 -06:00
William S Fulton
3ccc904b06 Fix php pragmas example include path
Was not working for out of source builds
2019-05-09 07:35:24 +01:00
Zackery Spytz
2f48bec666 Merge remote-tracking branch 'upstream/master' into OCaml-INPUT-OUTPUT-INOUT-primitives 2019-05-08 14:05:02 -06:00
William S Fulton
dbb5fdda01 Fix php pragmas example
. is not always in the include_path by default
2019-04-30 23:44:41 +01:00
William S Fulton
5d976b0ebe Fix php testcase warning 2019-04-30 23:44:41 +01:00
Ian Lance Taylor
8a1c09e280 Fix Go tests to run in module mode
Stop using relative imports and add a go.mod file.

Tested against Go 1.6 through Go pre-1.13, and gccgo.
2019-04-24 21:43:38 -07:00
William S Fulton
fbed720b98 Merge branch 'enum-trailing-comma-doxygen'
* enum-trailing-comma-doxygen:
  Fix parsing of enums with trailing comma with -doxygen
2019-04-24 08:08:18 +01:00
Vadim Zeitlin
74adaa5738 Fix parsing of enums with trailing comma with -doxygen
To correctly parse Doxygen post-comments after the trailing comma,
switch to right recursion in "enumlist" production rule definition: this
does consume more stack space when parsing, but makes the rules much
easier to write and to understand and hopefully shouldn't result in any
problems with real code (which shouldn't have thousands of enums items
in it).

Closes #1514.
2019-04-20 13:52:56 +02:00
Vadim Zeitlin
01a2cd27e7 Don't crash if type is not available in Python Doxygen code
Fix crash if "@return" Doxygen tag was used on a node without any return
type (such as a class, for example). Ignoring it might not be the best
thing to do, but it's definitely better than crashing and it's not
really clear what else could be done anyhow.

Closes #1516.
2019-04-20 13:52:05 +02:00
Ian Lance Taylor
77f075b6e8 When generating Go code, make -cgo the default.
Add new -no-cgo option to disable the default.
Keep -cgo as a no-op for existing users.
2019-04-19 12:49:56 -07:00
William S Fulton
4e5d1891e6 testcase fixes for gcc-9 2019-04-15 23:25:53 +01:00
William S Fulton
dc4fb85d00 cpp11_thread_local testcase fix for Visual C++ 2019-04-11 20:13:44 +01:00
William S Fulton
be8061c7f5 Cosmetic C# Makefile tweak 2019-04-08 19:44:10 +01:00
William S Fulton
a8055b45d7 Check Dispose is called in C# auto_ptr test 2019-04-08 19:37:00 +01:00
William S Fulton
bf9065395a C++11 test fixes for Visual Studio 2017 2019-04-08 19:33:59 +01:00
William S Fulton
06462acdf9 Fix C# CA1063 warning by implementing the recommended Dispose methods.
Previously just the Dispose() method was generated.
Now the Dispose() and Dispose(bool disposing) methods are generated.
Changes are required if custom "csfinalize", "csdestruct" or "csdestruct_derived"
typemaps are being used. Details in #421 on Github. SWIG will error out if one of
the "csfinalize, "csdestruct" or "csdestruct_derived" typemaps are found. Example
error message:

  foo.h:60: Error: A deprecated csfinalize typemap was found for Foo, please remove
  it and replace all csdestruct, csdestruct_derived and csfinalize typemaps by the
  csdispose, csdispose_derived, csdisposing and csdisposing_derived typemaps.

Closes #421
2019-04-08 19:20:45 +01:00
William S Fulton
33f8c36813 Correct ocaml dynamic targets 2019-03-26 21:24:00 +00:00
William S Fulton
166b683e89 More ocaml parallel make fixes
The previous commit removed a pile of 'test -f' hacks which were sort of
working for parallel builds and broke parallel test-suite builds. Now
this is fixed properly - these files are safely created in the
test-suite already. Now we create them safely in the examples.
2019-03-26 19:51:09 +00:00
William S Fulton
12a438542a Merge branch 'OCaml-examples-race-conditions'
* OCaml-examples-race-conditions:
  Fix parallel 'make check-ocaml-examples'
  [OCaml] Fix race conds when running the examples with parallel make
2019-03-26 08:01:30 +00:00
William S Fulton
b092055ca8 Fix parallel 'make check-ocaml-examples'
Some versions of ocamlc create a file of the same name in the tmp directory when invoking
using ocalmc on swigp4.ml. The name is the same even from different example directories.
TMPDIR is a workaround to make ocamlc use a different directory for this temp file.
Parallel make (-j) broke because different instances of ocamlc tried to
create the same temp file.
Issue #1503
2019-03-26 07:48:33 +00:00
William S Fulton
cedf4a2c2f More python std::list testing 2019-03-25 18:54:08 +00:00
William S Fulton
c0e212b9cf More C# std::list testing 2019-03-25 18:48:51 +00:00
William S Fulton
78051fdd33 C# std::list changes to support types that are not assignable
Assignable fixes are based on those used by C# std::vector where the
default wrappers work if there is no operator== available in the
template type. Enhanced wrappers are obtained via a macro:
 SWIG_STD_LIST_ENHANCED(SomeNamespace::Klass)
 %template(ListKlass) std::list<SomeNamespace::Klass>;

Remove bool specialization (left over from the original std::vector
wrappers).
Add in missing typedefs.
2019-03-25 07:19:49 +00:00
Adrien JUND
e7f9316e60 C# - add std::list 2019-03-25 07:19:49 +00:00
William S Fulton
826f1448b8 Fix Python low-level static member setters.
The low-level API for setting static member variables stopped working
when the fastunpack option was turned on by default. The PyMethodDef
setup requires METH_O, not METH_VARARGS with fastunpack.
2019-03-20 21:44:34 +00:00
William S Fulton
2bb5eeef91 Improve Python static member variable testing
Double check the values are being set in the C++ layer via a function call to C++ layer.
2019-03-20 21:10:28 +00:00
Zackery Spytz
1fa2d85dc0 [OCaml] Fix race conds when running the examples with parallel make
Race conditions could occur when running the examples with parallel make.
2019-03-19 16:23:56 -06:00
William S Fulton
cfa7a4d4d0 Merge branch 'REnums2018'
* REnums2018:
  Fix R return by C++11 const ref enum classes
  Remove unused code in r.cxx
  extra doc on anonymous enums
  ENH:
  FIX: references to enums now functioning
  DOC: Extended documentation on enumeration support in R
  FIX: Corrected path to output from R tests
  Reformat comments in R module
  ENH: Run test for enum_thorough in R
  Code style changes post review
  ENH: R Module: Enumerations with values set by calls to C code, allowing arbitarily complex value expressions.
  Setting enum values with calls to the C code.
2019-03-18 18:03:20 +00:00
William S Fulton
51e75bacf7 Merge branch 'csharp-set'
* csharp-set:
  Fix header comment in C# std_set typemaps
  Implement set-theoretic methods in std::set C# typemaps
  Add std::set<> typemaps for C#
2019-03-12 22:30:15 +00:00
William S Fulton
404aa2c3db Merge branch 'std_unordered_map_args_fix'
* std_unordered_map_args_fix:
  Include all template parameters for std_unordered_multimap and std_unordered_map
  Include all template parameters for std_unordered_map macro
2019-03-12 20:03:48 +00:00
William S Fulton
30f59ffe22 Include all template parameters for std_unordered_multimap and std_unordered_map 2019-03-12 20:03:14 +00:00
Vadim Zeitlin
aaa12450c0 Implement set-theoretic methods in std::set C# typemaps
These implementations are not optimized, i.e. are done in a naive way in
C#, rather than using C++ functions more efficiently, but are better
than nothing.
2019-03-11 23:05:38 +01:00
Vadim Zeitlin
f0067b6bbf Add std::set<> typemaps for C#
Create new Lib/csharp/std_set.i based on the existing std_map.i and run
li_std_set unit test for C# as well.

Notice that the set operations defined by the base ISet<> interface are
not implemented yet.
2019-03-11 22:49:03 +01:00
William S Fulton
b1f68b893b Merge branch 'MSVC-compiler-warnings'
* MSVC-compiler-warnings:
  Fix some MSVC compiler warnings in the test suite
2019-03-11 19:06:16 +00:00
Richard Beare
43af20ab3b FIX: references to enums now functioning
There is some consolidation work to be done. The
core of the change is getRClassName2, which will
probably eventually replace getRClassName.

getRClassName seems to be in a funny state, with
a middle argument that is commented out and never
used.

My next step is to verify whether the new version
can replace it.
2019-03-08 21:56:36 +11:00
Richard Beare
4490d0ec2c FIX: Corrected path to output from R tests
Makefile was attempting to cat output files from the
script source directory instead of the build directory.
2019-03-08 21:56:36 +11:00
Richard Beare
62594c611a ENH: Run test for enum_thorough in R
This test exercises many complex cases for enumerations in R.

References to enums currently fail and will be addressed in
the next patch.

Anonymous enums are not supported.

There are some strange corner cases that could be seen as
doing strange things in R. enums are allowed to have the
same underlying integer representation on the C side. This
means that the R structure ends up with two names for the
same integer, which in turn means that the reverse lookup
isn't unique. I don't think this matters. I'll add some
of these cases to the documentation.
2019-03-08 21:56:36 +11:00
Zackery Spytz
a0b84f5180 Fix some MSVC compiler warnings in the test suite
nested_in_template_wrap.cxx(247): warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data
python_pybuffer_wrap.cxx(2788): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data
Modules\python.cxx(2227) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
2019-03-07 09:44:01 -07:00
William S Fulton
412b113c0b Run errors test cases in predictable order 2019-03-03 16:00:02 +00:00