-t/guestfs_060_readdir: t/guestfs_060_readdir.ml mlguestfs.cmxa
- $(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . unix.cmxa mlguestfs.cmxa $< -o $@
+t/guestfs_500_inspect: t/guestfs_500_inspect.cmx mlguestfs.cmxa
+ mkdir -p t
+ $(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . -package xml-light,unix -linkpkg mlguestfs.cmxa $< -o $@
+
+# Need to rebuild the tests from source if the main library has
+# changed at all, otherwise we get inconsistent assumptions.
+t/%.cmx: t/%.ml mlguestfs.cmxa
+ $(OCAMLFIND) ocamlopt -package xml-light,unix -linkpkg -c $< -o $@