[Libreoffice] sal / unit tests ...

Michael Meeks michael.meeks at suse.com
Sat Jan 21 04:07:18 PST 2012


Hi guys,

	Suffering an Android problem around readLine - I thought I'd add a unit
test :-) [ after all the great work done to enable them, thanks !]. It
seems however that adding some CPPUNIT_ASSERT(false) lines to many of
the tests in osl_File.cxx meant they still passed beautifully ;-)

	I dug out a few problems, that might be generally interesting:

	* Cppunit_ gnumakefiles can only handle a single test per file
		+ I split up the osl_File one to make it run:

	  grep gb_CppunitTest_CppunitTest sal/*.mk

		shows a couple are still doubled up and need splitting.
	 Interestingly they seem to compile, but then not run :-)
	 perhaps we can fix that in the gnumake-ness some better way ?


	* Named registration is used without registering the name
		+ so we do lots of eg.

    CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( osl_File::readLine, "osl_File" );

		+ which adds this test to a named suite that is then
		  never executed :-)

		+ ergo we need to add:

    CPPUNIT_REGISTRY_ADD_TO_DEFAULT( "osl_File" );

		+ and equivalent all over the shop; unless I lost
		  the plot it's quite possible we're missing out huge
		  swathes of the existing unit tests for this reason :-)

	* Enabling some of the file tests - 'copy' and 'move' shows that
	  they don't actually pass under Linux; and I imagine there may
	  be worse for other platforms - and perhaps some nice bugs.

	If someone is interested in doing the audit across the code-base for
this sort of thing, to make sure we're not accidentally not running
tests that we could usefully use, that'd be cool.

	Otherwise ping me and I'll add another easy hack :-)

	Thanks,

		Michael.


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



More information about the LibreOffice mailing list