Commit graph

18,794 commits

Author SHA1 Message Date
William S Fulton
6f331298fe Merge branch 'DarthGandalf-osx'
* DarthGandalf-osx:
  Add executable permissions to new scripts
  Travis: unify GCC5 and SWIG_CC variables
  Make sure travis doesn't silently skip testing of some language
  Add R to testflags.py
  Integrate OS X .travis.yml into master branch using multi-os feature.
2015-09-05 15:43:56 +01:00
William S Fulton
16a3ff3603 Add executable permissions to new scripts 2015-09-05 15:43:05 +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
Alexey Sokolov
5dd553e244 Travis: unify GCC5 and SWIG_CC variables 2015-09-05 11:21:17 +01:00
Olly Betts
8a6874e633 Fix docstrings for callback functions with -builtin 2015-09-04 15:29:06 +12:00
Olly Betts
c270367ea0 Add missing shell quoting 2015-09-04 14:30:42 +12: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
Alexey Sokolov
1ecd0bad31 Make sure travis doesn't silently skip testing of some language 2015-09-02 20:58:56 +01:00
Alexey Sokolov
3f0072c7ca Add R to testflags.py 2015-09-02 08:22:29 +01:00
Alexey Sokolov
9155ff0fbb Integrate OS X .travis.yml into master branch using multi-os feature.
http://docs.travis-ci.com/user/multi-os/

Expand testflags.py to support clang vs gcc, as clang is used on OS X.
2015-09-02 08:21:48 +01:00
Olly Betts
efcaa8fdac Drop code to handle compilers lacking the 'bool' type.
SWIG requires an ISO C++ compiler, so this is no longer useful.  Fixes
issue#513.
2015-09-02 09:40:55 +12:00
Olly Betts
11c422529e Remove superfluous trailing ; 2015-09-02 09:35:07 +12:00
Olly Betts
578ab10365 Remove configure probes for ranlib and ar
These haven't been used by the SWIG build system for many years.
2015-09-01 16:09:35 +12:00
William S Fulton
567d4690cf Fix ruby warning using clang in director exception code
Suppresses warning:
  error: control may reach end of non-void function [-Werror,-Wreturn-type]
The UNUSED macro is not expanded in ruby.h for rb_exc_raise for clang when
it ought to be.
For patch #512
2015-08-31 14:05:31 +01:00
William S Fulton
01d4bc391c OS X bison warning suppression 2015-08-31 14:05:04 +01:00
William S Fulton
ab8f05204f Cosmetic changes in Octave runtime
Fix bracket matching!
2015-08-31 12:44:13 +01:00
William S Fulton
fc521be4e6 Merge pull request #509 from sjoerdjob/python_exception_not_bare
Do not use bare exception in generated Python code.
2015-08-29 13:28:16 +01:00
Sjoerd Job Postmus
5be177e5c3 Do not use bare exception in generated Python code.
By using the 'except:', you can catch all kinds of exceptions, including
the KeyboardInterrupt and SystemExit exceptions. From the generated
code, it is quite obvious that it is not these cases that should be
caught, but more specific ones like AttributeError and TypeError. To be
on the safe side, I decided to keep using 'Exception' for now.
2015-08-28 17:43:28 +02:00
Ian Lance Taylor
90a3be95dd Merge pull request #502 from michael-schaller/doc
[Go] Reworked beginning of the documentation.
2015-08-27 07:16:54 -07:00
Michael Schaller
d5cf0ab111 First batch of changes after code review by @ianlancetaylor for pull request #502. 2015-08-27 10:09:50 +02:00
Michael Schaller
8d2f3403d2 [Go] Reworked beginning of the documentation.
* Removed link to examples in the Go source tree as discussed in issue #418.
* Reworded occurences of the 'gc tool' as it has been removed with Go 1.5.
* Reworked chapter 23.3.  This should make it easier for users to get started
  with SWIG as the chapter starts with how to use SWIG with the go tool.
* Added helpful links.
2015-08-27 08:27:43 +02:00
William S Fulton
1851b2fadf Merge branch 'no-swig-preinst'
* no-swig-preinst:
  Leave preinst-swig as a convenience only script for ad-hoc use
  Consistent quoting in Makefile
  More remove SWIG_LIB variable
  XML examples out of source support
  Remove SWIG_LIB variable from Makefile
  Remove use of preinst-swig script
  Remove realpath from python/import_packages example
  Cosmetic changes in Chicken example Makefiles
  Prototype removal of swig-preinst in the test-suite and examples
2015-08-21 22:52:29 +01:00
William S Fulton
abe52396b2 Leave preinst-swig as a convenience only script for ad-hoc use 2015-08-21 22:48:34 +01: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
7192b1c735 Remove SWIG_LIB variable from Makefile 2015-08-21 22:48:33 +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
1fca810989 R testing should now work in Travis - remove from expected fails 2015-08-13 06:49:32 +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
William S Fulton
9aa0f85cda Workaround Appveyor random failures due to nuget install errors
Add and use nuget-install.cmd based on
https://github.com/appveyor/ci/blob/master/scripts/nuget-restore.cmd
2015-08-12 18:27:20 +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
Ian Lance Taylor
01edfef3b8 Merge pull request #493 from michael-schaller/dir-examples
[Go] Undelete and updated the 'callback' and 'extend' examples.
2015-08-09 07:31:09 -07: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
96e282b791 update CHANGES.current 2015-08-08 13:21:24 -07:00
Robert Stone
9d19640141 check ranges in perlprimtype.swg more carefully to avoid clang warnings 2015-08-08 11:39:19 -07:00
Robert Stone
8ac4a8147b capture the current behavior of perlprimtypes.swg is more detail 2015-08-08 11:39:16 -07:00