[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[committed] Allow binaries in testsuite sources
Hi,
Add a script xunzip-dir.sh that is called from dwz-tests.exp to unzip the
zipped execs in testsuite directory testsuite/dwz.tests/execs.xz into build
dir $pwd/testsuite/dwz.tests/execs.
Committed to trunk.
Thanks,
- Tom
Allow binaries in testsuite sources
2019-04-23 Tom de Vries <tdevries@suse.de>
* testsuite/scripts/xunzip-dir.sh: New test.
* testsuite/dwz.tests/dwz-tests.exp: Call xunzip-dir.sh.
---
testsuite/dwz.tests/dwz-tests.exp | 5 +++++
testsuite/scripts/xunzip-dir.sh | 20 ++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/testsuite/dwz.tests/dwz-tests.exp b/testsuite/dwz.tests/dwz-tests.exp
index a20002f..1e6bd0f 100644
--- a/testsuite/dwz.tests/dwz-tests.exp
+++ b/testsuite/dwz.tests/dwz-tests.exp
@@ -5,6 +5,11 @@ set pwd [pwd]
set env(PATH) $srcdir/scripts:$::env(PATH)
set env(execs) $pwd
+exec mkdir -p $pwd/testsuite/dwz.tests/execs
+exec $srcdir/scripts/xunzip-dir.sh \
+ $srcdir/dwz.tests/execs.xz \
+ $pwd/testsuite/dwz.tests/execs
+
foreach test $tests {
global runtests
diff --git a/testsuite/scripts/xunzip-dir.sh b/testsuite/scripts/xunzip-dir.sh
new file mode 100755
index 0000000..624d525
--- /dev/null
+++ b/testsuite/scripts/xunzip-dir.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+src="$1"
+dst="$2"
+
+if [ ! -d $src ]; then
+ exit 0
+fi
+
+files=$(cd $src; find -name "*.xz")
+
+for f in $files; do
+ df=$(echo $f \
+ | sed 's/\.xz$//')
+ if [ -f $dst/$df ]; then
+ continue
+ fi
+ cp $src/$f $dst/$f
+ xz -d $dst/$f
+done