Add output-prefix tests

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
This commit is contained in:
orbea 2018-06-04 21:00:06 -07:00 committed by Erik de Castro Lopo
parent 5dff53c0cc
commit 452a447778

View File

@ -726,6 +726,43 @@ if [ $is_win = no ] ; then
echo OK
fi
############################################################################
# test --output-prefix
############################################################################
in_dir=./tmp_in
out_dir=./tmp_out
mkdir $in_dir $out_dir || die "ERROR failed to create temp directories"
cp 50c.raw 50c.flac $in_dir
#
# test --output-prefix when encoding
#
echo $ECHO_N "testing --output-prefix=$out_dir/ (encode)... " $ECHO_C
run_flac $raw_eopt --output-prefix=$out_dir/ $in_dir/50c.raw || die "ERROR generating FLAC file in $out_dir (encode)"
[ -f $out_dir/50c.flac ] || die "ERROR FLAC file not in $out_dir (encode)"
run_flac $raw_dopt $out_dir/50c.flac || die "ERROR decoding FLAC file (encode)"
[ -f $out_dir/50c.raw ] || die "ERROR RAW file not in $out_dir (encode)"
cmp 50c.raw $out_dir/50c.raw || die "ERROR: file mismatch for --output-prefix=$out_dir (encode)"
rm -f $out_dir/50c.flac $out_dir/50c.raw
echo OK
#
# test --ouput-prefix when decoding
#
echo $ECHO_N "testing --output-prefix=$out_dir/ (decode)... " $ECHO_C
run_flac $raw_dopt --output-prefix=$out_dir/ $in_dir/50c.flac || die "ERROR deocding FLAC file in $out_dir (decode)"
[ -f $out_dir/50c.raw ] || die "ERROR RAW file not in $out_dir (decode)"
run_flac $raw_eopt $out_dir/50c.raw || die "ERROR generating FLAC file (decode)"
[ -f $out_dir/50c.flac ] || die "ERROR FLAC file not in $out_dir (decode)"
cmp 50c.flac $out_dir/50c.flac || die "ERROR: file mismatch for --output-prefix=$out_dir (decode)"
rm -f $out_dir/50c.flac $out_dir/50c.raw
echo OK
rm -rf $in_dir $out_dir
############################################################################
# test --cue