[Libguestfs] [PATCH v5 1/7] tests: Introduce test harness for running tests.
Richard W.M. Jones
rjones at redhat.com
Fri Oct 24 09:42:38 UTC 2014
On Tue, Oct 21, 2014 at 05:56:14PM +0200, Pino Toscano wrote:
> On Sunday 05 October 2014 14:08:35 Richard W.M. Jones wrote:
> > +# Install the test harness.
> > +localtestsdir = $(alltestsdir)
> > +localtests_SCRIPTS = ../test-harness
> Shouldn't it rather go to libexec?
No, it's meant to be run by the end user.
> > +../test-harness:
> > + rm -f $@ $@-t
> > + echo 'echo Warning: Install OCaml compiler in order to rebuild the test-harness.' > $@-t
> > + chmod +x $@-t
> > + mv $@-t $@
> > +
> > endif
> I guess this needs a configure check to disable the test suite when
> OCaml is not present.
Probably, although that would add quite a lot of complexity ...
> While I understand that the priority is the libvirt backend, I'd make
> the backend choice generic; something like:
> --backend NAME (direct, libvirt, uml, etc)
> --backend-option NAME=VAL (e.g. binary=/path/to/qemu for qemu, etc;
> can be specified multiple times)
I suspect that encoding all this as options is going to be tedious,
considering people can just set the associated environment variables
instead. Could drop the --direct option for the same reason.
> > + (* Run a single test. *)
> > + and run_one_test dir test args =
> > + let skip_env = try Sys.getenv (skip_name test) with Not_found -> "" in
> > + if skip_env = "1" then (
> > + printf "SKIP: %s\n%!" test;
> > + (1, 0, 0, 0, 1)
> > + )
> > + else (
> > + set_up_environment ();
> > +
> > + (* If it's a C program, and we're valgrinding, then we run the
> > + * C program under valgrind directly.
> > + *)
> > + let is_program =
> > + not (Filename.check_suffix test ".pl") &&
> > + not (Filename.check_suffix test ".sh") in
> I think this should be extended to .lua files as well.
Yeah, and more. I've not implemented the other bindings tests yet.
I'll fix the other stuff in the next patch.
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
More information about the Libguestfs