From 8fe65e68b4cb794cf0f158ca8dbf3cf61f7b0bf5 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Mon, 25 Jan 2016 10:27:39 -0500 Subject: [PATCH] tests: Check for ffmpeg and vorbiscomment before generating music We can't run most of our tests without the generated tracks. Signed-off-by: Anna Schumaker --- tests/Music/Sconscript | 5 ++++- tests/Music/gen_tracks.sh | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/Music/Sconscript b/tests/Music/Sconscript index a82bd8e7..3e88d455 100644 --- a/tests/Music/Sconscript +++ b/tests/Music/Sconscript @@ -1,7 +1,10 @@ #!/usr/bin/python import subprocess +import sys albums = [ "Hyrule_Symphony.album" ] for album in albums: - subprocess.call(["sh", "gen_tracks.sh", album]) + ret = subprocess.call(["sh", "gen_tracks.sh", album]) + if ret != 0: + sys.exit(ret) diff --git a/tests/Music/gen_tracks.sh b/tests/Music/gen_tracks.sh index d2b36ea2..6adf8db8 100644 --- a/tests/Music/gen_tracks.sh +++ b/tests/Music/gen_tracks.sh @@ -1,5 +1,18 @@ #!/bin/bash +function check_cmd() +{ + echo -n "Checking for $1 ... " + CMD=$(which $1 2>/dev/null) + if [ $? != 0 ]; then + echo "$1 not found" + exit 1 + fi + echo $CMD +} +check_cmd ffmpeg +check_cmd vorbiscomment + TRACK=1 FFMPEG="ffmpeg -hide_banner -nostdin -f s16le -i /dev/zero -codec libvorbis -loglevel warning"