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:
Marcelo Matus 2004-06-14 09:09:12 +00:00
commit 2ae6c092a8
4 changed files with 60 additions and 0 deletions

View 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);
}

View 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";
}
};
%}

View 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)

View 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