#!/bin/sh
#
# Test the VLC bittorrent module.

set -e

retval=0
cd $ADTTMP

if type valgrind ; then
    VALGRIND=valgrind
else
    VALGRIND=
fi

if $VALGRIND vlc --list > vlc-output.log 2>&1 ; then
    echo "success: vlc executed successfully"
else
    echo "error: vlc failed to execute"
    retval=1
fi

cat vlc-output.log

if grep -q bittorrent vlc-output.log; then
    echo "success: vlc found bittorrent module"
else
    echo "error: vlc did not find bittorrent module"
    retval=1
fi

# Should figure out a way to test playing a torrent stream, for example using
src=https://archive.org/download/CopyingIsNotTheft1080p/CopyingIsNotTheft1080p_archive.torrent

exit $retval
