Commit graph

4,116 commits

Author SHA1 Message Date
William S Fulton
593c452c37 Fix overloaded templates and default arguments
The defaultargs attribute was not being correctly set for functions with
default arguments when instantiated with %template.

Closes #529
2015-10-11 17:30:34 +01:00
William S Fulton
3e9854d308 Fix incorrect director_classic_runme.py test
Python 3.5 and -builtin threw an error as the incorrect base was being
initialized.
2015-10-10 01:26:29 +01:00
William S Fulton
9104adc60a Test case fix 2015-10-03 12:10:14 +01:00
William S Fulton
fc2205e64d %shared_ptr support improvements for classes in an inheritance chain
Fix %shared_ptr support for private and protected inheritance.
- Remove unnecessary Warning 520: Derived class 'Derived' of 'Base'
  is not similarly marked as a smart pointer
- Do not generate code that attempts to cast up the inheritance chain in the
  type system runtime in such cases as it doesn't compile and can't be used.
Remove unnecessary warning 520 for %shared_ptr when the base class is ignored.
2015-10-01 22:36:01 +01:00
William S Fulton
e12277a469 Ruby shared_ptr fixes for use with minherit 2015-10-01 22:36:01 +01:00
William S Fulton
04fd4a9c68 Director smartptr testing - add Python test 2015-10-01 22:36:00 +01:00
Vladimir Kalinin
ec93b01a09 Issue #508: Classprefix is not restored after nested structures processing. Also, Classprefix is incorrectly checked in some places. 2015-10-01 15:06:42 +03:00
William S Fulton
350eff3687 Director smartptr testing
- Enhance Java and C# test
- Add Ruby test
2015-09-30 07:53:19 +01:00
William S Fulton
f266a588e0 Cosmetic comment fix in testcase 2015-09-30 07:06:40 +01:00
William S Fulton
a7cc3267bc Add more Ruby shared_ptr runtime tests 2015-09-26 00:12:57 +01:00
William S Fulton
004ae163e5 Add RUBYFLAGS for Ruby testing
make check RUBYFLAGS=-v can be useful
2015-09-25 23:15:25 +01:00
William S Fulton
4c2da8184b li_boost_shared_ptr tests cleanup
Remove some cruft
2015-09-25 23:14:34 +01:00
William S Fulton
f5a6e94466 Ruby shared_ptr testing enhancements
li_boost_shared_ptr_runme.rb: add garbage collection to properly check
expected reference counts
2015-09-25 22:58:01 +01:00
William S Fulton
2506ccd4f4 Add shared_ptr Ruby runtime test
Reference count tests not quite complete yet - need to be sure of
control of the garbage collector to test this reliably.
2015-09-25 22:58:01 +01:00
William S Fulton
155233bea6 Turn on missing shared_ptr tests for Octave 2015-09-25 22:58:00 +01:00
William S Fulton
c089908f07 Turn on Ruby shared_ptr testing 2015-09-25 22:58:00 +01:00
William S Fulton
89f13b03da Correct to Unix CR/LF 2015-09-05 16:18:03 +01:00
William S Fulton
b5873218b6 Ruby mark_function example and docs fixes
Relates to Ruby trackings hash bug #225
2015-09-05 15:30:50 +01:00
Olly Betts
e903854ded valgrind --trace-children=yes no longer required
We no longer use the preinst-swig wrapper script in the testsuite.
2015-09-04 14:29:21 +12:00
Olly Betts
8ab622c6d0 [Python] Fix docstrings for %callback functions
Reinstates autodoc for callback function testcase from #467, actually
tests the resulting docstring in the _runme.py and fixes SWIG/Python
so the expected result is obtained.
2015-09-04 13:04:37 +12:00
Olly Betts
aa0e781034 Suppress pep8 E731 (lambda assignment)
This is a new warning in pep8 1.6.0 which breaks our testsuite.
2015-09-04 12:50:52 +12:00
Olly Betts
9e69a2c198 Use name of PHP resource not wrapped C++ type
Since callback::foo_T<int> isn't a PHP resource, that error message doesn't
really make sense as it was.  As discussed in #467.
2015-09-04 12:14:21 +12:00
William S Fulton
ca64b06229 Consistent quoting in Makefile 2015-08-21 22:48:34 +01:00
William S Fulton
e00a8026a6 More remove SWIG_LIB variable 2015-08-21 22:48:34 +01:00
William S Fulton
7f5a32195a XML examples out of source support
Examples still don't work though!
2015-08-21 22:48:34 +01:00
William S Fulton
8e2bc595c6 Remove use of preinst-swig script
Complete the prototype removal in ca1431.

