Commit graph

163 commits

Author SHA1 Message Date
Olly Betts
ac1f067ce9 Eliminate trivial differences between the reference examples 2014-11-07 15:34:43 +13:00
Olly Betts
37cd1474b5 Remove bogus ; after } in examples 2014-11-07 15:34:43 +13:00
William S Fulton
808d4b4798 Bypass Python exmples not supported by -builtin
Builtin classes as exceptions not supported, so don't run these aspects
of the examples when using -builtin.
2014-10-07 20:58:41 +01:00
William S Fulton
da394fae80 Remove Python swigrun example
By default it doesn't work as it does not call the CEO's __del__ method
as indicated in the comments. __del__ is called with -builtin but
then the base class's __del__ is not available and so it errors out.
Python 3 and -builtin goes into an endless loop. So removing as
hopelessly broken.
2014-10-07 20:58:41 +01:00
William S Fulton
a9c6196f71 Display testname when running the import_packages Python examples
For easier identification of what is running in these examples.
2014-10-07 20:58:40 +01:00
William S Fulton
9834a69c18 Fix Python 3 import_packages/relativeimport2 example clean
runme3.py files are generated and should not be checked in
2014-10-07 20:58:40 +01:00
Johan Hake
de4f30bd3c Small fixes to the relative import fix.
-- Now the tests actually runs
  -- Corrected the syntax for the fix in the yacc file
2014-09-29 17:37:41 +02:00
Johan Hake
1dd297ad9d Fix issue with relative import when using single header file import.
-- The commit propagates the package option to the newly create
     module node so it is recognized by SWIG
  -- Added a relativeimport test for this combination
     (in lack of py3 I was not able to test it with py3 but it
      "should just work")
2014-08-12 21:48:26 +02:00
Karl Wette
cc0738bbda Fully clean Python examples and test-suite 2014-05-29 02:29:27 +02:00
William S Fulton
f39ed94419 Fix compiler warnings in examples when using -std=c++98 -std=gnu89 -pedantic -Wreturn-type 2014-05-24 13:13:32 +01:00
Karl Wette
f574a34155 Allow examples and test-suite to be built out of source tree
- Examples/Makefile.in rules use SRCDIR as the relative source directory

- ./config.status replicates Examples/ source directory tree in build
  directory, and copies each Makefile to build directory, prefixed with
  a header which sets SRCDIR to source directory

- Examples/test-suite/.../Makefile.in set SRCDIR from Autoconf-set srcdir

- Examples/test-suite/errors/Makefile.in needs to filter out source
  directory from SWIG error messages

- Lua: embedded interpreters are passed location of run-time test

- Python: copy run-time scripts to build directory because of 2to3
  conversion; import_packages example copies __init__.py from source
  directory; test-suite sets SCRIPTDIR to location of run-time tests

- Javascript: binding.gyp renamed to binding.gyp.in so that $srcdir
  can be substituted with SRCDIR; removed './' from require() statements
  so that NODE_PATH can be used to point Node.js to build directory
2014-05-11 23:21:10 +02:00
Karl Wette
b6c1889c08 Fix {python|perl5|ruby|tcl}/java examples
- in Lib/gcj/cni.i: remove JvAllocObject(), change
  JvCreateJavaVM() argument from void* to JvVMInitArgs*
- in Examples/{python|perl5|ruby|tcl}/java/Makefile:
  pass full class name to gcjh, add Example.h as dependency,
  do not override CXX for compiling C++ sources
- in Examples/python/java/example.i:
  add destructor to class to prevent memory loss complaint
2014-05-02 21:44:42 +02:00
Karl Wette
3aacde4f5f Whitespace cleanup of Example Makefiles 2014-04-16 12:06:02 +02:00
William S Fulton
4fb940d913 Further fixes when using type() when using -builtin to include module name
Using type() on a builtin type should include the package and module
name, see http://docs.python.org/2/c-api/typeobj.html
2014-03-01 23:26:27 +00:00
Olly Betts
431b9b16e7 Update one dead link and remove another 2014-02-24 10:11:11 +13:00
Olly Betts
0de4cf13a8 Further cleaning up of class examples 2014-02-24 10:10:24 +13:00
Olly Betts
34c97ffdbd Improve the class example for several languages.
Fix numerous inaccuracies in index.html (where it exists) and eliminate
unnecessary differences between the example code being wrapped.
2014-02-23 18:24:51 +13:00
Olly Betts
2f3bf144c6 Fix assorted comment and documentation typos 2014-02-23 17:15:22 +13:00
William S Fulton
b170788459 Executable bits and shebang fixes 2014-02-16 17:30:41 +00:00
Paweł Tomulik
5562deec62 Fixed SF bug #1297 (Python imports)
This changeset resolves several issues related to python imports.
For example, it's possible now to import modules having same module
names, but belonging to different packages.

From the user's viewpoint, this patch gives a little bit more control on
import directives generated by swig. The user may choose to use relative
or absolute imports (docs are provided in separate PR).

Some details:
  - we (still) generate import directives in form 'import a.b.c' which
    corresponds to absolute imports in python3 and (the only available)
    ambiguous one in python2.
  - added -relativeimport option to use explicit relative import syntax
    (python3),

