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
|
#!/bin/sh
# autopkgtest check: Builds a small application against libfluidsynth, checking
# if it compiles, links and runs successfully.
# Author: Rafał Cieślak <rafalcieslak256@ubuntu.com>
set -e
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
else
CROSS_COMPILE=
fi
cat <<EOF > build_test.c
#include <fluidsynth.h>
int main(int argc, char** argv) {
fluid_settings_t* settings;
fluid_synth_t* synth;
settings = new_fluid_settings();
//Using default settings.
synth = new_fluid_synth(settings);
if(!synth || !settings)
//a null pointer?
return 1;
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
EOF
${CROSS_COMPILE}gcc -o build_test build_test.c -lfluidsynth
echo "build: OK"
[ -x build_test ]
./build_test
echo "run: OK"
|