File: testrandombytes-shared

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 (32 lines) | stat: -rwxr-xr-x 661 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
#!/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} -lrandombytes -lm -lrt"

# librandombytes - shared
echo 'librandombytes - shared:'
${CC} ${CFLAGS} -o randombytes-info "${dir}/../../command/randombytes-info.c" ${LDFLAGS}
./randombytes-info

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

exit 0