Add copyright and licence notices to files which lack them.
[pspp] / tests / ui / terminal / main.at
1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
3 dnl 
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
8 dnl 
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl 
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 dnl AT_BANNER([PSPP terminal UI])
17
18 AT_SETUP([nonexistent syntax file crash])
19 AT_CHECK([pspp nonexistent], [1], 
20   [error: Opening `nonexistent': No such file or directory.
21 ])
22 AT_CLEANUP
23
24 AT_SETUP([SIGTERM yields clean shutdown])
25 AT_DATA([main.sps], [dnl
26 INPUT PROGRAM.
27 COMPUTE x = x + 1.
28 DO IF x = 10000.
29 END CASE.
30 ELSE IF x < 0.
31 END FILE.
32 END IF.
33 END INPUT PROGRAM.
34 EXECUTE.
35 ])
36 AT_CHECK([pspp main.sps & sleep 1; kill $!; wait $!], [143], [], [ignore])
37 AT_CLEANUP
38
39 AT_SETUP([SIGSEGV yields error report])
40 AT_CHECK([[echo 'host command=["kill -SEGV $PPID"].' | pspp -O format=csv]],
41   [139], [], [stderr])
42
43 cat > expout <<EOF
44 ******************************************************
45 You have discovered a bug in PSPP.  Please report this
46 to $PACKAGE_BUGREPORT.  Please include this entire
47 message, *plus* several lines of output just above it.
48 For the best chance at having the bug fixed, also
49 include the syntax file that triggered it and a sample
50 of any data file used for input.
51 proximate cause:     Segmentation Violation
52 EOF
53
54 AT_CHECK([sed '/proximate/q' < stderr], [0], [expout])
55 AT_CLEANUP
56
57
58 dnl This tests for a crash which was observed with --syntax
59 AT_SETUP([argument parsing])
60
61 AT_DATA([main.sps], [dnl
62 ECHO 'This is a test'.
63 FINISH.
64 ])
65
66 AT_CHECK([pspp --syntax=enhanced main.sps], [0], [ignore])
67
68 AT_CLEANUP