summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2014-11-27 13:03:13 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2014-11-27 13:12:17 +1100
commit1a7c3fa488694d19535b2c9c59ae245db64a9778 (patch)
treefc905777d5e232d3f2c212de4e62c6c90c79766a
parentfe494d2dc28f246def589888ec8600d01ad1970e (diff)
downloadflac-1a7c3fa488694d19535b2c9c59ae245db64a9778.tar.gz
tests/*.sh : Switch back to /bin/sh.
Jan Stary reported that on OpenBSD bash isn't located in /bin/ which means that the test fail. He also noted that there didn't seem to be anything bash specific in the tests. This patch takes some suggestions from Jan, plus a few fixes tested on Debian using the bin/sh provided by bash and dash. Suggested-by: Jan Stary <hans@stare.cz>
-rw-r--r--test/common.sh.in6
-rwxr-xr-xtest/test_bins.sh4
-rwxr-xr-xtest/test_compression.sh9
-rwxr-xr-xtest/test_flac.sh4
-rwxr-xr-xtest/test_grabbag.sh4
-rwxr-xr-xtest/test_libFLAC++.sh4
-rwxr-xr-xtest/test_libFLAC.sh4
-rwxr-xr-xtest/test_metaflac.sh4
-rwxr-xr-xtest/test_replaygain.sh4
-rwxr-xr-xtest/test_seeking.sh4
-rwxr-xr-xtest/test_streams.sh4
-rwxr-xr-xtest/test_wrapper.sh2
12 files changed, 27 insertions, 26 deletions
diff --git a/test/common.sh.in b/test/common.sh.in
index 18130ef4..ffe62178 100644
--- a/test/common.sh.in
+++ b/test/common.sh.in
@@ -56,12 +56,14 @@ fi
# Functions
-function die {
+die ()
+{
echo $* 1>&2
exit 1
}
-function make_streams {
+make_streams ()
+{
echo "Generating streams..."
if [ ! -f wacky1.wav ] ; then
test_streams${EXE} || die "ERROR during test_streams"
diff --git a/test/test_bins.sh b/test/test_bins.sh
index 3ff193fb..26445b24 100755
--- a/test/test_bins.sh
+++ b/test/test_bins.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
# FLAC - Free Lossless Audio Codec
# Copyright (C) 2001-2009 Josh Coalson
@@ -18,7 +18,7 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution.
-source common.sh
+. ./common.sh
PATH=../src/flac:$PATH
PATH=../objs/$BUILD/bin:$PATH
diff --git a/test/test_compression.sh b/test/test_compression.sh
index 3d0f5667..d53e67d4 100755
--- a/test/test_compression.sh
+++ b/test/test_compression.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
# FLAC - Free Lossless Audio Codec
# Copyright (C) 2012-2014 Xiph.Org Foundation
@@ -17,7 +17,7 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution.
-source common.sh
+. ./common.sh
PATH=`pwd`/../src/flac:$PATH
@@ -39,9 +39,8 @@ for k in 0 1 2 3 4 5 6 7 8 ; do
echo "Error : Compression ${last_k} size ${last_size} >= compression ${k} size ${size}."
exit 1
fi
- # Need this string interpolation because OSX's 'wc -c' returns a number with
- # leading whitespace.
- let last_size="${size}+10"
+ # Need this because OSX's 'wc -c' returns a number with leading whitespace.
+ last_size=$((${size}+10))
last_k=${k}
rm -f ${fname}
done
diff --git a/test/test_flac.sh b/test/test_flac.sh
index c7a1c327..4ea7235e 100755
--- a/test/test_flac.sh
+++ b/test/test_flac.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
# FLAC - Free Lossless Audio Codec
# Copyright (C) 2001-2009 Josh Coalson
@@ -18,7 +18,7 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution.
-source common.sh
+. ./common.sh
# we use '.' as decimal separator in --skip/--until tests
export LANG=C LC_ALL=C
diff --git a/test/test_grabbag.sh b/test/test_grabbag.sh
index aa77c83e..5156a268 100755
--- a/test/test_grabbag.sh
+++ b/test/test_grabbag.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
# FLAC - Free Lossless Audio Codec
# Copyright (C) 2001-2009 Josh Coalson
@@ -18,7 +18,7 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution.
-source common.sh
+. ./common.sh
PATH=../src/test_grabbag/cuesheet:$PATH
PATH=../src/test_grabbag/picture:$PATH
diff --git a/test/test_libFLAC++.sh b/test/test_libFLAC++.sh
index 0a1f4641..3d82e0de 100755
--- a/test/test_libFLAC++.sh
+++ b/test/test_libFLAC++.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
# FLAC - Free Lossless Audio Codec
# Copyright (C) 2002-2009 Josh Coalson
@@ -18,7 +18,7 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution.
-source common.sh
+. ./common.sh
PATH=../src/test_libFLAC++:$PATH
PATH=../objs/$BUILD/bin:$PATH
diff --git a/test/test_libFLAC.sh b/test/test_libFLAC.sh
index 2245ba4b..e17bcac2 100755
--- a/test/test_libFLAC.sh
+++ b/test/test_libFLAC.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
# FLAC - Free Lossless Audio Codec
# Copyright (C) 2001-2009 Josh Coalson
@@ -18,7 +18,7 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution.
-source common.sh
+. ./common.sh
PATH=../src/test_libFLAC:$PATH
PATH=../objs/$BUILD/bin:$PATH
diff --git a/test/test_metaflac.sh b/test/test_metaflac.sh
index 63359d38..f5fc7102 100755
--- a/test/test_metaflac.sh
+++ b/test/test_metaflac.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
# FLAC - Free Lossless Audio Codec
# Copyright (C) 2002-2009 Josh Coalson
@@ -18,7 +18,7 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution.
-source common.sh
+. ./common.sh
PATH=`pwd`/../src/flac:$PATH
PATH=`pwd`/../src/metaflac:$PATH
diff --git a/test/test_replaygain.sh b/test/test_replaygain.sh
index 2fe01a34..eb0b0ef9 100755
--- a/test/test_replaygain.sh
+++ b/test/test_replaygain.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
# FLAC - Free Lossless Audio Codec
# Copyright (C) 2002-2009 Josh Coalson
@@ -18,7 +18,7 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution.
-source common.sh
+. ./common.sh
PATH=`pwd`/../src/flac:$PATH
PATH=`pwd`/../src/metaflac:$PATH
diff --git a/test/test_seeking.sh b/test/test_seeking.sh
index 882315cc..8c433050 100755
--- a/test/test_seeking.sh
+++ b/test/test_seeking.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
# FLAC - Free Lossless Audio Codec
# Copyright (C) 2004-2009 Josh Coalson
@@ -18,7 +18,7 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution.
-source common.sh
+. ./common.sh
PATH=../src/flac:$PATH
PATH=../src/metaflac:$PATH
diff --git a/test/test_streams.sh b/test/test_streams.sh
index 8442e479..9ba92271 100755
--- a/test/test_streams.sh
+++ b/test/test_streams.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
# FLAC - Free Lossless Audio Codec
# Copyright (C) 2001-2009 Josh Coalson
@@ -18,7 +18,7 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution.
-source common.sh
+. ./common.sh
PATH=../src/flac:$PATH
PATH=../src/test_streams:$PATH
diff --git a/test/test_wrapper.sh b/test/test_wrapper.sh
index 17d544ab..74be77d8 100755
--- a/test/test_wrapper.sh
+++ b/test/test_wrapper.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
# This test script should exit on the first failure.