[Fuego] Add NEED_PROGRAM to need_check
Tim.Bird at sony.com
Tim.Bird at sony.com
Wed Feb 7 00:42:20 UTC 2018
> -----Original Message-----
> From: Daniel Sangorrin
>
> Hi Tim,
>
> > -----Original Message-----
> > From: fuego-bounces at lists.linuxfoundation.org [mailto:fuego-
> bounces at lists.linuxfoundation.org] On Behalf Of Liu, Wenlong
> > > In general, I prefer things to be done as check_needs, which means they
> > > are declarative, rather than in test_pre_check, which, strictly speaking,
> > > is imperative.
> > >
> > > Having declarative dependencies means you can do a static dependency
> > > checker.
>
> But many times we want a dynamic check as well. For example, we may want
> to
> skip some tests if we don't have root permissions but still run the other tests.
>
> I was wondering if we could kill 2 birds (no pun intended) with one shot:
Personally, I've never cared for that expression. ;-)
> - during the pre_check phase a script checks for variables that start with
> NEED_FOO
> - then, the script calls check_FOO() for each need.
>
> NEED_ROOT is currently being checked in a function called check_needs.
> Instead,
> we could define a functiona called "check_ROOT" and have it called
> automatically
> when NEED_ROOT=1 is declared on the script. The advantage of this
> approach, is
> that tests can still call "check_ROOT" dynamically.
>
> What do you think?
I don't mind restructuring the code so that some of these dependencies
could be called both explicitly and implicitly. However, I think the mixed
case is a bit ugly, and I'd rather we just used:
check_root, and NEED_ROOT.
-- Tim
More information about the Fuego
mailing list