3 ###############################################################################
5 # Script to check output of some translated messages
7 # This should be useful for translators to check that the translated strings
8 # look good. This doesn't make xz print all possible strings, but it should
9 # cover most of the cases where mistakes can easily happen.
11 # Give the path and filename of the xz executable as an argument. If no
12 # arguments are given, this script uses ../src/xz/xz (relative to the
13 # location of this script).
15 # You may want to pipe the output of this script to less -S to view the
16 # tables printed by xz --list on a 80-column terminal. On the other hand,
17 # viewing the other messages may be better without -S.
19 ###############################################################################
21 # Author: Lasse Collin
23 # This file has been put into the public domain.
24 # You can do whatever you want with this file.
26 ###############################################################################
30 # If an argument was given, use it to set the location of the xz executable.
34 [ "x${XZ:0:1}" != "x/" ] && XZ
="$PWD/$XZ"
37 # Locate top_srcdir and go there.
38 top_srcdir
="$(cd -- "$
(dirname -- "$0")" && cd .. && pwd)"
41 # If XZ wasn't already set, use the default location.
42 XZ
=${XZ-"$PWD/src/xz/xz"}
43 if [ "$(type -t "$XZ" || true)" != "file" ]; then
44 echo "Give the location of the xz executable as an argument" \
48 XZ
=$
(type -p -- "$XZ")
50 # Print the xz version and locale information.
54 if [ -d .git
] && type git
> /dev
/null
2>&1; then
55 echo "Source code version in $PWD:"
56 git describe
--abbrev=4
62 # Make the test files directory the current directory.
65 # Put xz in PATH so that argv[0] stays short.
68 # Some of the test commands are error messages and thus don't
69 # return successfully.
74 "xz --memlimit=123abcd" \
75 "xz --memlimit=40MiB -6 /dev/null" \
76 "xz --memlimit=0 --info-memory" \
77 "xz --memlimit-compress=1234MiB --memlimit-decompress=50MiB --info-memory" \
78 "xz --verbose --verbose /dev/null | cat" \
79 "xz --lzma2=foobarbaz" \
80 "xz --lzma2=foobarbaz=abcd" \
81 "xz --lzma2=mf=abcd" \
82 "xz --lzma2=preset=foobarbaz" \
83 "xz --lzma2=mf=bt4,nice=2" \
84 "xz --lzma2=nice=50000" \
87 "xz --list good-*lzma2*" \
88 "xz --list good-1-check*" \
89 "xz --list --verbose good-*lzma2*" \
90 "xz --list --verbose good-1-check*" \
91 "xz --list --verbose --verbose good-*lzma2*" \
92 "xz --list --verbose --verbose good-1-check*" \
93 "xz --list --verbose --verbose unsupported-check.xz"
95 echo "-----------------------------------------------------------"