qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 2/3] configure: Symlink entire test directories rath


From: Peter Maydell
Subject: [Qemu-devel] [PATCH 2/3] configure: Symlink entire test directories rather than individual files
Date: Tue, 30 Oct 2018 12:50:04 +0000

Instead of symlinking every individual file inside the data
directories used by some tests, just symlink the entire
directory. This avoids a problem where if a new data file
is added to the source tree, nothing results in configure
being rerun to create the symlink, and so test runs in the
build tree fail to find the file.

Add a comment noting why adding wildcards to FILES is
a bad idea. (Yes, we still do this for various files in pc-bios/;
we get away with this because we don't in practice add new
BIOS images often and if we do there's also usually a change
that means configure is rerun anyway. We can't just symlink
all of pc-bios into the build tree because it contains other
things than just generated binaries.)

Signed-off-by: Peter Maydell <address@hidden>
---
 configure | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index b7d0167b650..acb9a4d39e5 100755
--- a/configure
+++ b/configure
@@ -7370,6 +7370,12 @@ fi
 # DIRS are directories which we simply mkdir in the build tree;
 # LINKS are things to symlink back into the source tree
 # (these can be both files and directories).
+# Caution: do not add files or directories here using wildcards. This
+# will result in problems later if a new file matching the wildcard is
+# added to the source tree -- nothing will cause configure to be rerun
+# so the build tree will be missing the link back to the new file, and
+# tests might fail. Prefer to keep the relevant files in their own
+# directory and symlink the directory instead.
 DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos 
tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests tests/vm"
 DIRS="$DIRS tests/fp"
 DIRS="$DIRS docs docs/interop fsdev scsi"
@@ -7385,6 +7391,7 @@ LINKS="$LINKS pc-bios/s390-ccw/Makefile"
 LINKS="$LINKS roms/seabios/Makefile roms/vgabios/Makefile"
 LINKS="$LINKS pc-bios/qemu-icon.bmp"
 LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit
+LINKS="$LINKS tests/acpi-test-data tests/hex-loader-check-data"
 for bios_file in \
     $source_path/pc-bios/*.bin \
     $source_path/pc-bios/*.lid \
@@ -7398,14 +7405,6 @@ for bios_file in \
 do
     LINKS="$LINKS pc-bios/$(basename $bios_file)"
 done
-for test_file in $(find $source_path/tests/acpi-test-data -type f)
-do
-    LINKS="$LINKS tests/acpi-test-data$(echo $test_file | sed -e 
's/.*acpi-test-data//')"
-done
-for test_file in $(find $source_path/tests/hex-loader-check-data -type f)
-do
-    LINKS="$LINKS tests/hex-loader-check-data$(echo $test_file | sed -e 
's/.*hex-loader-check-data//')"
-done
 mkdir -p $DIRS
 for f in $LINKS ; do
     if [ -e "$source_path/$f" ] && [ "$pwd_is_source_path" != "y" ]; then
-- 
2.19.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]