Re: need help with unit test and process service factory

2012-10-11 Thread Eike Rathke
Hi Michael,

On Wednesday, 2012-10-10 20:59:54 +0100, Michael Meeks wrote:

  Do you mean g_main_context_iteration ?
  It's used both in the real code and unit test.
 
   It shouldn't be used in the real code - we should integrate with the
 glib mainloop that is plugged into VCL :-)

AFAIK we do that for real code (if things didn't change).

  From what I understood, it's how telepathy framework works and it
  can't be avoided.

   The problem is a careless use of an iteration; if we ran the mainloop
 until an asynchronous callback quit it - that would be -much- less of a
 problem :-)

And we do that :-)

 The root problem is trying to 2nd guess how many main-loop
 iterations to call - which is non documented, non deterministic and
 guarenteed to change between minor releases :-)

And we don't do it ;-)

while (!pImpl-mbAccountManagerReadyHandlerInvoked)
g_main_context_iteration( NULL, TRUE);

spins the main loop until the callback set
mbAccountManagerReadyHandlerInvoked=true

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD
Support the FSFE, care about Free Software! https://fsfe.org/support/?erack


pgpq3bCUuhh6J.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: need help with unit test and process service factory

2012-10-10 Thread Matúš Kukan
On 28 September 2012 11:26, Michael Meeks michael.me...@suse.com wrote:
 If we can create a unit test that doesn't require any of that, it'd be
 great of course. Having said that, I was not a great fan of the way
 those unit tests work in the 1st instance with that manual spin the loop
 n times type stuff that is hyper fragile - or did we fix that ?

Do you mean g_main_context_iteration ?
It's used both in the real code and unit test.
From what I understood, it's how telepathy framework works and it
can't be avoided.

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


Re: need help with unit test and process service factory

2012-10-10 Thread Matúš Kukan
On 28 September 2012 15:43, Michael Meeks michael.me...@suse.com wrote:
 IMHO it would be better to write unit tests to test the protocol
 fragments we get out of the calc core, and ensure that these continue to
 work nicely :-) run a stream of commands save document diff output
 etc.

Nice idea for next unit test. :-)
We probably also want to expand the protocol first.

 I love unit tests more than most, but - there are some limits to the
 harnesses people can easily construct out there.

 Of course - if we had a small / fall-back TCP / local socket version 
 we
 could do some testing via that but ... it's not really going to test
 much more than the above is it ?

It's more like documentation what app like sc needs to do I think.

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


Re: need help with unit test and process service factory

2012-10-10 Thread Michael Meeks

On Wed, 2012-10-10 at 21:15 +0200, Matúš Kukan wrote:
 On 28 September 2012 11:26, Michael Meeks michael.me...@suse.com wrote:
  If we can create a unit test that doesn't require any of that, it'd 
  be
  great of course. Having said that, I was not a great fan of the way
  those unit tests work in the 1st instance with that manual spin the loop
  n times type stuff that is hyper fragile - or did we fix that ?
 
 Do you mean g_main_context_iteration ?
 It's used both in the real code and unit test.

It shouldn't be used in the real code - we should integrate with the
glib mainloop that is plugged into VCL :-)

 From what I understood, it's how telepathy framework works and it
 can't be avoided.

The problem is a careless use of an iteration; if we ran the mainloop
until an asynchronous callback quit it - that would be -much- less of a
problem :-) The root problem is trying to 2nd guess how many main-loop
iterations to call - which is non documented, non deterministic and
guarenteed to change between minor releases :-)

ATB,

Michael.

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

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


Re: need help with unit test and process service factory

2012-09-28 Thread Miklos Vajna
On Fri, Sep 28, 2012 at 01:44:28AM +0200, Matúš Kukan matus.ku...@gmail.com 
wrote:
 Ah, that's not true. It should be for building,
 but I forgot that for unit test we need empathy with two jabber
 accounts configured.
 Is that too much for tinderbox ?

commit 49cec3fa6f25cdf2f24602696b6a94570cbbfc2f added a libreoffice user
profile for unit tests. Couldn't be a similar empathy profile added for
the tubes test?
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: need help with unit test and process service factory

2012-09-28 Thread Michael Meeks

