<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=koi8-r">
<META content="MSHTML 6.00.2900.2722" name=GENERATOR></HEAD>
<BODY><!-- Converted from text/plain format -->
<P><FONT size=2><FONT face=Courier>Hello,<BR><BR>last week I promised to send
out a description how to incorporate Pie-thon (a.k.a. parrotbench) and Pystone
tests into the IronPython distribution to run the tests along with the
IronPython test suite. Here is how to do it<SPAN
class=217453223-08082005>.</SPAN></FONT></FONT></P>
<DIV><FONT size=2><FONT face=Courier>The environment in which we run tests looks
like this:<BR><BR>IRONPYTHON_BASE<BR>External<BR>
Parrotbench<BR>
Regress<BR>
Lib<BR>Src<BR> bin<BR>
Examples<BR> IronMath<BR>
IronPython<BR> AST<BR>
Hosting<BR>
Modules<BR>
Objects<BR> IronPythonConsole<BR>
IronPythonTest<BR> Scripts<BR><BR><BR>"External"
directory contains all external tests:<BR> - CPython <SPAN
class=217453223-08082005>library + tests </SPAN>inside the "Regress"
subdirectory<BR> - Parrotbench test in the "Parrotbench"
subdirectory<BR><BR>"Src" is the IronPython code that we
release.<BR> - </FONT><SPAN class=217453223-08082005><FONT
face=Courier>For the purpose of release we rename the directory (for example
"IronPython-0.9"),<BR> </FONT></SPAN></FONT><FONT face=Courier
size=2><SPAN class=217453223-08082005>renaming it back to "Src" will plug it
right in place.</SPAN></FONT></DIV>
<P><FONT face=Courier size=2>"Parrotbench" directory contains the parrotbench
benchmark files (b*.py, parrotrun.py, ...)<BR>To get parrotbench sources,
download IronPython 0.6 from </FONT><A href="http://www.ironpython.com"><FONT
face=Courier size=2>http://www.ironpython.com</FONT></A><FONT face=Courier
size=2>.<BR>The IronPython 0.6 distribution contains the Parrotbench in its
"tests" directory.</FONT></P>
<P><SPAN class=217453223-08082005><FONT face=Courier size=2>The parrotrun.py is
a file Jim wrote to make running the tests easier. It has not been part of our
releases yet and unfortunatelly I modified it so the version you get from
IronPython 0.6 won't work. At the bottom of this email is the right version of
the parrotrun.py that will work with the tests. Starting with our next release,
we will include the parrotrun.py with the release so that things work
smoother.</FONT></SPAN></P>
<P><FONT><FONT face=Courier size=2>Pystone + CPython regression test
suite<BR>Download the 2.3.5 release of CPython from </FONT></FONT><A
href="http://www.python.org/2.3.5"><FONT face=Courier
size=2>http://www.python.org/2.3.5</FONT></A><BR><FONT face=Courier
size=2>Library and tests are in the "Lib" directory of the Python
installation.<BR>Copy the whole Lib directory into "Regress".</FONT></P>
<P><FONT face=Courier size=2><SPAN class=217453223-08082005>Once you have
combined IronPython release files with parrot-bench from IronPython 0.6 and
standard CPython libraries, you can run the tests by exe</SPAN></FONT></P>
<P><FONT face=Courier size=2>Running the tests:</FONT></P>
<P><FONT face=Courier size=2>To run the tests, execute:<BR><SPAN
class=217453223-08082005>S</SPAN>rc\bin\IronPythonConsole.exe
Src\Scripts\RunTests.py</FONT></P>
<P><FONT face=Courier size=2>The RunTests.py accepts command line parameters,
one of them being the type of the test - short, medium, long (run "RunTests.py
-?" for more details)</FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN class=217453223-08082005>Known
issue is running "long" version of regression tests (runtests.py regr long). We
had to make some changes to the Python test suite to get the long version
running so if you run it, it will fail. For now, I would recommend
running:</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN
class=217453223-08082005>"IronPythonConsole.exe RunTests.py iron pystone parrot
long"</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN class=217453223-08082005>I hope
this helps for now and if you have any questions, don't hesitate to contact me
so that we can address them.</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN class=217453223-08082005>Thanks
and keep in touch,<BR></SPAN></FONT></FONT><FONT size=+0><FONT face=Courier
size=2><SPAN class=217453223-08082005>Martin</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN class=217453223-08082005><FONT
size=+0><FONT face=Courier size=2><SPAN class=217453223-08082005><FONT
size=+0><FONT face=Courier size=2><SPAN class=217453223-08082005>parrotrun.py
file:</SPAN></FONT></FONT></P></SPAN></FONT></FONT></SPAN></FONT></FONT>
<P><FONT size=+0><FONT face=Courier size=2><SPAN
class=217453223-08082005>##################################################</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN class=217453223-08082005>"""
This provides a more convenient harness for running this<BR>
benchmark and collecting separate timings for each
component.<BR>"""</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN class=217453223-08082005>from
time import clock<BR>import sys</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN class=217453223-08082005>def
main(type="short"):<BR> t0 = clock()<BR>
import b0<BR> import b1<BR> import
b2<BR> import b3<BR> import
b4<BR> import b5<BR> import b6
<BR> print 'import time = %.2f' %
(clock()-t0)</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN
class=217453223-08082005> if type ==
"short":<BR> N =
1<BR> tests =
[b0,b1,b2,b3,b4,b6]<BR> elif type ==
"medium":<BR> N =
2<BR> tests =
[b0,b1,b2,b3,b4,b5,b6]<BR> elif type ==
"long":<BR> N =
4<BR> tests =
[b0,b1,b2,b3,b4,b5,b6]<BR>
else:<BR> raise
AssertionError("Unknown test type: %s" % type)</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN
class=217453223-08082005> results =
{}</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN
class=217453223-08082005> t0 = clock()<BR>
for i in range(N):<BR> for test in
tests:<BR> ts0
= clock()<BR>
test.main()<BR>
tm =
(clock()-ts0)<BR>
results.setdefault(test,
[]).append(tm)<BR>
print '%.2f sec running %s' % ( tm, test.__name__)</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN
class=217453223-08082005> for test in
tests:<BR> print '%s = %f -- %r' %
(test.__name__, sum(results[test])/N, results[test])</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN
class=217453223-08082005> print 'all done in %.2f sec' %
(clock()-t0)</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN class=217453223-08082005>if
__name__=="__main__":<BR> kind = "short"<BR>
if len(sys.argv) > 1:<BR> kind =
sys.argv[1]<BR> main(kind)</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN
class=217453223-08082005></SPAN></FONT></FONT><FONT size=+0><FONT face=Courier
size=2><SPAN class=217453223-08082005><FONT size=+0><FONT face=Courier
size=2><SPAN
class=217453223-08082005>##################################################</SPAN></FONT></FONT></SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN class=217453223-08082005><FONT
size=+0><FONT face=Courier size=2><SPAN
class=217453223-08082005></SPAN></FONT></FONT></SPAN></FONT></FONT><FONT
size=+0><FONT face=Courier size=2><SPAN class=217453223-08082005><FONT
face=Verdana></FONT> </P></SPAN></FONT></FONT></BODY></HTML>