~ubuntu-branches/ubuntu/trusty/flac/trusty-updates

« back to all changes in this revision

Viewing changes to test/test_grabbag.sh

  • Committer: Bazaar Package Importer
  • Author(s): Marc 'HE' Brockschmidt
  • Date: 2008-03-16 18:02:56 UTC
  • mfrom: (1.1.5 upstream) (8.1.2 gutsy)
  • Revision ID: james.westby@ubuntu.com-20080316180256-qhf3wk704rp165pm
Tags: 1.2.1-1.2
* Non-maintainer upload.
* Fix gcc-4.3 FTBFS, patch by KiBi (Closes: #455304)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
 
3
3
#  FLAC - Free Lossless Audio Codec
4
 
#  Copyright (C) 2001,2002,2003,2004,2005  Josh Coalson
 
4
#  Copyright (C) 2001,2002,2003,2004,2005,2006,2007  Josh Coalson
5
5
#
6
6
#  This file is part the FLAC project.  FLAC is comprised of several
7
7
#  components distributed under difference licenses.  The codec libraries
35
35
LD_LIBRARY_PATH=../obj/$BUILD/lib:$LD_LIBRARY_PATH
36
36
export LD_LIBRARY_PATH
37
37
PATH=../src/test_grabbag/cuesheet:$PATH
 
38
PATH=../src/test_grabbag/picture:$PATH
38
39
PATH=../obj/$BUILD/bin:$PATH
39
40
 
40
41
test_cuesheet -h 1>/dev/null 2>/dev/null || die "ERROR can't find test_cuesheet executable"
 
42
test_picture -h 1>/dev/null 2>/dev/null || die "ERROR can't find test_picture executable"
41
43
 
42
44
run_test_cuesheet ()
43
45
{
44
 
        if [ x"$FLAC__VALGRIND" = xyes ] ; then
45
 
                valgrind --leak-check=yes --show-reachable=yes --num-callers=100 --logfile-fd=4 test_cuesheet $* 4>>test_grabbag.valgrind.log
 
46
        if [ x"$FLAC__TEST_WITH_VALGRIND" = xyes ] ; then
 
47
                echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=100 test_cuesheet $*" >>test_grabbag.valgrind.log
 
48
                valgrind --leak-check=yes --show-reachable=yes --num-callers=100 --log-fd=4 test_cuesheet $* 4>>test_grabbag.valgrind.log
46
49
        else
47
50
                test_cuesheet $*
48
51
        fi
49
52
}
50
53
 
 
54
run_test_picture ()
 
55
{
 
56
        if [ x"$FLAC__TEST_WITH_VALGRIND" = xyes ] ; then
 
57
                echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=100 test_picture $*" >>test_grabbag.valgrind.log
 
58
                valgrind --leak-check=yes --show-reachable=yes --num-callers=100 --log-fd=4 test_picture $* 4>>test_grabbag.valgrind.log
 
59
        else
 
60
                test_picture $*
 
61
        fi
 
62
}
 
63
 
 
64
if [ `env | grep -ic '^comspec='` != 0 ] ; then
 
65
        is_win=yes
 
66
else
 
67
        is_win=no
 
68
fi
 
69
 
 
70
########################################################################
 
71
#
 
72
# test_picture
 
73
#
 
74
########################################################################
 
75
 
 
76
log=picture.log
 
77
picture_dir=pictures
 
78
 
 
79
echo "Running test_picture..."
 
80
 
 
81
rm -f $log
 
82
 
 
83
run_test_picture $picture_dir >> $log 2>&1
 
84
 
 
85
if [ $is_win = yes ] ; then
 
86
        diff -w picture.ok $log > picture.diff || die "Error: .log file does not match .ok file, see picture.diff"
 
87
else
 
88
        diff picture.ok $log > picture.diff || die "Error: .log file does not match .ok file, see picture.diff"
 
89
fi
 
90
 
 
91
echo "PASSED (results are in $log)"
 
92
 
51
93
########################################################################
52
94
#
53
95
# test_cuesheet
60
102
good_leadout=`expr 80 \* 60 \* 44100`
61
103
bad_leadout=`expr $good_leadout + 1`
62
104
 
 
105
echo "Running test_cuesheet..."
 
106
 
63
107
rm -f $log
64
108
 
65
109
#
95
139
        rm -f $cuesheet_pass1 $cuesheet_pass2
96
140
done
97
141
 
98
 
diff cuesheet.ok $log > cuesheet.diff || die "Error: .log file does not match .ok file, see cuesheet.diff"
 
142
if [ $is_win = yes ] ; then
 
143
        diff -w cuesheet.ok $log > cuesheet.diff || die "Error: .log file does not match .ok file, see cuesheet.diff"
 
144
else
 
145
        diff cuesheet.ok $log > cuesheet.diff || die "Error: .log file does not match .ok file, see cuesheet.diff"
 
146
fi
99
147
 
100
148
echo "PASSED (results are in $log)"