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 43 44 45 46 47 48
|
#!/bin/sh
# autopkgtest check: build and run a program against sumalibs. We check that
# it builds and that it behaves well on a very simple reading exercise.
# (C) 2020 Pierre Gruet.
# Author: Pierre Gruet <pgt@debian.org>
set -e
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > test.fasta
>SEQ1
ACGATCGCACGCATCGTCAG
>SEQ2
ACGTAGCTAGCA
EOF
cat <<EOF > main.c
#include <stdio.h>
#include <libfasta/sequence.h>
int main()
{
fastaSeqCount n;
n=seq_readAllSeq2("test.fasta", 1, 1);
printf("%d sequences are read\n", n.count);
return 0;
}
EOF
gcc -c -o main.o main.c
gcc -o testPrg main.o -lsuma
echo "Build done"
if [ -x testPrg ]; then
./testPrg |
sed -n 's/.sequences.*//p' |
grep "2"
if [ $? -ne 0 ]; then
exit 1
fi
fi
|