| 1 |
#!/bin/sh |
| 2 |
DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 3 |
|
| 4 |
echo "running test $0 for ${DEB_HOST_MULTIARCH}" |
| 5 |
|
| 6 |
build_make_sine() { |
| 7 |
if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then |
| 8 |
CROSS_COMPILE="$DEB_HOST_GNU_TYPE-" |
| 9 |
else |
| 10 |
CROSS_COMPILE= |
| 11 |
fi |
| 12 |
|
| 13 |
# Deliberately word-splitting pkgconf's output: |
| 14 |
# shellcheck disable=SC2046 |
| 15 |
"${CROSS_COMPILE}gcc" -oexamples/make_sine examples/make_sine.c -lm $("${CROSS_COMPILE}pkgconf" --cflags --libs sndfile) |
| 16 |
} |
| 17 |
|
| 18 |
cp -v /usr/lib/${DEB_HOST_MULTIARCH}/sndfile/tests/* tests/ |
| 19 |
mv -v tests/test_main src/ |
| 20 |
|
| 21 |
#sed -e 's|^PYTHON=.*|PYTHON=skiptest\nskiptest() { echo "skipping $@"\n}|' -i tests/test_wrapper.sh |
| 22 |
|
| 23 |
# fix paths in metadata test |
| 24 |
sed -i \ |
| 25 |
-e 's|\./\(sndfile-metadata-.et\)|/usr/bin/\1|' \ |
| 26 |
programs/test-sndfile-metadata-set.py |
| 27 |
|
| 28 |
|
| 29 |
# prepare the make_sine executable for tests |
| 30 |
build_make_sine |
| 31 |
|
| 32 |
# now run the tests |
| 33 |
chmod +x tests/test_wrapper.sh |
| 34 |
tests/test_wrapper.sh 2>&1 |