File: testrandombytes-static

package info (click to toggle)
librandombytes 0~20240318-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 328 kB
  • sloc: ansic: 411; python: 340; sh: 137; makefile: 23
file content (42 lines) | stat: -rwxr-xr-x 1,119 bytes parent folder | download | duplicates (2)
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
38
39
40
41
42
#!/bin/sh

set -e

dir=`dirname "$0"`

cd "${AUTOPKGTEST_TMP}"

cleanup() {
  ex=$?
  rm -f randombytes-info
  exit "${ex}"
}
trap "cleanup" EXIT TERM INT

CC=cc
CFLAGS=`dpkg-buildflags --get CFLAGS`
CFLAGS="${CFLAGS} `dpkg-buildflags --get CPPFLAGS`"
LDFLAGS=`dpkg-buildflags --get LDFLAGS`
LDFLAGS="${LDFLAGS} -lm -lrt"

# librandombytes - static
echo 'librandombytes - static:'
${CC} ${CFLAGS} -o randombytes-info "${dir}/../../command/randombytes-info.c" ${LDFLAGS} /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/librandombytes.a
./randombytes-info

if ! ./randombytes-info | grep '^randombytes source kernel-' >/dev/null; then
    echo "FAIL: unexpected randombytes-info output" >&2;
    exit 1
fi

# librandombytes-kernel - static
echo 'librandombytes-kernel - static:'
${CC} ${CFLAGS} -o randombytes-info "${dir}/../../command/randombytes-info.c" ${LDFLAGS} /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/librandombytes-kernel.a
./randombytes-info

if ! ./randombytes-info | grep '^randombytes source kernel-' >/dev/null; then
    echo "FAIL: unexpected randombytes-info output" >&2;
    exit 1
fi

exit 0