Added test harness
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12452 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6bfc86dee7
commit
1e094f865e
22 changed files with 66 additions and 226 deletions
|
|
@ -1,17 +1,11 @@
|
|||
#!/usr/bin/env
|
||||
|
||||
import sys
|
||||
from subprocess import *
|
||||
sys.path.append('..')
|
||||
import harness
|
||||
|
||||
proc = Popen([sys.executable, 'runme_baseline.py'], stdout=PIPE)
|
||||
(stdout, stderr) = proc.communicate()
|
||||
print stdout
|
||||
|
||||
proc = Popen([sys.executable, 'runme_optimized.py'], stdout=PIPE)
|
||||
(stdout, stderr) = proc.communicate()
|
||||
print stdout
|
||||
|
||||
proc = Popen([sys.executable, 'runme_builtin.py'], stdout=PIPE)
|
||||
(stdout, stderr) = proc.communicate()
|
||||
print stdout
|
||||
def proc (mod) :
|
||||
for i in range(1000000) :
|
||||
x = mod.MyClass()
|
||||
|
||||
harness.run(proc)
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import Simple_baseline
|
||||
import time
|
||||
|
||||
t1 = time.clock()
|
||||
for i in range(1000000) :
|
||||
x = Simple_baseline.MyClass()
|
||||
#x.func()
|
||||
t2 = time.clock()
|
||||
print "Simple_baseline took %f seconds" % (t2 - t1)
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import Simple_builtin
|
||||
import time
|
||||
|
||||
t1 = time.clock()
|
||||
for i in range(1000000) :
|
||||
x = Simple_builtin.MyClass()
|
||||
#x.func()
|
||||
t2 = time.clock()
|
||||
print "Simple_builtin took %f seconds" % (t2 - t1)
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import Simple_optimized
|
||||
import time
|
||||
|
||||
t1 = time.clock()
|
||||
for i in range(1000000) :
|
||||
x = Simple_optimized.MyClass()
|
||||
#x.func()
|
||||
t2 = time.clock()
|
||||
print "Simple_optimized took %f seconds" % (t2 - t1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue