Mailinglist Archive: yast-devel (121 mails)

< Previous Next >
Re: [yast-devel] testing functions using Pkg calls
On Wed, Jun 22, 2011 at 09:42:25AM +0200, Jiri Suchomel wrote:
Dne Út 21. června 2011 16:43:06 Stanislav Visnovsky napsal(a):
On Ut 21. Jún 2011 16:36:01 Ladislav Slezak wrote:
Dne 21.6.2011 16:21, Jiri Suchomel napsal(a):
Would it make sense to revive this? Or to even enable real mocking of
Pkg? Or is it waste of the effort, which we should rather invest into
the new YaST++ project?

This still should be possible. Did you try to use y2base -M option
(namespace overloading)?


Thanks, this works (with -n, not -M):

/usr/lib/YaST2/bin/y2base -l - -n Pkg=WFM -M . tests/ProductProfile.ycp

where Pkg.y* exists in current directory ("-M .")

I think this is a good direction to approach this, except that the
test runner script is a bad place to specify the namespace
exceptions. I think that it should be doable from inside the yast
runtime, something like
import "Pkg" from "WFM";
or even

import "Pkg", $["from": "WFM", "dir": "."]; // combine -n, -M

which is more flexible and does not need special syntax so it will be
acceesible even from other languages.

The improved import statement should enable mocking on a wider
scale. For now you could use the -n and -M options, but I am afraid
that the test harness will by default overwrite your changes to Changing that is hacky, but you can look to
mail/testsuite/ for inspiration.
Martin Vidner, YaST developer

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
< Previous Next >
Follow Ups