From: <vm...@us...> - 2009-07-07 10:52:16
|
Revision: 11375 http://swig.svn.sourceforge.net/swig/?rev=11375&view=rev Author: vmiklos Date: 2009-07-07 09:56:07 +0000 (Tue, 07 Jul 2009) Log Message: ----------- PHP: add testcase for the -prefix option Modified Paths: -------------- branches/gsoc2009-vmiklos/Examples/test-suite/php/Makefile.in Added Paths: ----------- branches/gsoc2009-vmiklos/Examples/test-suite/php/prefix_runme.php branches/gsoc2009-vmiklos/Examples/test-suite/prefix.i Modified: branches/gsoc2009-vmiklos/Examples/test-suite/php/Makefile.in =================================================================== --- branches/gsoc2009-vmiklos/Examples/test-suite/php/Makefile.in 2009-07-06 21:42:17 UTC (rev 11374) +++ branches/gsoc2009-vmiklos/Examples/test-suite/php/Makefile.in 2009-07-07 09:56:07 UTC (rev 11375) @@ -17,7 +17,7 @@ TARGETPREFIX =# Should be php_ for Windows, empty otherwise # Custom tests - tests with additional commandline options -# none! +prefix.cpptest: SWIGOPT += -prefix Project # write out tests without a _runme.php missingcpptests: Added: branches/gsoc2009-vmiklos/Examples/test-suite/php/prefix_runme.php =================================================================== --- branches/gsoc2009-vmiklos/Examples/test-suite/php/prefix_runme.php (rev 0) +++ branches/gsoc2009-vmiklos/Examples/test-suite/php/prefix_runme.php 2009-07-07 09:56:07 UTC (rev 11375) @@ -0,0 +1,19 @@ +<?php +// Sample test file + +require "tests.php"; +require "prefix.php"; + +// No new functions +check::functions(array(foo_get_self)); +// No new classes +check::classes(array(ProjectFoo)); +// now new vars +check::globals(array()); + +$f = new ProjectFoo(); +// This resulted in "Fatal error: Class 'Foo' not found" +$f->get_self(); + +check::done(); +?> Added: branches/gsoc2009-vmiklos/Examples/test-suite/prefix.i =================================================================== --- branches/gsoc2009-vmiklos/Examples/test-suite/prefix.i (rev 0) +++ branches/gsoc2009-vmiklos/Examples/test-suite/prefix.i 2009-07-07 09:56:07 UTC (rev 11375) @@ -0,0 +1,14 @@ +// Test that was failing for PHP - the value of the -prefix option was +// ignored +%module prefix + +%inline %{ + +class Foo { +public: + Foo *get_self() { + return this; + } +}; + +%} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |