[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libosinfo] [libosinfo PATCH] tests: convert from check to the GLib testing framework



On Thu, Oct 19, 2017 at 03:59:02PM +0200, Pino Toscano wrote:
> On Thursday, 19 October 2017 15:36:28 CEST Daniel P. Berrange wrote:
> > On Thu, Oct 19, 2017 at 03:14:24PM +0200, Pino Toscano wrote:
> > > diff --git a/tests/test-isodetect.c b/tests/test-isodetect.c
> > > index 7214531..97c86c4 100644
> > > --- a/tests/test-isodetect.c
> > > +++ b/tests/test-isodetect.c
> > 
> > > -int main(void)
> > > -{
> > > -    int number_failed;
> > > -    Suite *s = list_suite();
> > > -    SRunner *sr = srunner_create(s);
> > > +    g_test_init(&argc, &argv, NULL);
> > > +
> > > +    g_test_add_func("/isodetect/fedora", test_fedora);
> > > +    g_test_add_func("/isodetect/rhel", test_rhel);
> > > +    g_test_add_func("/isodetect/ubuntu", test_ubuntu);
> > > +    g_test_add_func("/isodetect/debian", test_debian);
> > > +    g_test_add_func("/isodetect/windows", test_windows);
> > > +    g_test_add_func("/isodetect/freebsd", test_freebsd);
> > > +    g_test_add_func("/isodetect/openbsd", test_openbsd);
> > > +    g_test_add_func("/isodetect/opensuse", test_opensuse);
> > > +    g_test_add_func("/isodetect/centos", test_centos);
> > > +    g_test_add_func("/isodetect/gnome", test_gnome);
> > > +    g_test_add_func("/isodetect/altlinux", test_altlinux);
> > > +    g_test_add_func("/isodetect/mageia", test_mageia);
> > > +    g_test_add_func("/isodetect/sles", test_sles);
> > > +    g_test_add_func("/isodetect/sled", test_sled);
> > 
> > We could wrap all of this in a
> > 
> >    if (g_test_slow()) {
> >      ....
> >    }
> > 
> > so that this only executes if people request slow tests via '-m slow' arg
> 
> Hm aren't these tests worth executing by default?  Not sure what is the
> proper definition of "slow" for GLib tests though, and test-isodetect
> takes less than 20 seconds to run here.

They're primarily useful for upstream to run - I don't think there's much
benefit downstream users running them. So I think its the kind of thing
where we could put '-m slow' into our CI system tests.

THis would avoid downstream users needing networking during tests too IIUC.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]