Re: [Libreoffice] unit-test / code sharing ...

2011-09-29 Thread Michael Meeks

On Wed, 2011-09-28 at 11:47 +0200, Stephan Bergmann wrote:
  I suspect we should do this for all unit-tests above tools, and the
  head-less smoketest too.
 
 But isn't it the way that all dialogs are implicitly cancelled in 
 headless mode, anyway?

Oh - quite possibly for headless mode - though they perhaps do it a
different way, we just call InitVCL - prolly we could do better.

For one thing I'm re-factoring some parts of the vcl's svp backend to
make it more independent of X, if we can get all the way with that, we
can make that work cross-platform which'd be nice.

Regards,

Michael.

-- 
michael.me...@suse.com  , Pseudo Engineer, itinerant idiot

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] unit-test / code sharing ...

2011-09-28 Thread Caolán McNamara
On Wed, 2011-09-28 at 09:46 +0100, Michael Meeks wrote:
 Reading the various cppunit tests we have and the code cut/paste going
 on gives some concern. We need a place to share most of this really
 bootstrap UNO heavy lifting and the various other bits of common
 magic that go on there, presumably a CppUnit::TestFixture sub-class -
 where quite that belongs, I don't know - perhaps vcl would be a good
 place.

Yeah, test would be fine probably. The intent was to merge the common
code back together once the various filter tests in different modules
flushed out the required flags and magic, but I didn't get around to it.

C.

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] unit-test / code sharing ...

2011-09-28 Thread Stephan Bergmann

On 09/28/2011 11:27 AM, Caolán McNamara wrote:

On Wed, 2011-09-28 at 09:46 +0100, Michael Meeks wrote:

Reading the various cppunit tests we have and the code cut/paste going
on gives some concern. We need a place to share most of this really
bootstrap UNO heavy lifting and the various other bits of common
magic that go on there, presumably a CppUnit::TestFixture sub-class -
where quite that belongs, I don't know - perhaps vcl would be a good
place.


Yeah, test would be fine probably. The intent was to merge the common
code back together once the various filter tests in different modules
flushed out the required flags and magic, but I didn't get around to it.


Yes, test was intended for such stuff -- but we need to make sure not to 
introduce circular dependencies.  (The conceptual level of that module 
is still somewhat undecided.)


-Stephan
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] unit-test / code sharing ...

2011-09-28 Thread Stephan Bergmann

On 09/28/2011 10:46 AM, Michael Meeks wrote:

Incidentally, while trying to get some StarBasic / VBA unit tests
working with Moggi, it seemed that some of our hangs were down to
dialogs showing up that were simply not visible, and spinning the
mainloop waiting for a response.

static void aBasicErrorFunc( const StringrErr, const StringrAction )
{
 rtl::OStringBuffer aErr( Unexpected dialog:  );
 aErr.append( rtl::OUStringToOString( rAction, RTL_TEXTENCODING_ASCII_US ) 
);
 aErr.append(  Error:  );
 aErr.append( rtl::OUStringToOString( rErr, RTL_TEXTENCODING_ASCII_US ) );
 CPPUNIT_ASSERT_MESSAGE( aErr.getStr(), false);
}

void FiltersTest::setUp()
{
 ErrorHandler::RegisterDisplay( aBasicErrorFunc );
}

Solves that rather pleasantly, with the added bonus that it might help
improve the accuracy / helpfulness our basic error reporting over time.

I suspect we should do this for all unit-tests above tools, and the
head-less smoketest too.


But isn't it the way that all dialogs are implicitly cancelled in 
headless mode, anyway?


-Stephan
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] unit-test / code sharing ...

2011-09-28 Thread Markus Mohrhard
Hello Stephan,

2011/9/28 Stephan Bergmann sberg...@redhat.com

 On 09/28/2011 10:46 AM, Michael Meeks wrote:

Incidentally, while trying to get some StarBasic / VBA unit tests
 working with Moggi, it seemed that some of our hangs were down to
 dialogs showing up that were simply not visible, and spinning the
 mainloop waiting for a response.

 static void aBasicErrorFunc( const StringrErr, const StringrAction )
 {
 rtl::OStringBuffer aErr( Unexpected dialog:  );
 aErr.append( rtl::OUStringToOString( rAction,
 RTL_TEXTENCODING_ASCII_US ) );
 aErr.append(  Error:  );
 aErr.append( rtl::OUStringToOString( rErr, RTL_TEXTENCODING_ASCII_US )
 );
 CPPUNIT_ASSERT_MESSAGE( aErr.getStr(), false);
 }

 void FiltersTest::setUp()
 {
 ErrorHandler::RegisterDisplay( aBasicErrorFunc );
 }

Solves that rather pleasantly, with the added bonus that it might
 help
 improve the accuracy / helpfulness our basic error reporting over time.

I suspect we should do this for all unit-tests above tools, and the
 head-less smoketest too.


 But isn't it the way that all dialogs are implicitly cancelled in headless
 mode, anyway?

 The Basic Error Dialog seems to be the only dialog at the moment that still
tries to show up and results in a loop while waiting for user input.
Micheal's patch fixed that problem for me and makes it possible to try to
run basic code in unit tests.

Markus
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] unit-test / code sharing ...

2011-09-28 Thread Caolán McNamara
On Wed, 2011-09-28 at 11:44 +0200, Stephan Bergmann wrote:
 Yes, test was intended for such stuff -- but we need to make sure not to 
 introduce circular dependencies.  (The conceptual level of that module 
 is still somewhat undecided.)

fattest/uglytest, slimtest/goodtest if it arises maybe :-)

C.

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice