Started converting the make check target to aegis style tests
[pspp-builds.git] / tests / bugs / double-frequency.sh
1 #!/bin/sh
2
3 # This program tests for a bug where pspp would crash if two frequencies
4 # Commands existed in a input file
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
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
49 activity="create data"
50 cat << EOF > $TEMPDIR/ff.stat 
51
52 data list free /v1 v2.
53 begin data.
54 0 1
55 2 3 
56 4 5
57 3 4
58 end data.
59
60 frequencies v1 v2.
61 frequencies v1 v2.
62 EOF
63 if [ $? -ne 0 ] ; then no_result ; fi
64
65
66 cd $TEMPDIR
67
68 activity="run data"
69 $here/../src/pspp  $TEMPDIR/ff.stat
70 if [ $? -ne 0 ] ; then fail ; fi
71
72
73 pass;