Friday, July 28, 2006

Western Chikans Grope

ST2JS - Translator from Smalltalk JavaScript (Part II)

will be the second! Yesterday, after posting the first part of this series , I managed to "finish" (did you ever finish developing the software?) Version of the package complete and stable enough to run a Test-Runner in Internet browser from JavaScript code, completely generated from Smalltalk classes. To the bravest published both as SqueakMap SqueakSource , Monticello
a package that works well in version 3.8
as in Squeak 3.9beta. By installing 2 Workspaces will open with some information on how to test the package. Perhaps most interesting to see whether the St2jS - TestRunner : The St2jS - TestRunner is, as its name suggests, a framework TestRunner UnitTesting . The particularity of this TestRunner is that it is based on Smallltalk, and runs completely on the side of the Internet browser. In addition to the tests (which are green) includes a set of classes with objects "base" (Object, Boolean, Point, WriteStream, etc). The same tool allows us to see the generated code segments with the options:
browse all
(Shows all the JS code generated in a single file), browse library (shows the generated code for implementations # jsLibrarySource ) browse class:
(shows the code for a class complete) and browse
(shows the source of the corresponding test method). can also re-run the tests on the side of the internet browser options all run (run all tests on the side of the Internet browser) and run (run the corresponding test in the browser internet). And also, we (from the Internet browser) side shoot functionality with Squeak squeak options: run (test method runs on Squeak) and squeak : browse (open the class browser in Squeak, pointing to the test method). Another feature already implemented, and necessary for any developer who is worthy to be a Smalltalk is the Inspector : For an inspector, you have to uncomment the last sentence of the method S2SBaseTestCase>> testInspect and reloading the Internet browser. The same inspector allows us to open other inspectors inspected parts of the object. In this case, if we press the button [inspect] that is at the right point, we get:

continued! UPDATE: For those who do not want want to waste time installing anything, I leave an HTML, with all the JS code included, that should work on any browser. Viewing the source of the document can see the generated code. St2jS - Test Runner.html UPDATE 2: A move from the HTML version independent: St2jS - Test Runner.html .