#!/bin/sh
set -C -e -f -u

# Test a binary package instead of copying the source tree directly.
pkg=`sed -n '/^Package: \(libgnatcoll[0-9.]\+-dev\)$/{s//\1/;p;q}' debian/control`
cp -r /usr/share/doc/$pkg/examples "$ADTTMP"
cd "$ADTTMP/examples"

mkdir obj

gprbuild -v gmp/gmp_examples.gpr
gmp/isprime > result1 <<EOF
7
6

EOF
diff result1 - <<EOF
Enter candidate number (return to quit): 7 is a prime
Enter candidate number (return to quit): 6 is not a prime
Enter candidate number (return to quit): 
EOF

gprbuild -v examples.gpr
(./newclass; echo) > result2 <<EOF
print ('hello')
EOF
diff result2 - <<EOF
Please type python commands:
>>> hello
>>> 
EOF

gprbuild -v examplesgtk.gpr
