fcd4eaca3d4a5236d58b42bf497b50682bd3ce41
[pspp-builds.git] / tests / bugs / alpha-freq.sh
1 #!/bin/sh
2
3 # This program tests for a bug where the FREQUENCIES command would 
4 # crash if given an alphanumeric variable
5
6 TEMPDIR=/tmp/pspp-tst-$$
7 TESTFILE=$TEMPDIR/`basename $0`.sps
8
9 here=`pwd`;
10
11 # ensure that top_srcdir is absolute
12 cd $top_srcdir; top_srcdir=`pwd`
13
14 export STAT_CONFIG_PATH=$top_srcdir/config
15
16
17 cleanup()
18 {
19      rm -rf $TEMPDIR
20 }
21
22
23 fail()
24 {
25     echo $activity
26     echo FAILED
27     cleanup;
28     exit 1;
29 }
30
31
32 no_result()
33 {
34     echo $activity
35     echo NO RESULT;
36     cleanup;
37     exit 2;
38 }
39
40 pass()
41 {
42     cleanup;
43     exit 0;
44 }
45
46 mkdir -p $TEMPDIR
47
48 cd $TEMPDIR
49
50 cat > $TEMPDIR/prog.sps <<EOF
51 DATA LIST FREE/
52    name  (A8) value * quantity .
53 BEGIN DATA.
54 Cables 829 3 
55 END DATA.
56 EXECUTE.
57
58 FREQUENCIES /VAR = name.
59
60 EOF
61 if [ $? -ne 0 ] ; then no_result ; fi
62
63
64 $SUPERVISOR $here/../src/pspp $TEMPDIR/prog.sps
65 if [ $? -ne 0 ] ; then fail ; fi
66
67
68 pass;