2 # SPDX-License-Identifier: 0BSD
4 ###############################################################################
6 # Script to check output of some translated messages
8 # This should be useful for translators to check that the translated strings
9 # look good. This doesn't make xz print all possible strings, but it should
10 # cover most of the cases where mistakes can easily happen.
12 # Give the path and filename of the xz executable as an argument. If no
13 # arguments are given, this script uses ../src/xz/xz (relative to the
14 # location of this script).
16 # You may want to pipe the output of this script to less -S to view the
17 # tables printed by xz --list on a 80-column terminal. On the other hand,
18 # viewing the other messages may be better without -S.
20 ###############################################################################
22 # Author: Lasse Collin
24 ###############################################################################
28 # If an argument was given, use it to set the location of the xz executable.
32 [ "x${XZ:0:1}" != "x/" ] && XZ
="$PWD/$XZ"
35 # Locate top_srcdir and go there.
36 top_srcdir
="$(cd -- "$
(dirname -- "$0")" && cd .. && pwd)"
39 # If XZ wasn't already set, use the default location.
40 XZ
=${XZ-"$PWD/src/xz/xz"}
41 if [ "$(type -t "$XZ" || true)" != "file" ]; then
42 echo "Give the location of the xz executable as an argument" \
46 XZ
=$
(type -p -- "$XZ")
48 # Print the xz version and locale information.
52 if [ -d .git
] && type git
> /dev
/null
2>&1; then
53 echo "Source code version in $PWD:"
54 git describe
--abbrev=4
60 # Make the test files directory the current directory.
63 # Put xz in PATH so that argv[0] stays short.
66 # Some of the test commands are error messages and thus don't
67 # return successfully.
72 "xz --memlimit=123abcd" \
73 "xz --memlimit=40MiB -6 /dev/null" \
74 "xz --memlimit=0 --info-memory" \
75 "xz --memlimit-compress=1234MiB --memlimit-decompress=50MiB --info-memory" \
76 "xz --verbose --verbose /dev/null | cat" \
77 "xz --lzma2=foobarbaz" \
78 "xz --lzma2=foobarbaz=abcd" \
79 "xz --lzma2=mf=abcd" \
80 "xz --lzma2=preset=foobarbaz" \
81 "xz --lzma2=nice=50000" \
84 "xz --list good-*lzma2*" \
85 "xz --list good-1-check*" \
86 "xz --list --verbose good-*lzma2*" \
87 "xz --list --verbose good-1-check*" \
88 "xz --list --verbose --verbose good-*lzma2*" \
89 "xz --list --verbose --verbose good-1-check*" \
90 "xz --list --verbose --verbose unsupported-check.xz"
92 echo "-----------------------------------------------------------"