forked from dsedivec/cedet
/
testdist.sh
executable file
·86 lines (72 loc) · 1.8 KB
/
testdist.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
#
# Run a suite of tests on a CEDET distribution.
#
# 1) Set current directory to wherever a CEDET version from CVS is
#
# 2) ./testdist.sh myemacs
#
# Will test the Make build, and the ebuild build, and all the
# automated tests using the myemacs program.
#
# 3) ./testdist.sh emacs xemacs
#
# Will do the same with emacs and xemacs, and any other number of Emacsen
# you add to the command line.
#
EMACS=emacs
if [ $# -gt 0 ]; then
EMACS=$*
fi
CEDETVER=`grep "defconst cedet-version" common/cedet.el | cut -d "\"" -f 2`
echo "Distribution Test with \"$EMACS\" of CEDET version $CEDETVER"
CEDETROOT=`pwd`
DIST=$CEDETROOT/cedet-$CEDETVER.tar.gz
if [ ! -f $DIST ]; then
echo "Cannot find distribution file cedet-$CEDETVER.tar.gz"
exit 1
fi
cd /tmp
mkdir -p CEDETDISTTEST
cd CEDETDISTTEST
if [ -d cedet-$CEDETVER ]; then
echo "Deleting old CEDET dist from previous test."
rm -rf "cedet-$CEDETVER"
fi
for i in $EMACS; do
echo "Run DIST test with $i using make"
tar -xvzf $DIST
cd "cedet-$CEDETVER"
if make EMACS=$i; then
echo "DIST build with $i using make PASSED."
else
echo "DIST build with $i using make FAILED."
exit 1
fi
if make EMACS=$i utest itest; then
echo "DIST test with $i using make PASSED."
else
echo "DIST test with $i using make FAILED."
exit 1
fi
cd ..
rm -rf "cedet-$CEDETVER"
echo "Run DIST test with $i using ebuild (via make)"
tar -xvzf $DIST
cd "cedet-$CEDETVER"
if make EMACS=$i ebuild; then
echo "DIST build with $i using make PASSED."
else
echo "DIST build with $i using make FAILED."
exit 1
fi
if make EMACS=$i utest itest; then
echo "DIST test with $i using make PASSED."
else
echo "DIST test with $i using make FAILED."
exit 1
fi
cd ..
rm -rf "cedet-$CEDETVER"
done
exit 0