tests: Move tests/hex-loader-check-data/ to tests/data/hex-loader/
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 2 Nov 2018 11:52:37 +0000 (11:52 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 5 Nov 2018 18:23:46 +0000 (13:23 -0500)
Currently tests/hex-loader-check-data contains data files used
by the hexloader-test, and configure individually symlinks those
data files into the build directory using a wildcard.

Using a wildcard like this is a bad idea, because if a new
data file is added, nothing causes configure to be rerun,
and so no symlink is added for the new file. This can cause
tests to spuriously fail when they can't find their data.
Instead, it's better to symlink an entire directory of
data files. We already have such a directory: tests/data.

Move the data files from tests/hex-loader-check-data/ to
tests/data/hex-loader/, and remove the unnecessary symlinking.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
MAINTAINERS
configure
tests/data/hex-loader/test.hex [new file with mode: 0644]
tests/hex-loader-check-data/test.hex [deleted file]
tests/hexloader-test.c

index 98a1856afc02d8e6182b653e11aaeb13ced43705..cfabc14b593bde4398cf97e2f28c8992acfeaaee 100644 (file)
@@ -1370,7 +1370,7 @@ Intel Hexadecimal Object File Loader
 M: Su Hang <suhang16@mails.ucas.ac.cn>
 S: Maintained
 F: tests/hexloader-test.c
-F: tests/hex-loader-check-data/test.hex
+F: tests/data/hex-loader/test.hex
 
 CHRP NVRAM
 M: Thomas Huth <thuth@redhat.com>
index 895b7483b8a54a23227f76dccf0af19bf978ec27..bfdca8b814e5fa13192fed5a508fba1440e6a6d2 100755 (executable)
--- a/configure
+++ b/configure
@@ -7421,10 +7421,6 @@ for bios_file in \
 do
     FILES="$FILES pc-bios/$(basename $bios_file)"
 done
-for test_file in $(find $source_path/tests/hex-loader-check-data -type f)
-do
-    FILES="$FILES tests/hex-loader-check-data$(echo $test_file | sed -e 's/.*hex-loader-check-data//')"
-done
 mkdir -p $DIRS
 for f in $FILES ; do
     if [ -e "$source_path/$f" ] && [ "$pwd_is_source_path" != "y" ]; then
diff --git a/tests/data/hex-loader/test.hex b/tests/data/hex-loader/test.hex
new file mode 100644 (file)
index 0000000..008a90b
--- /dev/null
@@ -0,0 +1,18 @@
+:020000040001F9
+:10000000000102030405060708090a0b0c0d0e0f78
+:10001000101112131415161718191a1b1c1d1e1f68
+:10002000202122232425262728292a2b2c2d2e2f58
+:10003000303132333435363738393a3b3c3d3e3f48
+:10004000404142434445464748494a4b4c4d4e4f38
+:10005000505152535455565758595a5b5c5d5e5f28
+:10006000606162636465666768696a6b6c6d6e6f18
+:10007000707172737475767778797a7b7c7d7e7f08
+:10008000808182838485868788898a8b8c8d8e8ff8
+:10009000909192939495969798999a9b9c9d9e9fe8
+:1000a000a0a1a2a3a4a5a6a7a8a9aaabacadaeafd8
+:1000b000b0b1b2b3b4b5b6b7b8b9babbbcbdbebfc8
+:1000c000c0c1c2c3c4c5c6c7c8c9cacbcccdcecfb8
+:1000d000d0d1d2d3d4d5d6d7d8d9dadbdcdddedfa8
+:1000e000e0e1e2e3e4e5e6e7e8e9eaebecedeeef98
+:1000f000f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff88
+:00000001FF
diff --git a/tests/hex-loader-check-data/test.hex b/tests/hex-loader-check-data/test.hex
deleted file mode 100644 (file)
index 008a90b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-:020000040001F9
-:10000000000102030405060708090a0b0c0d0e0f78
-:10001000101112131415161718191a1b1c1d1e1f68
-:10002000202122232425262728292a2b2c2d2e2f58
-:10003000303132333435363738393a3b3c3d3e3f48
-:10004000404142434445464748494a4b4c4d4e4f38
-:10005000505152535455565758595a5b5c5d5e5f28
-:10006000606162636465666768696a6b6c6d6e6f18
-:10007000707172737475767778797a7b7c7d7e7f08
-:10008000808182838485868788898a8b8c8d8e8ff8
-:10009000909192939495969798999a9b9c9d9e9fe8
-:1000a000a0a1a2a3a4a5a6a7a8a9aaabacadaeafd8
-:1000b000b0b1b2b3b4b5b6b7b8b9babbbcbdbebfc8
-:1000c000c0c1c2c3c4c5c6c7c8c9cacbcccdcecfb8
-:1000d000d0d1d2d3d4d5d6d7d8d9dadbdcdddedfa8
-:1000e000e0e1e2e3e4e5e6e7e8e9eaebecedeeef98
-:1000f000f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff88
-:00000001FF
index b653d44ba10b75e5289787237e510050ad95cdf7..834ed52c22ba2cd98e5733f0dbcb00373a14482e 100644 (file)
@@ -23,7 +23,7 @@ static void hex_loader_test(void)
     const unsigned int base_addr = 0x00010000;
 
     QTestState *s = qtest_initf(
-        "-M vexpress-a9 -nographic -device loader,file=tests/hex-loader-check-data/test.hex");
+        "-M vexpress-a9 -nographic -device loader,file=tests/data/hex-loader/test.hex");
 
     for (i = 0; i < 256; ++i) {
         uint8_t val = qtest_readb(s, base_addr + i);