The script prevents SWIGTOOL=gdb from working as gdb can't be used to
debug a shell script, it requires a binary.

Add support for SWIGTOOL in all the examples.

SWIG_LIB_DIR and SWIGEXE must now instead be set by all Makefiles.

See issue #473.
2015-08-21 22:43:17 +01:00
William S Fulton
4ef3507e8b Remove realpath from python/import_packages example 2015-08-20 06:19:12 +01:00
William S Fulton
bfead87e9f Cosmetic changes in Chicken example Makefiles 2015-08-18 19:47:15 +01:00
William S Fulton
ca1431f4cf Prototype removal of swig-preinst in the test-suite and examples
Prototype for Java test-suite and Java class example.

SWIG_LIB_DIR and SWIGEXE must now instead be set by all Makefiles.
SWIG_LIB is explicitly set where necessary.
Allows use of 'make SWIGTOOL="gdb --args"' to work as gdb can't be used
to debug a shell script, for both examples and test-suite.

See issue #473.
2015-08-18 08:00:01 +01:00
William S Fulton
023b0186f0 Fix R out-of-source build examples 2015-08-13 06:48:17 +01:00
William S Fulton
c0bee5bf18 Remove R test until fixed
Fix is in progress, see Github patch #500
2015-08-13 06:47:09 +01:00
Richard Beare
1a6d952094 runtime test for tricky enumerations and support for out of source testing via args option to R 2015-08-12 18:33:53 +01:00
Joseph C Wang
834a93f449 Revert "Merge pull request #494 from richardbeare/enumR2015B"
This reverts commit cb8973f313, reversing
changes made to ac3284f78c.
2015-08-11 09:57:57 +08:00
joequant
cb8973f313 Merge pull request #494 from richardbeare/enumR2015B
replacement for enumR2015 - tidied and rebased
2015-08-10 13:37:27 +08:00
Richard Beare
da1c6c60d3 This is a modification to support use of tricky enumerations in R. It
includes the addition of a _runme for an existing test - preproc_constants
that was previously not run. That tests includes a preprocessor based
setting of an enumeration which is ignored by the existing r enumeration
infrastructure. The new version correctly reports the enumeration value
as 4 - previous versions set it to 0. Traditional enumerations are unchanged.

The approach used to deal with these enumerations is similar to that of
other languages, and requires a call to a C function at runtime to return
the enumeration value. The previous approach figured out the values statically
and this is still used where possible. The need for a runtime call leads to
changes in when swig code is used in packages - see below.

One test that previously passed now fails - namely the R sourcing of
preproc_constants.R, as the enumeration code requires the shared library,
which isn't loaded by that script.

There is also a modification to the way the R _runme.R files are used.
The call to R CMD BATCH now includes a --args option that indicates
the source folder for the unittest.R file, and the first couple
of lines of the _runme.R files deal with correctly locating this.
Out of source tests now run correctly.

This work was motivated by problems generating the SimpleITK binding,
specifically with some of the more complex enumerations.

This approach does have some issues wrt to code in packages, but I can't
see an alternative. The problem with packages is that the R code setting
up the enumeration structures requires the shared library so that the C
functions returning enumeration values can be called. The enumeration
setup code thus needs to be moved to the package initialisation section.
For SimpleITK I do this using an R script, which I think is an acceptable
solution. The core part of the process is the following function. I dump
all the enumeration stuff into a .onload function. This is only necessary
if some of the enumerations are tricky.

