From 877c69bef779c40cb1e4412cad5c2ffe0ce36ff9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 30 Oct 2015 21:42:54 +0000 Subject: [PATCH] build: Reorder build sequence. When I conceived commit dc1d0880b02525d26d12d2356e627419bdcffbaa, I thought it would be a good idea to build test-data files, including the phony guest images, during the 'make' phase. Previously these were built early in the 'make check' phase. However this has two disadvantages: (a) We run the appliance unnecessarily during builds. For example, it is not necessary to build the phony guests if we are going to do an 'installcheck'. (b) Even if we are testing, the critical first time we run the appliance is not in 'quickcheck' or 'tests/qemu', but some random guest build. Reorder the build sequence to fix this, and also a few other things. This updates commit dc1d0880b02525d26d12d2356e627419bdcffbaa. --- Makefile.am | 21 +++++++++++++++------ test-data/blank-disks/Makefile.am | 6 +++--- test-data/phony-guests/Makefile.am | 6 ++++-- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/Makefile.am b/Makefile.am index 089dfcb70..a88b27a16 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,15 +19,28 @@ include $(top_srcdir)/common-rules.mk ACLOCAL_AMFLAGS = -I m4 +# The generator - must be before anything else. +SUBDIRS = generator + +# Must be the first tests that run. +if ENABLE_APPLIANCE +SUBDIRS += tests/qemu +endif + +# Files and other test data used by the tests. Must be before any +# tests run, except tests/qemu. +SUBDIRS += test-data + # Gnulib - must be built and tested before the library. -SUBDIRS = gnulib/lib +SUBDIRS += gnulib/lib if ENABLE_GNULIB_TESTS SUBDIRS += gnulib/tests endif # Basic source for the library. -SUBDIRS += generator src docs examples po +SUBDIRS += src docs examples po +# The daemon and the appliance. if ENABLE_DAEMON SUBDIRS += daemon SUBDIRS += tests/daemon @@ -38,7 +51,6 @@ endif # Tests - order is important. if ENABLE_APPLIANCE -SUBDIRS += tests/qemu SUBDIRS += tests/c-api SUBDIRS += tests/tmpdirs SUBDIRS += tests/protocol @@ -149,9 +161,6 @@ if HAVE_TOOLS SUBDIRS += tools endif -# Files and other test data used by the tests (must come after fish, perl). -SUBDIRS += test-data - # guestmount if HAVE_FUSE SUBDIRS += fuse diff --git a/test-data/blank-disks/Makefile.am b/test-data/blank-disks/Makefile.am index 365285a57..6613c4813 100644 --- a/test-data/blank-disks/Makefile.am +++ b/test-data/blank-disks/Makefile.am @@ -33,21 +33,21 @@ CLEANFILES = $(files) # Blank disk images in various sizes and formats. blank-disk-1s.raw: rm -f $@ - $(top_builddir)/run guestfish sparse $@ 512 + truncate -s 512 $@ blank-disk-1s.qcow2: qemu-img create -f qcow2 -o preallocation=metadata $@ 512 blank-disk-1K.raw: rm -f $@ - $(top_builddir)/run guestfish sparse $@ 1K + truncate -s 1K $@ blank-disk-1K.qcow2: qemu-img create -f qcow2 -o preallocation=metadata $@ 1K blank-disk-1M.raw: rm -f $@ - $(top_builddir)/run guestfish sparse $@ 1M + truncate -s 1M $@ blank-disk-1M.qcow2: qemu-img create -f qcow2 -o preallocation=metadata $@ 1M diff --git a/test-data/phony-guests/Makefile.am b/test-data/phony-guests/Makefile.am index 08b14e50b..98922c7e5 100644 --- a/test-data/phony-guests/Makefile.am +++ b/test-data/phony-guests/Makefile.am @@ -56,10 +56,12 @@ disk_images = \ coreos.img \ windows.img -noinst_DATA = $(disk_images) guests-all-good.xml +# This is 'check_DATA' because we don't need it until 'make check' +# time and we need the tools we have built in order to make it. +check_DATA = $(disk_images) guests-all-good.xml CLEANFILES = \ - $(noinst_DATA) \ + $(check_DATA) \ guests-all-good.xml \ stamp-fedora-md.img \ *.tmp.*