File: build

package info (click to toggle)
libunibreak 6.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 2,592 kB
  • sloc: ansic: 14,084; python: 242; makefile: 136; sh: 43; sed: 2
file content (37 lines) | stat: -rwxr-xr-x 944 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# Copyright 2022 Simon McVittie
# SDPX-License-Identifier: Zlib

set -eux

srcdir=$(pwd)
workdir=$(mktemp -d)
trap 'rm -rf "$workdir"' 0 INT QUIT ABRT PIPE TERM

if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
    CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
else
    CROSS_COMPILE=
fi

cp tools/linebreak_test.c "$workdir"
cp tools/wordbreak_test.c "$workdir"
cd "$workdir"

for t in linebreak_test wordbreak_test; do
    CC="${CROSS_COMPILE}gcc"
    PKG_CONFIG="${CROSS_COMPILE}pkg-config"

    "$CC" -o "$t" "${t}.c" $("${PKG_CONFIG}" --cflags --libs libunibreak)
done

fail=0

./wordbreak_test "The quick brown fox jumped over the lazy dog" > wordbreaks.txt || fail=1
diff -u "${srcdir}/debian/tests/wordbreaks.txt" wordbreaks.txt || fail=1

echo "Jackdaws love my big sphinx of quartz" > input.txt
./linebreak_test -l en input.txt > linebreaks.txt || fail=1
diff -u "${srcdir}/debian/tests/linebreaks.txt" linebreaks.txt || fail=1

exit "$fail"