aboutsummaryrefslogtreecommitdiffstats
path: root/pkg-test/test-cli
blob: f69e546a6884c5f0598cc2f64e8f1358210874f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
#
# Test that the installed qpdf CLI works. Requires the CLI and runtime
# libraries.
#
set -ex

TMP=$1
if [ ! -d "$TMP" ]; then
    echo 1>&2 "Usage: $0 tmp-dir"
    exit 2
fi

WANTED_VERSION=$(awk -F'"' '/#define QPDF_VERSION / {print $2}' include/qpdf/DLL.h)

qpdf --version | grep -F $WANTED_VERSION
qpdf --help
qpdf --check qpdf/qtest/qpdf/minimal.pdf
qpdf qpdf/qtest/qpdf/minimal.pdf --encrypt u o 256 -- $TMP/out.pdf
qpdf --check --password=u $TMP/out.pdf