splitSwigFile <- function(filename, onloadfile, mainfile)
{
p1 <- parse(file=filename)

getdefineEnum <- function(X)
{
return (is.call(X) & (X[[1]]=="defineEnumeration"))
}

dd <- sapply(p1, getdefineEnum)

enums <- p1[dd]
enums <- unlist(lapply(enums, deparse))

enums <- c(".onLoad <- function(libname, pkgname) {", enums, "}")

everythingelse <- p1[!dd]
everythingelse <- unlist(lapply(everythingelse, deparse))
writeLines(everythingelse, mainfile)
writeLines(enums, onloadfile)

}
2015-08-10 09:37:04 +10:00
William S Fulton
ac3284f78c Merge branch 'talby--surgical-perlprimtypes-fix'
* talby--surgical-perlprimtypes-fix:
  update CHANGES.current
  check ranges in perlprimtype.swg more carefully to avoid clang warnings
  capture the current behavior of perlprimtypes.swg is more detail
2015-08-09 21:55:30 +01:00
Michael Schaller
608ef60ecf [Go] Renamed 'FooBarAbs' to 'FooBarAbstract' in the documentation and examples. 2015-08-09 14:37:16 +02:00
Michael Schaller
85037c3a33 [Go] Updated the 'callback' and 'extend' examples to match the 'director' one.
After the documentation update on how to utilize the director feature with
commit @17b1c1c the 'callback' and 'extend' examples needed an update as well.
2015-08-09 14:37:16 +02:00
Michael Schaller
a941e5b605 [Go] Revert commit 5e88857 to undelete the 'callback' and 'extend' examples.
The 'callback' and 'extend' examples were presumed to be obsoleted by the new
'director' example.  The examples are helpful though to have similar examples
across target languages and hence the commit @5e88857 which removed these
examples got reverted.
2015-08-09 14:36:58 +02:00
Robert Stone
8ac4a8147b capture the current behavior of perlprimtypes.swg is more detail 2015-08-08 11:39:16 -07:00
xantares
92328a2016 pep257 & numpydoc conforming docstrings 2015-08-07 22:15:13 +01:00
Vadim Zeitlin
a1bddd56eb Make (char*, size_t) typemap usable for strings of other types in Java.
Notably it now works for "unsigned char*" strings.

Add a test to check that it now works in Java and also showing that it already
worked for the other languages with support for this typemap.
2015-08-07 19:44:45 +02:00
Ian Lance Taylor
95a08b3950 [Go] update build instructions in Examples/go/index.html 2015-08-05 07:19:05 -07:00
Michael Schaller
736613e26c [Go] Documentation cleanup of obsolete 'callback' and 'extend' examples.
After commit 17b1c1c (pull request 447; issue 418) the 'callback' and 'extend'
examples have been removed in favor of the 'director' example.
2015-08-05 10:01:15 +02:00
Michael Schaller
d9d26149e7 Some minor changes after first code review by ianlancetaylor.
Renamed overwritenMethodsOnFooBarAbs to overwrittenMethodsOnFooBarAbs.
Changed some line breaks.
2015-08-04 09:50:56 +02:00
Michael Schaller
e47d87e404 Fixed Examples/go/director/Makefile as there might be no copy of director.go during clean if a separate build directory is in use. 2015-08-04 09:34:26 +02:00
Michael Schaller
0db9a6ba7b Fixed Examples/go/director/Makefile as the copy of director.go wasn't cleaned up in separate build directories. 2015-08-04 09:34:26 +02:00
Michael Schaller
afd6a55ce1 Fixed Examples/go/director/Makefile as director.go was missing in separate build directories. 2015-08-04 09:34:26 +02:00
Michael Schaller
a17c9727bd Fleshed out Go's documentation about the director feature and added a director example.
Fixes issues #418.
2015-08-04 09:34:26 +02:00
William S Fulton
9babc26634 Update Scilab test-suite output wording 2015-08-03 08:12:38 +01:00