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
# Consolidates common code of the autopkgtests
# Requires that AUTOPKGTEST_TMP and PYINTERPRETER are set
set -e
# Presence of $AUTOPKGTEST_TMP implies that someone will handle cleanup for us
if [ -z "$AUTOPKGTEST_TMP" ]
then
echo "Required envvar AUTOPKGTEST is not set" >&2
exit 1
fi
if [ -z "$PYINTERPRETER" ]
then
echo "Python interpreter PYINTERPRETER is not set" >&2
exit 1
fi
# Copy the simple example and the training data to $AUTOPKGTEST, and execute it
mkdir -p "$AUTOPKGTEST_TMP/$PYINTERPRETER"
cp examples/simple_train.py "$AUTOPKGTEST_TMP/$PYINTERPRETER"
cp examples/xor.data "$AUTOPKGTEST_TMP/$PYINTERPRETER"
cd "$AUTOPKGTEST_TMP/$PYINTERPRETER"
if [ "$1" = "pyfann" ]
then
sed -i -r -e 's/from fann2/from pyfann/' simple_train.py
fi
$PYINTERPRETER simple_train.py
echo "run: OK"
|