package option for perl5
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10393 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
25f30ff1b1
commit
bea5f1d47b
9 changed files with 228 additions and 66 deletions
|
|
@ -422,6 +422,7 @@ C_TEST_CASES += \
|
|||
MULTI_CPP_TEST_CASES += \
|
||||
clientdata_prop \
|
||||
imports \
|
||||
package \
|
||||
mod \
|
||||
template_typedef_import \
|
||||
multi_import
|
||||
|
|
|
|||
5
Examples/test-suite/package.h
Normal file
5
Examples/test-suite/package.h
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class A
|
||||
{
|
||||
public:
|
||||
int testInt() { return 2;}
|
||||
};
|
||||
2
Examples/test-suite/package.list
Normal file
2
Examples/test-suite/package.list
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
package_a
|
||||
package_b
|
||||
10
Examples/test-suite/package_a.i
Normal file
10
Examples/test-suite/package_a.i
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
%module(package="C") "package_a";
|
||||
|
||||
%inline %{
|
||||
class A
|
||||
{
|
||||
public:
|
||||
int testInt() { return 2;}
|
||||
};
|
||||
|
||||
%}
|
||||
10
Examples/test-suite/package_b.i
Normal file
10
Examples/test-suite/package_b.i
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
%module(package="C") "package_b";
|
||||
|
||||
%inline %{
|
||||
class B
|
||||
{
|
||||
public:
|
||||
int testInt() { return 4; }
|
||||
};
|
||||
|
||||
%}
|
||||
|
|
@ -12,4 +12,6 @@ adding a new test to this suite, please use Test::More.
|
|||
Currently converted test cases include:
|
||||
|
||||
* operator_overload
|
||||
* operator_overload_break
|
||||
* package
|
||||
* overload_simple
|
||||
|
|
|
|||
24
Examples/test-suite/perl5/package_runme.pl
Normal file
24
Examples/test-suite/perl5/package_runme.pl
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use Test::More tests => 4;
|
||||
|
||||
BEGIN { use_ok('package_a'); }
|
||||
BEGIN { use_ok('package_b'); }
|
||||
|
||||
# Workaround for
|
||||
# ok( not (expression) , "test description" );
|
||||
# does not working in older versions of Perl, eg 5.004_04
|
||||
sub ok_not ($;$) {
|
||||
my($test, $name) = @_;
|
||||
$test = not $test;
|
||||
ok($test, $name);
|
||||
}
|
||||
|
||||
my $a = C::A->new();
|
||||
|
||||
isa_ok($a, 'C::A');
|
||||
|
||||
my $b = C::B->new();
|
||||
|
||||
isa_ok($b, 'C::B');
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue