<!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>&nbsp;&nbsp; 
Parrotbench<BR>&nbsp;&nbsp; 
Regress<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Lib<BR>Src<BR>&nbsp;&nbsp;&nbsp; bin<BR>&nbsp;&nbsp;&nbsp; 
Examples<BR>&nbsp;&nbsp;&nbsp; IronMath<BR>&nbsp;&nbsp;&nbsp; 
IronPython<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; AST<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp; Hosting<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 
Modules<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 
Objects<BR>&nbsp;&nbsp;&nbsp; IronPythonConsole<BR>&nbsp;&nbsp;&nbsp; 
IronPythonTest<BR>&nbsp;&nbsp;&nbsp; Scripts<BR><BR><BR>"External" 
directory contains all external tests:<BR>&nbsp;- CPython&nbsp;<SPAN 
class=217453223-08082005>library + tests </SPAN>inside the "Regress" 
subdirectory<BR>&nbsp;- Parrotbench test in the "Parrotbench" 
subdirectory<BR><BR>"Src" is the IronPython code that we 
release.<BR>&nbsp;-&nbsp;</FONT><SPAN class=217453223-08082005><FONT 
face=Courier>For the purpose of release we rename the directory (for example 
"IronPython-0.9"),<BR>&nbsp;&nbsp; </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>&nbsp;&nbsp;&nbsp; 
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>&nbsp;&nbsp;&nbsp; t0 = clock()<BR>&nbsp;&nbsp;&nbsp; 
import b0<BR>&nbsp;&nbsp;&nbsp; import b1<BR>&nbsp;&nbsp;&nbsp; import 
b2<BR>&nbsp;&nbsp;&nbsp; import b3<BR>&nbsp;&nbsp;&nbsp; import 
b4<BR>&nbsp;&nbsp;&nbsp; import b5<BR>&nbsp;&nbsp;&nbsp; import b6&nbsp; 
<BR>&nbsp;&nbsp;&nbsp; print 'import time = %.2f' % 
(clock()-t0)</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN 
class=217453223-08082005>&nbsp;&nbsp;&nbsp; if type == 
"short":<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N = 
1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tests = 
[b0,b1,b2,b3,b4,b6]<BR>&nbsp;&nbsp;&nbsp; elif type == 
"medium":<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N = 
2<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tests = 
[b0,b1,b2,b3,b4,b5,b6]<BR>&nbsp;&nbsp;&nbsp; elif type == 
"long":<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N = 
4<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tests = 
[b0,b1,b2,b3,b4,b5,b6]<BR>&nbsp;&nbsp;&nbsp; 
else:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; raise 
AssertionError("Unknown test type: %s" % type)</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN 
class=217453223-08082005>&nbsp;&nbsp;&nbsp; results = 
{}</SPAN></FONT></FONT></P>
<P><FONT size=+0><FONT face=Courier size=2><SPAN 
class=217453223-08082005>&nbsp;&nbsp;&nbsp; t0 = clock()<BR>&nbsp;&nbsp;&nbsp; 
for i in range(N):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for test in 
tests:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ts0 
= clock()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
test.main()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
tm = 
(clock()-ts0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
results.setdefault(test, 
[]).append(tm)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
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>&nbsp;&nbsp;&nbsp; for test in 
tests:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>&nbsp;&nbsp;&nbsp; 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>&nbsp;&nbsp;&nbsp; kind = "short"<BR>&nbsp;&nbsp;&nbsp; 
if len(sys.argv) &gt; 1:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kind = 
sys.argv[1]<BR>&nbsp;&nbsp;&nbsp; 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>&nbsp;</P></SPAN></FONT></FONT></BODY></HTML>