summaryrefslogtreecommitdiff
path: root/Build/source/extra/xz/tests
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-04-03 23:53:28 +0000
committerKarl Berry <karl@freefriends.org>2011-04-03 23:53:28 +0000
commit1e665e264ead3dedcf83afc950c43a6764a79884 (patch)
treef2de017feac2b53a9fc3c15b31d9dba1541a7837 /Build/source/extra/xz/tests
parent7566b1e9fc57db87642f5e344164e5bbfe209b50 (diff)
xz 5.0.2, from http://tukaani.org/xz/xz-5.0.2.tar.xz
git-svn-id: svn://tug.org/texlive/trunk@21944 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/extra/xz/tests')
-rw-r--r--Build/source/extra/xz/tests/Makefile.am5
-rw-r--r--Build/source/extra/xz/tests/Makefile.in11
-rw-r--r--Build/source/extra/xz/tests/files/README4
-rw-r--r--Build/source/extra/xz/tests/files/good-1-lzma2-5.xzbin0 -> 52 bytes
-rwxr-xr-xBuild/source/extra/xz/tests/test_compress.sh53
-rwxr-xr-xBuild/source/extra/xz/tests/test_files.sh30
6 files changed, 69 insertions, 34 deletions
diff --git a/Build/source/extra/xz/tests/Makefile.am b/Build/source/extra/xz/tests/Makefile.am
index d01787a37ad..d0807ae4a15 100644
--- a/Build/source/extra/xz/tests/Makefile.am
+++ b/Build/source/extra/xz/tests/Makefile.am
@@ -17,10 +17,7 @@ EXTRA_DIST = \
AM_CPPFLAGS = \
-I$(top_srcdir)/src/common \
-I$(top_srcdir)/src/liblzma/api \
- -I$(top_builddir)/lib \
- $(STATIC_CPPFLAGS)
-
-AM_LDFLAGS = $(STATIC_LDFLAGS)
+ -I$(top_builddir)/lib
LDADD = $(top_builddir)/src/liblzma/liblzma.la
diff --git a/Build/source/extra/xz/tests/Makefile.in b/Build/source/extra/xz/tests/Makefile.in
index 15f4e09eb4c..d6db168d3db 100644
--- a/Build/source/extra/xz/tests/Makefile.in
+++ b/Build/source/extra/xz/tests/Makefile.in
@@ -54,6 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/tuklib_common.m4 \
$(top_srcdir)/m4/tuklib_cpucores.m4 \
$(top_srcdir)/m4/tuklib_integer.m4 \
+ $(top_srcdir)/m4/tuklib_mbstr.m4 \
$(top_srcdir)/m4/tuklib_physmem.m4 \
$(top_srcdir)/m4/tuklib_progname.m4 \
$(top_srcdir)/m4/visibility.m4 $(top_srcdir)/configure.ac
@@ -145,8 +146,6 @@ DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
-DYNAMIC_CPPFLAGS = @DYNAMIC_CPPFLAGS@
-DYNAMIC_LDFLAGS = @DYNAMIC_LDFLAGS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -179,6 +178,7 @@ LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
@@ -208,8 +208,6 @@ RC = @RC@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-STATIC_CPPFLAGS = @STATIC_CPPFLAGS@
-STATIC_LDFLAGS = @STATIC_LDFLAGS@
STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
@@ -219,6 +217,7 @@ abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
@@ -280,10 +279,8 @@ EXTRA_DIST = \
AM_CPPFLAGS = \
-I$(top_srcdir)/src/common \
-I$(top_srcdir)/src/liblzma/api \
- -I$(top_builddir)/lib \
- $(STATIC_CPPFLAGS)
+ -I$(top_builddir)/lib
-AM_LDFLAGS = $(STATIC_LDFLAGS)
LDADD = $(top_builddir)/src/liblzma/liblzma.la $(am__append_1) \
$(LTLIBINTL)
all: all-am
diff --git a/Build/source/extra/xz/tests/files/README b/Build/source/extra/xz/tests/files/README
index 392ff768a90..2f74cef2fa0 100644
--- a/Build/source/extra/xz/tests/files/README
+++ b/Build/source/extra/xz/tests/files/README
@@ -87,6 +87,10 @@
uncompressed with dictionary reset, and third is LZMA with new
properties but without dictionary reset.
+ good-1-lzma2-5.xz has an empty LZMA2 stream with only the end of
+ payload marker. XZ Utils 5.0.1 and older incorrectly see this file
+ as corrupt.
+
good-1-3delta-lzma2.xz has three Delta filters and LZMA2.
diff --git a/Build/source/extra/xz/tests/files/good-1-lzma2-5.xz b/Build/source/extra/xz/tests/files/good-1-lzma2-5.xz
new file mode 100644
index 00000000000..339d1c30c17
--- /dev/null
+++ b/Build/source/extra/xz/tests/files/good-1-lzma2-5.xz
Binary files differ
diff --git a/Build/source/extra/xz/tests/test_compress.sh b/Build/source/extra/xz/tests/test_compress.sh
index ff0cb304df4..62da0f921ad 100755
--- a/Build/source/extra/xz/tests/test_compress.sh
+++ b/Build/source/extra/xz/tests/test_compress.sh
@@ -9,6 +9,14 @@
#
###############################################################################
+# If xz wasn't built, this test is skipped.
+if test -x ../src/xz/xz ; then
+ :
+else
+ (exit 77)
+ exit 77
+fi
+
# Find out if our shell supports functions.
eval 'unset foo ; foo() { return 42; } ; foo'
if test $? != 42 ; then
@@ -29,7 +37,7 @@ test_xz() {
if $XZ -cd tmp_compressed > tmp_uncompressed ; then
:
else
- echo "Decoding failed: $* $FILE"
+ echo "Decompressing failed: $* $FILE"
(exit 1)
exit 1
fi
@@ -37,34 +45,39 @@ test_xz() {
if cmp tmp_uncompressed "$FILE" ; then
:
else
- echo "Decoded file does not match the original: $* $FILE"
+ echo "Decompressed file does not match" \
+ "the original: $* $FILE"
(exit 1)
exit 1
fi
- if $XZDEC tmp_compressed > tmp_uncompressed ; then
- :
- else
- echo "Decoding failed: $* $FILE"
- (exit 1)
- exit 1
- fi
-
- if cmp tmp_uncompressed "$FILE" ; then
- :
- else
- echo "Decoded file does not match the original: $* $FILE"
- (exit 1)
- exit 1
+ if test -n "$XZDEC" ; then
+ if $XZDEC tmp_compressed > tmp_uncompressed ; then
+ :
+ else
+ echo "Decompressing failed: $* $FILE"
+ (exit 1)
+ exit 1
+ fi
+
+ if cmp tmp_uncompressed "$FILE" ; then
+ :
+ else
+ echo "Decompressed file does not match" \
+ "the original: $* $FILE"
+ (exit 1)
+ exit 1
+ fi
fi
# Show progress:
echo . | tr -d '\n\r'
}
-XZ="../src/xz/xz --memory=28MiB --threads=1"
-XZDEC="../src/xzdec/xzdec --memory=4MiB"
-unset XZ_OPT
+XZ="../src/xz/xz --memlimit-compress=48MiB --memlimit-decompress=5MiB \
+ --no-adjust --threads=1 --check=crc64"
+XZDEC="../src/xzdec/xzdec" # No memory usage limiter available
+test -x ../src/xzdec/xzdec || XZDEC=
# Create the required input files.
if ./create_compress_files ; then
@@ -80,7 +93,7 @@ fi
rm -f tmp_compressed tmp_uncompressed
trap 'rm -f tmp_compressed tmp_uncompressed' 0
-# Encode and decode each file with various filter configurations.
+# Compress and decompress each file with various filter configurations.
# This takes quite a bit of time.
echo "test_compress.sh:"
for FILE in compress_generated_* "$srcdir"/compress_prepared_*
diff --git a/Build/source/extra/xz/tests/test_files.sh b/Build/source/extra/xz/tests/test_files.sh
index 7dd9a3901bf..2fa83825e5f 100755
--- a/Build/source/extra/xz/tests/test_files.sh
+++ b/Build/source/extra/xz/tests/test_files.sh
@@ -1,4 +1,4 @@
-#/bin/sh
+#!/bin/sh
###############################################################################
#
@@ -9,9 +9,27 @@
#
###############################################################################
+# If both xz and xzdec were not build, skip this test.
+XZ=../src/xz/xz
+XZDEC=../src/xzdec/xzdec
+test -x "$XZ" || XZ=
+test -x "$XZDEC" || XZDEC=
+if test -z "$XZ$XZDEC"; then
+ (exit 77)
+ exit 77
+fi
+
for I in "$srcdir"/files/good-*.xz
do
- if ../src/xzdec/xzdec "$I" > /dev/null 2> /dev/null ; then
+ if test -z "$XZ" || "$XZ" -dc "$I" > /dev/null 2>&1; then
+ :
+ else
+ echo "Good file failed: $I"
+ (exit 1)
+ exit 1
+ fi
+
+ if test -z "$XZDEC" || "$XZDEC" "$I" > /dev/null 2>&1; then
:
else
echo "Good file failed: $I"
@@ -22,7 +40,13 @@ done
for I in "$srcdir"/files/bad-*.xz
do
- if ../src/xzdec/xzdec "$I" > /dev/null 2> /dev/null ; then
+ if test -n "$XZ" && "$XZ" -dc "$I" > /dev/null 2>&1; then
+ echo "Bad file succeeded: $I"
+ (exit 1)
+ exit 1
+ fi
+
+ if test -n "$XZDEC" && "$XZDEC" "$I" > /dev/null 2>&1; then
echo "Bad file succeeded: $I"
(exit 1)
exit 1