[yast-devel] Re: [yast-commit] r64465 - Y2ALLGLOBAL
On Fri, Jun 17, 2011 at 03:28:05PM -0000, lslezak@svn2.opensuse.org wrote:
Author: lslezak Date: Fri Jun 17 17:28:04 2011 New Revision: 64465
URL: http://svn.opensuse.org/viewcvs/yast?rev=64465&view=rev Log: move Wagon::FindMountPoint() function to separate include file
so it can be tested, added a testsuite for it
TESTS, WOW! BTW it is a secret little feature of yast2-core that defining the environment variable Y2ALLGLOBAL makes all functions in a module global. It is enabled during the tests, so wagon_helpers.ycp just because of the tests is unnecessary.
Added: trunk/wagon/src/include/wagon_helpers.ycp trunk/wagon/testsuite/tests/FindMountPoint.err trunk/wagon/testsuite/tests/FindMountPoint.out trunk/wagon/testsuite/tests/FindMountPoint.ycp Modified: trunk/wagon/src/modules/Makefile.am trunk/wagon/src/modules/Wagon.ycp
-- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
Dne 20.6.2011 17:53, Martin Vidner napsal(a):
BTW it is a secret little feature of yast2-core that defining the environment variable Y2ALLGLOBAL makes all functions in a module global. It is enabled during the tests, so wagon_helpers.ycp just because of the tests is unnecessary.
I actually remembered that feature when I was writing the test. The reason why the function has been put into a separate file is that Wagon.ycp includes many other modules and at least one of them is doing something nasty in the constructor (reading some values from system) and that prevents from reliable testing. So to all developers: think about testing when writing a module constructor! It cannot be skipped/mocked/stubbed in YCP! -- Best Regards Ladislav Slezák Yast Developer ------------------------------------------------------------------------ SUSE LINUX, s.r.o. e-mail: lslezak@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Prague 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
participants (2)
-
Ladislav Slezak
-
Martin Vidner