From 66ee810f13bbc296fdea0812231aece66bb0a59e Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 26 Dec 2019 18:38:53 +0100 Subject: Fix corpora test scripts for Windows cross build Signed-off-by: David Oberhollenzer --- tests/cantrbry.sh.in | 9 ++++++--- tests/test_tar_sqfs.sh.in | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/cantrbry.sh.in b/tests/cantrbry.sh.in index 04a6448..27d74a1 100755 --- a/tests/cantrbry.sh.in +++ b/tests/cantrbry.sh.in @@ -6,9 +6,12 @@ CORPUS="@abs_top_srcdir@/tests/corpus/cantrbry.tar.xz" SHA512FILE="@abs_top_srcdir@/tests/corpus/cantrbry.sha512" TAR2SQFS="@abs_top_builddir@/tar2sqfs" -COMPRESSORS=$(@abs_top_builddir@/tar2sqfs --help |\ - sed -ne '/^Available compressors:$/{:a' -e 'n;p;ba' -e '}' |\ - sed -n '/\t/p') +if [ ! -f "$TAR2SQFS" -a -f "${TAR2SQFS}.exe" ]; then + TAR2SQFS="${TAR2SQFS}.exe" +fi + +COMPRESSORS=$("$TAR2SQFS" --help | tr -d '\015' |\ + awk '/Available compressors:/,EOF' | sed -n '/\t/p') for size in 4096 8192 16384 32768 65536 131072 262144 524288 1048576; do for cmp in $COMPRESSORS; do diff --git a/tests/test_tar_sqfs.sh.in b/tests/test_tar_sqfs.sh.in index ea3b884..2c8e675 100755 --- a/tests/test_tar_sqfs.sh.in +++ b/tests/test_tar_sqfs.sh.in @@ -6,6 +6,10 @@ TARDIR="@abs_top_srcdir@/tests/tar" SHA512FILE="@abs_top_srcdir@/tests/tar/sqfs.sha512" TAR2SQFS="@abs_top_builddir@/tar2sqfs" +if [ ! -f "$TAR2SQFS" -a -f "${TAR2SQFS}.exe" ]; then + TAR2SQFS="${TAR2SQFS}.exe" +fi + for filename in $(find "$TARDIR" -name "*.tar" | grep -v ".*/file-size/.*"); do dir="$(dirname $filename | sed -n -e 's;.*/tests/;tests/;p')" imgname="$dir/$(basename $filename .tar).sqfs" -- cgit v1.2.3