From 1a7c3fa488694d19535b2c9c59ae245db64a9778 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Thu, 27 Nov 2014 13:03:13 +1100 Subject: 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 --- test/common.sh.in | 6 ++++-- test/test_bins.sh | 4 ++-- test/test_compression.sh | 9 ++++----- test/test_flac.sh | 4 ++-- test/test_grabbag.sh | 4 ++-- test/test_libFLAC++.sh | 4 ++-- test/test_libFLAC.sh | 4 ++-- test/test_metaflac.sh | 4 ++-- test/test_replaygain.sh | 4 ++-- test/test_seeking.sh | 4 ++-- test/test_streams.sh | 4 ++-- test/test_wrapper.sh | 2 +- 12 files changed, 27 insertions(+), 26 deletions(-) (limited to 'test') 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. -- cgit v1.2.1