On Fri, 2012-09-28 at 01:44 +0200, Matúš Kukan wrote:
 On 28 September 2012 01:03, Matúš Kukan matus.ku...@gmail.com wrote:
  Also, it would be really great to have at least one linux tinderbox
  with --enable-telepathy.
  Only recent telepathy-glib is needed.
 
 Ah, that's not true. It should be for building,
 but I forgot that for unit test we need empathy with two jabber
 accounts configured.
 Is that too much for tinderbox ?

In a word - yes :-)

If we can create a unit test that doesn't require any of that, it'd be
great of course. Having said that, I was not a great fan of the way
those unit tests work in the 1st instance with that manual spin the loop
n times type stuff that is hyper fragile - or did we fix that ?

ATB,

Michael.

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

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


Re: need help with unit test and process service factory

2012-09-28 Thread Stephan Bergmann

On 09/28/2012 01:03 AM, Matúš Kukan wrote:

I've tried --enable-telepathy again and found out that the unit test
does not work now.
After 
http://cgit.freedesktop.org/libreoffice/core/commit/?id=4917f0ceb2a7b1bb3ba878373f71f38d156278af
I am getting:
- Exception while getting config.ini url: null process service factory
It's from tubes/qa/test_manager.cxx :
utl::LocalFileHelper::ConvertPhysicalNameToURL


That ConvertPhysicalNameToURL apparently internally calls 
comphelper::getProcessServiceFactory to obtain the process service 
factory; what recently changed with 
http://cgit.freedesktop.org/libreoffice/core/commit/?id=2a32bf29b98403872235f880e91b1c08cd3d7f68 
Make getProcessComponentContext/ServiceFactory throw instead of 
returning null is that it throws now when the factory is unset (which 
it should never be).


The way CppUnit tests should get the factory set is via the 
unobootstrapprotector that is enabled with gb_CppunitTest_use_ure (cf. 
solenv/gbuild/CppunitTest.mk).  What is unclear to me is whether that 
also requires that your test fixture is derived from 
test::BootstrapFixtureBase (unotest/bootstrapfixturebase.hxx) or whether 
CppUnit::TestFixture suffices.


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


Re: need help with unit test and process service factory

2012-09-28 Thread Michael Meeks

On Fri, 2012-09-28 at 09:35 +0200, Miklos Vajna wrote:
 commit 49cec3fa6f25cdf2f24602696b6a94570cbbfc2f added a libreoffice user
 profile for unit tests. Couldn't be a similar empathy profile added for
 the tubes test?

And require empathy + telepathy of a certain version to be installed on
the tinderbox machine (and each builder's machine?), and presumably a
jabber server setup and running and ...

IMHO it would be better to write unit tests to test the protocol
fragments we get out of the calc core, and ensure that these continue to
work nicely :-) run a stream of commands save document diff output
etc.

I love unit tests more than most, but - there are some limits to the
harnesses people can easily construct out there.

Of course - if we had a small / fall-back TCP / local socket version we
could do some testing via that but ... it's not really going to test
much more than the above is it ?

ATB,

Michael.

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

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


need help with unit test and process service factory

2012-09-27 Thread Matúš Kukan
Hi,

I've tried --enable-telepathy again and found out that the unit test
does not work now.
After 
http://cgit.freedesktop.org/libreoffice/core/commit/?id=4917f0ceb2a7b1bb3ba878373f71f38d156278af
I am getting:
- Exception while getting config.ini url: null process service factory
It's from tubes/qa/test_manager.cxx :
utl::LocalFileHelper::ConvertPhysicalNameToURL

Maybe 
http://cgit.freedesktop.org/libreoffice/core/diff/unotools/source/ucbhelper/localfilehelper.cxx?id=9ac86f484b0c278aafbce685ed19d3ea005ee8f8
is responsible ?
What I need for using process service factory ?
I've tried to add +$(eval $(call gb_CppunitTest_use_ure,tubes_test))
but then I get:
terminate called after throwing an instance of
'com::sun::star::uno::DeploymentException'
Any thoughts ?

Also, it would be really great to have at least one linux tinderbox
with --enable-telepathy.
Only recent telepathy-glib is needed.

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


Re: need help with unit test and process service factory

2012-09-27 Thread Matúš Kukan
On 28 September 2012 01:03, Matúš Kukan matus.ku...@gmail.com wrote:
 Also, it would be really great to have at least one linux tinderbox
 with --enable-telepathy.
 Only recent telepathy-glib is needed.

Ah, that's not true. It should be for building,
but I forgot that for unit test we need empathy with two jabber
accounts configured.
Is that too much for tinderbox ?

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