added profile test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5981 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
2ee999ed53
commit
2ae6c092a8
4 changed files with 60 additions and 0 deletions
8
SWIG/Examples/test-suite/perl5/profiletest_runme.pl
Normal file
8
SWIG/Examples/test-suite/perl5/profiletest_runme.pl
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
use profiletest;
|
||||
$a = profiletestc::new_A();
|
||||
$b = profiletestc::new_B();
|
||||
|
||||
for ($i = 0; $i < 100000; $i++) {
|
||||
$a = profiletestc::B_fn($b, $a);
|
||||
}
|
||||
|
||||
36
SWIG/Examples/test-suite/profiletest.i
Normal file
36
SWIG/Examples/test-suite/profiletest.i
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
%module profiletest
|
||||
|
||||
%inline %{
|
||||
|
||||
class A {
|
||||
public:
|
||||
A() {}
|
||||
};
|
||||
|
||||
class B
|
||||
{
|
||||
A aa;
|
||||
public:
|
||||
B() {}
|
||||
A fn(const A* a) {
|
||||
return *a;
|
||||
}
|
||||
|
||||
int fi(int a) {
|
||||
return a;
|
||||
}
|
||||
|
||||
int fj(const A* a) {
|
||||
return 10;
|
||||
}
|
||||
|
||||
B* fk(int i) {
|
||||
return this;
|
||||
}
|
||||
|
||||
const char* fl(int i) {
|
||||
return "hello";
|
||||
}
|
||||
};
|
||||
|
||||
%}
|
||||
7
SWIG/Examples/test-suite/python/profiletest_runme.py
Normal file
7
SWIG/Examples/test-suite/python/profiletest_runme.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import _profiletest
|
||||
#import profiletest
|
||||
|
||||
a = _profiletest.new_A()
|
||||
b = _profiletest.new_B()
|
||||
for i in range(0,1000000):
|
||||
a = _profiletest.B_fn(b, a)
|
||||
9
SWIG/Examples/test-suite/ruby/profiletest_runme.rb
Normal file
9
SWIG/Examples/test-suite/ruby/profiletest_runme.rb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
require 'profiletest'
|
||||
|
||||
a = Profiletest::A.new()
|
||||
b = Profiletest::B.new()
|
||||
|
||||
for i in 0...1000000
|
||||
a = b.fn(a)
|
||||
end
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue