Add test for bug fixed recently in recode
[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
8 here=`pwd`;
9
10 # ensure that top_srcdir is absolute
11 cd $top_srcdir; top_srcdir=`pwd`
12
13 export STAT_CONFIG_PATH=$top_srcdir/config
14
15
16 cleanup()
17 {
18      rm -rf $TEMPDIR
19 }
20
21
22 fail()
23 {
24     echo $activity
25     echo FAILED
26     cleanup;
27     exit 1;
28 }
29
30
31 no_result()
32 {
33     echo $activity
34     echo NO RESULT;
35     cleanup;
36     exit 2;
37 }
38
39 pass()
40 {
41     cleanup;
42     exit 0;
43 }
44
45 mkdir -p $TEMPDIR
46
47 cd $TEMPDIR
48
49 cat > $TEMPDIR/prog.sps <<EOF
50 DATA LIST FREE/
51    name  (A8) value * quantity .
52 BEGIN DATA.
53 Cables 829 3 
54 END DATA.
55 EXECUTE.
56
57 FREQUENCIES /VAR = name.
58
59 EOF
60 if [ $? -ne 0 ] ; then no_result ; fi
61
62
63 $SUPERVISOR $here/../src/pspp $TEMPDIR/prog.sps
64 if [ $? -ne 0 ] ; then fail ; fi
65
66
67 pass;