Debian Codegraph @

debian/run-misc-tests.sh

raw symbols SCIP
1 #!/bin/bash
2 #
3 # run the misc tests: we need to do this in a script since
4 # these are expected to fail which would normally cause %check
5 # to stop. however, this is expected behavior. we are running
6 # iasl precisely because we expect it to stop when presented with
7 # faulty ASL.
8 #
9 # this script assumes it is in the root of the source directory at
10 # start.
11 #
12
13 set -x
14
15 CURDIR="$1"
16 BINDIR="$1/generate/unix/bin"
17 DEBDIR="$1/debian"
18 VERSION="$2"
19
20 cd $CURDIR/tests/misc
21
22 # create files to compare against
23 $BINDIR/iasl -h
24
25 BITS=$(dpkg-architecture -qDEB_HOST_ARCH_BITS)
26
27 # if the build happens to start before midnight, the date gets
28 # confused in the comparison later on if the build goes past
29 # midnight. grab the date from the iasl file we just built so
30 # they match regardless.
31 FDATE=`stat --format="%Y" $BINDIR/iasl | cut -d" " -f1`
32 WHEN=`date --date="@$FDATE" +"%b %_d %Y"`
33
34 sed -e "s/VVVVVVVV/$VERSION/" \
35 $DEBDIR/badcode.asl.result > badcode.asl.expected
36 sed -e "s/VVVVVVVV/$VERSION/" \
37 $DEBDIR/grammar.asl.result > grammar.asl.expected
38 sed -e "s/VVVVVVVV/$VERSION/" \
39 $DEBDIR/converterSample.asl.result > converterSample.asl.expected
40
41 # see if badcode.asl failed as expected
42 # NB: the -f option is required so we can see all of the errors
43 $BINDIR/iasl -f badcode.asl 2>&1 | tee badcode.asl.actual
44 diff badcode.asl.actual badcode.asl.expected >/dev/null 2>&1
45 [ $? -eq 0 ] || exit 1
46
47 # see if grammar.asl failed as expected
48 # NB: the -f option is required so we can see all of the errors
49 $BINDIR/iasl -f -of grammar.asl 2>&1 | tee grammar.asl.actual
50 diff grammar.asl.actual grammar.asl.expected >/dev/null 2>&1
51 [ $? -eq 0 ] || exit 1
52
53 # see if converterSample.asl failed as expected
54 # NB: the -f option is required so we can see all of the errors
55 $BINDIR/iasl -f -of converterSample.asl 2>&1 | tee converterSample.asl.actual
56 diff converterSample.asl.actual converterSample.asl.expected >/dev/null 2>&1
57 [ $? -eq 0 ] || exit 1
58
59 exit 0