On Sun, Aug 29, 2010 at 1:30 AM, taa, Leo Newbie > I can see I wasn't clear. I meant, "Can Leo's unit testing capability > be used to perform unit tests in other programming languages, or is > Leo's unit testing capability confined to Leo itself and Python?"
Leo can run scripts in other languages besides Python. One simply needs to create an @button node to do so. For example, here is a script (full details in scripts.leo) that runs a tcl script from Leo's body pane:: QQQQQ # To use this script, you must make this a script button, either with the # 'Script Button' button or by making this an @button node. # Executes body text of selected node as a tcl script. # For more information, see http://wiki.tcl.tk/6878 # This statement allows you to organize your scripts using noweb markup. s = g.getScript(c,p,forcePythonSentinels=False) g.es(g.app.root.tk.eval(s)) QQQQQ This script only works when using Leo's Tk gui, but it could be changed to execute the Tk code in an external process. In that case, you would have to pass the "synthesized" script to Tk, but that should be straightforward. One can extend this idea to run unit tests *from Leo* in other languages. Indeed, the recently-discovered pattern:: exec(g.findTestScript(c,'@common test code')) runTest(c,p) where 'runTest' is defined in the '@common test code' tree, would be an easy way of defining tests in other languages than Python. The point is that the code in the '@common test code' tree will be Python code, but that Python code will run code in another language. HTH. Edward ------------------------------------------------------------------------------ Edward K. Ream email: [email protected] Leo: http://webpages.charter.net/edreamleo/front.html ------------------------------------------------------------------------------ -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
