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

Michael Meeks michael.meeks at novell.com
Wed Sep 28 01:46:36 PDT 2011


Hi guys,

On Tue, 2011-09-27 at 19:01 -0500, Norbert Thiebaud wrote:
> Don't get me wrong... I'd love to run make check on these boxes... but
> not if that means that I have to watch them like milk on fire (1)...

	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 String &rErr, const String &rAction )
{
    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 of course - we should do that by code sharing. 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.

	Regards,

		Michael.

-- 
michael.meeks at suse.com  <><, Pseudo Engineer, itinerant idiot



More information about the LibreOffice mailing list