Updated the documentation and fixed a couple of the test scripts
[pspp-builds.git] / tests / bugs / recode-copy-bug.sh
1 #!/bin/sh
2
3 # This program tests ....
4
5 TEMPDIR=/tmp/pspp-tst-$$
6
7 here=`pwd`;
8
9 # ensure that top_srcdir is absolute
10 cd $top_srcdir; top_srcdir=`pwd`
11
12 export STAT_CONFIG_PATH=$top_srcdir/config
13
14
15 cleanup()
16 {
17      rm -rf $TEMPDIR
18 }
19
20
21 fail()
22 {
23     echo $activity
24     echo FAILED
25     cleanup;
26     exit 1;
27 }
28
29
30 no_result()
31 {
32     echo $activity
33     echo NO RESULT;
34     cleanup;
35     exit 2;
36 }
37
38 pass()
39 {
40     cleanup;
41     exit 0;
42 }
43
44 mkdir -p $TEMPDIR
45
46 activity="copy template 1" 
47 cp $top_srcdir/tests/bugs/recode-copy-bug-1.stat $TEMPDIR
48 if [ $? -ne 0 ] ; then no_result ; fi
49
50 activity="copy template 2" 
51 cp $top_srcdir/tests/bugs/recode-copy-bug-2.stat $TEMPDIR
52 if [ $? -ne 0 ] ; then no_result ; fi
53
54 activity="chdir"
55 cd $TEMPDIR
56 if [ $? -ne 0 ] ; then no_result ; fi
57
58
59 activity="run program"
60 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/recode-copy-bug-1.stat
61 if [ $? -ne 0 ] ; then no_result ; fi
62
63
64 activity="compare output"
65 diff -b -B -w $TEMPDIR/pspp.list $top_srcdir/tests/bugs/recode-copy-bug-1.out
66 if [ $? -ne 0 ] ; then fail ; fi
67
68
69 activity="run program"
70 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/recode-copy-bug-2.stat
71 if [ $? -ne 0 ] ; then no_result ; fi
72
73
74 activity="compare output"
75 diff -b -B -w $TEMPDIR/pspp.list $top_srcdir/tests/bugs/recode-copy-bug-2.out
76 if [ $? -ne 0 ] ; then fail ; fi
77
78 pass;