Commit graph

4,100 commits

Author SHA1 Message Date
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
William S Fulton
c0de963191 Test case warning suppression for visual c++ fix 2015-08-02 22:22:24 +01:00
William S Fulton
892aaf577a Test case warning suppression for visual c++ 2015-08-02 21:50:32 +01:00
William S Fulton
c6f8aadc64 Cosmetic corrections - Mac OS X 2015-08-02 20:14:20 +01:00
William S Fulton
f970d9aae5 testcase warning fix 2015-08-02 19:58:10 +01:00
William S Fulton
a1771cb8a0 Fix potential security exploit in generated Java classes 2015-08-02 11:22:46 +01:00
William S Fulton
e69cc0c0f5 Improve python code indentation warning / error messages 2015-07-30 08:26:17 +01:00
William S Fulton
fa282b3540 Improve Python docstring indentation handling
SWIG-3.0.5 and earlier sometimes truncated text provided in the docstring
feature.
SWIG-3.0.6 gave a 'Line indented less than expected' error instead of
truncating the docstring text.
Now the indentation for the 'docstring' feature is smarter and is
adjusted so that no truncation occurs.

Closes #475
2015-07-30 08:26:08 +01:00
William S Fulton
3ab7315cf9 Merge pull request #467 from vadz/no-callback-in-autodoc
Remove callback function from autodoc unit test.
2015-07-24 23:07:54 +01:00
William S Fulton
2f00f6c8cc Support special variable expansion in special variable macros in typemap attributes.
Add test cases for special variable expansions and special variable
macros (aka embedded typemaps) expansion.
2015-07-22 22:04:35 +01:00
Lindley French
94f683868a Enable variable and typemap substitution in typemap kwargs, and a test that verifies this works for directorin:descriptor. 2015-07-22 11:31:21 -07:00
Vadim Zeitlin
a4b319ce8e Remove callback function from autodoc unit test.
It doesn't seem to belong there at all, there is a dedicated callback unit
test for it and it was added to the initial version of autodoc.i back in
124253d698 without any explanation, so just
remove it.

As this callback was used in a PHP test, perform this test for callback.i now
and use "%(uppercase)s" construct inside %callback to test that this works.
2015-07-19 18:14:06 +02:00
Vadim Zeitlin
08fa873638 Make callback unit test pass for PHP backend.
Deprecated %callback(1) doesn't work with PHP, use "%s" to give the same name
to the callback as to the C function explicitly instead.
2015-07-19 00:13:08 +02:00
Karl Wette
695b88f1ac Merge pull request #460 from opoplawski/octave4
Support for octave 4.0.0
2015-07-17 09:32:28 +02:00
William S Fulton
5a282f3ac3 c++11 test case fixes 2015-07-10 21:50:35 +01:00
Orion Poplawski
1d5d224328 Fix default_constructor_runme.m test 2015-07-10 11:59:45 -06:00
William S Fulton
3718b810c7 Don't generate constructor wrappers if a base class has a private constructor
g++-5 errors out with this now with errors such as:

default_constructor_wrap.cxx:665:27: error: use of deleted function ‘FFF::FFF()’
   result = (FFF *)new FFF();
                           ^
default_constructor_wrap.cxx:314:7: note: ‘FFF::FFF()’ is implicitly deleted because the default definition would be ill-formed:
 class FFF : public F {
       ^
default_constructor_wrap.cxx:301:4: error: ‘F::~F()’ is private
    ~F() { }
    ^
default_constructor_wrap.cxx:314:7: error: within this context
2015-07-07 20:15:55 +01:00