<p dir="ltr">Thanks for the explanation guys.</p>
<p dir="ltr">If no one objects, I am happy to take on the task of converting these by removing the tcl-isms. I can start putting up code for review next week.</p>
<p dir="ltr">I agree with Bill since people tend to look at the tests for guidance in implementing their own code so our Python tests should be made made more pythonic now they work.<br>
I found tcl2py really useful when converting the tcl tests a while back. As David pointed out the formatting was quite good with it.</p>
<p dir="ltr">Regards<br>
   Andrew</p>
<div class="gmail_quote">On 13/03/2013 3:13 AM, "Bill Lorensen" <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Since we are not creating tcl tests anymore (at least it seems that way), it would be great to cleanup the python tests and get rid of the tcl-isms. It will also make them more useful and easier to read.<div><br><br><div class="gmail_quote">

On Tue, Mar 12, 2013 at 6:23 AM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div>On Tue, Mar 12, 2013 at 7:13 AM, Kyle Lutz <<a href="mailto:kyle.lutz@kitware.com" target="_blank">kyle.lutz@kitware.com</a>> wrote:<br>
> On Tue, Mar 12, 2013 at 3:39 AM, Andrew Maclean<br>
> <<a href="mailto:andrew.amaclean@gmail.com" target="_blank">andrew.amaclean@gmail.com</a>> wrote:<br>
>> OK ... I deleted the build directory and ran CMake again and things are much<br>
>> improved. See: <a href="http://open.cdash.org/viewTest.php?onlyfailed&buildid=2843128" target="_blank">http://open.cdash.org/viewTest.php?onlyfailed&buildid=2843128</a><br>
>><br>
>> However:<br>
>> vtkpython TestProjectedTerrainPath.py<br>
>> Traceback (most recent call last):<br>
>>   File "TestProjectedTerrainPath.py", line 15, in <module><br>
>>     lo = lindex(demReader.GetOutput().GetScalarRange(),0)<br>
>> NameError: name 'lindex' is not defined<br>
>><br>
>> yet:<br>
>><br>
>> ctest -R TestProjectedTerrainPath<br>
>> Test project /home/amaclean/Code/Kitware/build/VTK<br>
>>     Start 674: vtkFiltersHybridPython-TestProjectedTerrainPath<br>
>> 1/2 Test #674: vtkFiltersHybridPython-TestProjectedTerrainPath ...   Passed<br>
>> 2.24 sec<br>
>>     Start 693: vtkFiltersHybridTcl-TestProjectedTerrainPath<br>
>> 2/2 Test #693: vtkFiltersHybridTcl-TestProjectedTerrainPath ......   Passed<br>
>> 1.69 sec<br>
>><br>
>> 100% tests passed, 0 tests failed out of 2<br>
>><br>
>> Could someone please point me to an explanation as to why ctest works, I<br>
>> would have expected a fail at line 15 because of lindex(). My concern here<br>
>> is that if it is Python code you would reasonably expect just Python code<br>
>> lindex() is certainly not that.<br>
>> I don't understand how these Python equivalents of the Tcl names are being<br>
>> brought in by CTest.<br>
><br>
> Hi Andrew,<br>
><br>
> Most (all?) of the converted TCL scripts are run through the<br>
> rtImageTest.py driver which defines a few functions/variables (one of<br>
> which is lindex).<br>
><br>
> If you run "ctest -R vtkFiltersHybridPython-TestProjectedTerrainPath<br>
> -V -N" you can see the command line that ctest uses on the line that<br>
> starts with "Test command:". Running that entire command should give<br>
> you the same results as running the test with ctest.<br>
><br>
> -kyle<br>
<br>
</div></div>I'm not a fan of all the "tcl-isms" in the python tests, myself.  The<br>
vtkTclTestToPy converter that was used for most test generates<br>
python code that is barely legible.  We have another converter,<br>
tcl2py.py, which isn't quite as powerful but which produces much<br>
nicer output.<br>
<span><font color="#888888"><br>
 - David<br>
</font></span><div><div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>
</blockquote></div>