MarsPackageBrowser and MarsTestRunner: fresh new examples by the end of GSoC 2013

Hey Hey!

So, the GSoC 2013 is finished (at least for students!) and now everybody is waiting for the final results. To wrap up the project I decided to try to build some examples that could resemble more a real application, so here is a screencast showing a new MarsPackageBrowser example from where you can open a MarsTestRunner and run some tests!

For downloading this version of the project evaluate this code in your Pharo image’s workspace:

Gofer it 
url: 'http://www.smalltalkhub.com/mc/estebanlm/Mars/main'; 
package: 'ConfigurationOfMars'; 
load. 
(ConfigurationOfMars project version: '0.3.1') load.
If you want to open the MarsPackageBrowser, evaluate:
MarsPackageBrowser new open.

If you want to play with the test runner, just open it directly specifying the name of the package containing tests:

MarsTestRunner openFor: 'Mars-Gtk-Tests' .

You will observe in the screencast that there is also a “Commit” button in the package browser. The plan is to use that as an example for a modal window. The button would commit the package directly in its default repository after opening a modal window asking for a description and then pressing an Accept button.

And as I say in the screencast, the package browser is only for browsing without editing, for now. It shouldn’t be difficult actually, but I’m paying more attention to test different kind of widgets together interacting with each other, and also testing different combinations of layouts, to provide the community with examples and also test how robust is Mars. Building these examples was actually useful to find and fix many bugs πŸ™‚ And also incorporate new widgets as the Progress Bar (I love the progress bar! You should have seen my face the first time I got it to animate from 0 to 100%, hehe).

Some aesthetic features have to still be improved: I really want to be able to add padding or margins to containers, and also to give different kind of alignments to labels and text.

I also found one big difference between GTK and Cocoa that I had not noticed before. In GTK at first the progress bar wasn’t animating, once all the test were run the bar would appear at 100% directly. The list wasn’t “populating” row by row either as you can see in the screencast, the whole list would appear once the tests finished running. So the Test Runner window looked totally frozen for some seconds until showing everything in the final state. I solved this by forking the running of the tests. But the same code in Cocoa would make the Test Runner crash after running some tests (I don’t know why :(). So I had to incorporate two little methods for running platform specific code. I don’t really see it as an ugly patch, because I assumed from the beginning that I would eventually need to run platform specific code having two UI frameworks so different from each other. Actually I’m surprised that this is the first time I have to do it.

So in MarsTestRunner>>runTests you can find these two lines at the end of the method:

MarsToolkit ifUsingGTK: [[testSuite run: result] fork]. 
MarsToolkit ifUsingCocoa: [testSuite run: result].

I think the same code will be useful for cases where you want to use different widgets for each platform, to follow better each framework’s user interface guidelines.

On another topic, here are some conclusions after the GSoC coding period ended. I can say that:

  • I knew this project was going to be very hard, and still I underestimated it πŸ˜›
  • That said, I wish I could have done more stuff in these 4 months, but I’m satisfied with the results so far. Now I really think that “more hands” should be involved to grow and improve this working version.
  • I couldn’t make it on time to add Windows’ widgets, but I will do it as soon as I get a strong base for Cocoa and GTK
  • Working on Cocoa and GTK almost in parallel was a fundamental part of my progress, if I would have made first all the widgets and layouts and everything of only one framework and then tried to translate it to the other, I would still be crying πŸ˜›

So, who will the brave coder that will load the project and start trying to build applications with Mars?

I’ll be waiting for questions and requests! πŸ™‚

3 thoughts on “MarsPackageBrowser and MarsTestRunner: fresh new examples by the end of GSoC 2013

  1. Carla,

    I’m working with Pharo 2.0 with ubunto and OSX. In Ubunto both Browsers open fine.

    But using OSX if I evaluate
    MarsPackageBrowser new open.
    the following Error occurs in
    CocoaPopUpMenu:addItemsWithTitles:
    asNsArray notUnderstood.

    • Sorry the reply in wordpress is to fast for me );

      I like your work and will try to port our Dolphin Smalltalk Application to Mac and Unix.

      Thanks

Leave a comment