src/libFLAC/stream_decoder.c : Fix buffer read overflow.
[platform/upstream/flac.git] / test / test_libFLAC++.sh
1 #!/bin/sh
2
3 #  FLAC - Free Lossless Audio Codec
4 #  Copyright (C) 2002-2009  Josh Coalson
5 #  Copyright (C) 2011-2013  Xiph.Org Foundation
6 #
7 #  This file is part the FLAC project.  FLAC is comprised of several
8 #  components distributed under different licenses.  The codec libraries
9 #  are distributed under Xiph.Org's BSD-like license (see the file
10 #  COPYING.Xiph in this distribution).  All other programs, libraries, and
11 #  plugins are distributed under the GPL (see COPYING.GPL).  The documentation
12 #  is distributed under the Gnu FDL (see COPYING.FDL).  Each file in the
13 #  FLAC distribution contains at the top the terms under which it may be
14 #  distributed.
15 #
16 #  Since this particular file is relevant to all components of FLAC,
17 #  it may be distributed under the Xiph.Org license, which is the least
18 #  restrictive of those mentioned above.  See the file COPYING.Xiph in this
19 #  distribution.
20
21 die ()
22 {
23         echo $* 1>&2
24         exit 1
25 }
26
27 if [ x = x"$1" ] ; then 
28         BUILD=debug
29 else
30         BUILD="$1"
31 fi
32
33 LD_LIBRARY_PATH=../src/libFLAC/.libs:$LD_LIBRARY_PATH
34 LD_LIBRARY_PATH=../src/libFLAC++/.libs:$LD_LIBRARY_PATH
35 LD_LIBRARY_PATH=../src/share/grabbag/.libs:$LD_LIBRARY_PATH
36 LD_LIBRARY_PATH=../src/share/replaygain_analysis/.libs:$LD_LIBRARY_PATH
37 LD_LIBRARY_PATH=../objs/$BUILD/lib:$LD_LIBRARY_PATH
38 export LD_LIBRARY_PATH
39 export MALLOC_CHECK_=3
40 export MALLOC_PERTURB_=$((RANDOM % 255 + 1))
41 PATH=../src/test_libFLAC++:$PATH
42 PATH=../objs/$BUILD/bin:$PATH
43
44 run_test_libFLACpp ()
45 {
46         if [ x"$FLAC__TEST_WITH_VALGRIND" = xyes ] ; then
47                 valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 test_libFLAC++ $* 4>>test_libFLAC++.valgrind.log
48         else
49                 test_libFLAC++ $*
50         fi
51 }
52
53 run_test_libFLACpp || die "ERROR during test_libFLAC++"