Mailinglist Archive: yast-devel (121 mails)
| < Previous | Next > |
Re: [yast-devel] testing functions using Pkg calls
- From: Martin Vidner <mvidner@xxxxxxx>
- Date: Mon, 27 Jun 2011 12:46:05 +0200
- Message-id: <20110627104605.GB13984@trikolka.suse.cz>
On Wed, Jun 22, 2011 at 09:42:25AM +0200, Jiri Suchomel wrote:
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
runtest.sh. Changing that is hacky, but you can look to
mail/testsuite/Makefile.am for inspiration.
--
Martin Vidner, YaST developer
http://en.opensuse.org/User:Mvidner
Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
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)?
Stano
Thanks, this works (with -n, not -M):
/usr/lib/YaST2/bin/y2base -l - -n Pkg=WFM -M . tests/ProductProfile.ycp
testsuite
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
runtest.sh. Changing that is hacky, but you can look to
mail/testsuite/Makefile.am for inspiration.
--
Martin Vidner, YaST developer
http://en.opensuse.org/User:Mvidner
Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
| < Previous | Next > |