#!/bin/sh

# For 2.1.2~git20180830+dfsg1-1
GIT_COMMIT=dc765e3abe2452d4d85923993507cfc3458687ae

set -e

echo "Downloading the upstream git repository..."
trap 'exit 77' EXIT  # skip the test if we fail while downloading data
cd ${AUTOPKGTEST_TMP:-/tmp}
wget -nv https://github.com/ReFirmLabs/binwalk/archive/${GIT_COMMIT}.tar.gz -O code.tar.gz
tar xf code.tar.gz
cd binwalk-*
trap '' EXIT

echo "Running the upstream tests"
cd testing/tests
export HOME=""
nosetests3 --exe --verbosity=2
