[libvirt] [PATCH] fchosttest: Run the test only under linux
Daniel P. Berrange
berrange at redhat.com
Fri Sep 27 15:24:37 UTC 2013
On Fri, Sep 27, 2013 at 09:19:12AM -0600, Eric Blake wrote:
> On 09/27/2013 08:51 AM, Michal Privoznik wrote:
> > Currently, we have functions to handle fc_host implemented just
> > for linux. On all other platforms an error is thrown. It makes no
> > sense to run the test on those platforms then.
> >
> > Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> > ---
> > tests/fchosttest.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/tests/fchosttest.c b/tests/fchosttest.c
> > index 05ff20b..46bd784 100644
> > --- a/tests/fchosttest.c
> > +++ b/tests/fchosttest.c
> > @@ -163,6 +163,11 @@ mymain(void)
> > {
> > int ret = 0;
> >
> > +#ifndef __linux__
> > + fputs("Not compiled under linux, skipping this test\n", stderr);
> > + return EXIT_AM_SKIP;
> > +#endif
>
> For other Linux-specific tests, we have stubbed out the entire file,
> rather than just a line in main() (for example, virsystemdtest.c). But
> this approach works too. ACK, worth having in 1.1.3.
The reason for stubbing the whole file is to avoid warnings about
unused variables. eg won't this code cause a warning about 'ret'
being unused, or report that the rest of 'mymain' is unreachable
code.
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the libvir-list
mailing list