[Pharo-project] tests ui errors in headless mode

Igor Stasenko siguctua at gmail.com
Thu May 26 17:38:50 CEST 2011

To simulate running test in headless mode, use following:

| old |
old := UIManager default.
UIManager default: old nonInteractiveManager.

1 inspect.
 ] ensure: [ UIManager default: old ]

and so, if you don't handle the error.. image will quit and error
logged to PharoDebug.log :

26 May 2011 7:31:32 pm

VM: Mac OS - intel - 1066 - Croquet Closure Cog VM [CoInterpreter
VMMaker-oscog-MarianoMartinezPeck.66] NBCog VM 4.0.0
Image: Pharo1.3a [Latest update: #13204]

        Receiver: a NonInteractiveUIManager
        Arguments and temporary variables:
                aMessage:       openInspector: Inspector asMorphOn: 1
withLabel: 'SmallInteger: 1'
                exception:      MessageNotUnderstood:
                resumeValue:    nil
        Receiver's instance variables:
                uiManager:      a MorphicUIManager
                doNotQuitOnRestart:     false

You can also turn on #snapshotErrorImage setting, then on unhandled
error, before quit
an image will be saved (with different version)  and if you open that
image you will see that error in debugger.

On 25 May 2011 21:21, Tudor Girba <tudor at tudorgirba.com> wrote:
> Hi,
> We have some smoke tests in Moose that basically spawn a UI and check for Error.
> This used to work when running headless in Pharo 1.2 but now they fail in Pharo 1.3. I believe this has to do with the new changes in the UI Manager, but I do not know what to do.
> To reproduce the problem, you can simply call a Pharo-1.3.image in headless mode and file in the attached st file that:
> - installs a simple test:
> HeadlessTest>>testStartup
>        self shouldnt:  [1 inspect] raise:  Error
> - loads HudsonTools
> - runs the test and outputs the XML file report
> - although the test should pass, it raises the error:
> HeadlessStartupTest(TestCase)>>signalFailure:
> HeadlessStartupTest(TestCase)>>assert:
> HeadlessStartupTest(TestCase)>>shouldnt:raise:
> HeadlessStartupTest>>testStartup
> HeadlessStartupTest(TestCase)>>performTest
> Can anyone help?
> Cheers,
> Doru
> --
> www.tudorgirba.com
> "What is more important: To be happy, or to make happy?"

Best regards,
Igor Stasenko AKA sig.

More information about the Pharo-project mailing list