Tests are under Examples/python, these are in fact regression tests but
with the current swig testing framework it seems to be impossible to put
appropriate tests under test-suite.

Closes #7
2013-12-24 17:22:25 +00:00
William S Fulton
152905e193 Fix gcc -Waddress warning in variables examples 2013-10-18 06:53:02 +01:00
William S Fulton
7f95c7bb3e Use a less confusing macro name, SWIG_PYTHON_NO_DEBUG => SWIG_PYTHON_INTERPRETER_NO_DEBUG 2013-06-11 19:15:57 +01:00
William S Fulton
5cdfc503e1 Add SWIG_PYTHON_NO_DEBUG macro for building Debug wrappers against the Python Debug dll 2013-06-11 00:22:21 -07:00
William S Fulton
b3ca22dc33 Fix Python examples to compile and run under Python 3 2013-05-26 23:02:13 +01:00
William S Fulton
cc4ac0a9e9 Python examples makefiles clean target fixed and use RUNPIPE and tidyup 2013-04-19 22:47:26 +01:00
William S Fulton
78cd350fe9 Fix Visual Studio examples to work when SWIG is unzipped into a directory containing spaces. 2013-01-15 07:18:20 +00:00
Stefan Zager
96c76cf9c0 Added .PHONY targets
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12615 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-07 21:20:10 +00:00
Stefan Zager
bc9a32a658 Merged from branches/szager-python-builtin
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12596 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-03 08:33:41 +00:00
Stefan Zager
f2d721aeac Accidentally added build targets.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12453 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-10 05:56:35 +00:00
Stefan Zager
1e094f865e Added test harness
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12452 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-10 05:53:04 +00:00
Stefan Zager
6bfc86dee7 Simple test of operator overload. -builtin should shine in this test.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12451 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-10 05:19:03 +00:00
Stefan Zager
3852ca8f44 Accidentally imported build products.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12450 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-10 05:17:31 +00:00
Stefan Zager
e5bf6419b2 Test operator overloads with deep hierarchy.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12449 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-10 05:15:03 +00:00
Stefan Zager
6fa3033971 Makefile tweaks
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12445 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-09 07:35:56 +00:00
Stefan Zager
25be33dcd4 A collection of performance tests. The variants we're most
interested in are:

- swig run without any special parameters
- swig run with -O
- swig run with -builtin



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12444 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-09 07:31:08 +00:00
Stefan Zager
f39c09e12d Whoops; bad import
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12443 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-09 07:28:54 +00:00
Stefan Zager
460ac6206a A place to write and run performance tests. The variants we're
most interested in are:

'baseline' -- swig run without any special flags
'optimized' -- swig run with -O flag
'builtin' -- swig run with -builtin flag




git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12442 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-09 07:26:07 +00:00
William S Fulton
8e1f9274cc remove weave python example - license is unclear
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11902 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-03-06 00:11:40 +00:00
William S Fulton
4b1d7aa73d revert 11743 - accidental checkin
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11829 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-01-23 22:24:45 +00:00
William S Fulton
e0dd20350f Add caveat about using percent in varargs example as per suggestion in bug #2106353
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11743 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-11-14 21:50:41 +00:00
William S Fulton
3932d02a2a fix SWIG naming convention
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11663 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-21 00:25:11 +00:00
Miklos Vajna
0249eea389 Merge https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-vmiklos/
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11434 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-22 11:08:29 +00:00
Olly Betts
d2c38bb569 Snip nonsensical comment left over from cut and paste from other examples.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11215 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-05-19 11:54:40 +00:00
William S Fulton
48203afbd0 invoke using swig.exe instead of just swig in Visual Studio project files
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11166 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-03-20 23:54:43 +00:00
William S Fulton
9c53670fed warning fix
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11045 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-01-09 22:19:06 +00:00
Haoyu Bai
8f84447860 Commited SF#2158938: change all SWIG symbols start with Py to a new name.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10961 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-12-03 18:43:44 +00:00
Haoyu Bai
3d8ddfc442 Merged the Python 3.0 support branch. The merging progress is not so smooth, so hope this commit won't make anything broken.
This is the (incomplemete) log produced by svnmerge.py:

Merged revisions 10405-10409,10420-10422,10426,10438,10445,10451,10454-10465,10467,10473-10475,10485,10488-10489,10493-10495,10497,10509-10510,10513-10514,10517,10520,10525,10528-10529,10533-10535,10554-10557,10570,10573,10593,10614,10666-10669,10673,10678,10687,10690,10704-10706,10731,10744,10750-10752,10755,10759,10770,10775-10776,10813,10819 via svnmerge from 
https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-bhy



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10834 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-09-11 17:18:07 +00:00
William S Fulton
d67d79e0dc shadow->proxy change
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10410 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-05-01 21:42:38 +00:00
William S Fulton
e0889b6121 shadow->proxy terminology update
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10400 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-04-29 21:53:22 +00:00
William S Fulton
76eaea911b shadow->proxy terminlogy update
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10398 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-04-29 18:01:45 +00:00