diff --git a/SWIG/Examples/test-suite/perl5/profiletest_runme.pl b/SWIG/Examples/test-suite/perl5/profiletest_runme.pl new file mode 100644 index 000000000..fcf5c6a53 --- /dev/null +++ b/SWIG/Examples/test-suite/perl5/profiletest_runme.pl @@ -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); +} + diff --git a/SWIG/Examples/test-suite/profiletest.i b/SWIG/Examples/test-suite/profiletest.i new file mode 100644 index 000000000..08f33c2ea --- /dev/null +++ b/SWIG/Examples/test-suite/profiletest.i @@ -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"; + } + }; + +%} diff --git a/SWIG/Examples/test-suite/python/profiletest_runme.py b/SWIG/Examples/test-suite/python/profiletest_runme.py new file mode 100644 index 000000000..1bf1591ce --- /dev/null +++ b/SWIG/Examples/test-suite/python/profiletest_runme.py @@ -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) diff --git a/SWIG/Examples/test-suite/ruby/profiletest_runme.rb b/SWIG/Examples/test-suite/ruby/profiletest_runme.rb new file mode 100644 index 000000000..0b80cc721 --- /dev/null +++ b/SWIG/Examples/test-suite/ruby/profiletest_runme.rb @@ -0,0 +1,9 @@ +require 'profiletest' + +a = Profiletest::A.new() +b = Profiletest::B.new() + +for i in 0...1000000 + a = b.fn(a) +end +