3 dnl Create a file "batch.sps" that is valid syntax only in batch mode.
4 m4_define([CREATE_BATCH_SPS],
5 [AT_DATA([batch.sps], [dnl
15 AT_SETUP([INSERT SYNTAX=INTERACTIVE])
17 AT_DATA([insert.sps], [dnl
23 AT_CHECK([pspp -o pspp.csv insert.sps], [1], [dnl
24 batch.sps:2: error: INPUT PROGRAM: Syntax error at `+': expecting command name.
25 batch.sps:3: error: INPUT PROGRAM: Syntax error at `+': expecting command name.
26 batch.sps:5: error: INPUT PROGRAM: Syntax error at `+': expecting command name.
27 batch.sps:7: error: Input program did not create any variables.
28 insert.sps:4: error: LIST: LIST is allowed only after the active file has been defined.
32 AT_SETUP([INSERT SYNTAX=BATCH])
34 AT_DATA([insert.sps], [dnl
40 AT_CHECK([pspp -o pspp.csv insert.sps])
41 AT_CHECK([cat pspp.csv], [0], [dnl
52 AT_SETUP([INSERT CD=NO])
53 AT_DATA([insert.sps], [INSERT FILE='Dir1/foo.sps'.
57 AT_DATA([Dir1/foo.sps], [INSERT FILE='bar.sps' CD=NO.
59 AT_DATA([Dir1/bar.sps],
67 AT_CHECK([pspp -o pspp.csv insert.sps], [1], [dnl
68 Dir1/foo.sps:1: error: INSERT: Can't find `bar.sps' in include file search path.
69 insert.sps:2: error: LIST: LIST is allowed only after the active file has been defined.
73 AT_SETUP([INSERT CD=YES])
74 AT_DATA([insert.sps], [INSERT FILE='Dir1/foo.sps' CD=YES.
78 AT_DATA([Dir1/foo.sps], [INSERT FILE='bar.sps'.
80 AT_DATA([Dir1/bar.sps],
88 AT_CHECK([pspp -o pspp.csv insert.sps])
89 AT_CHECK([cat pspp.csv], [0], [dnl
90 Table: Reading free-form data from INLINE.
102 m4_define([CREATE_ERROR_SPS],
103 [AT_DATA([error.sps], [dnl
104 DATA LIST NOTABLE LIST /x *.
111 * The following line is erroneous
116 AT_SETUP([INSERT ERROR=STOP])
118 AT_DATA([insert.sps], [INSERT FILE='error.sps' ERROR=STOP.
121 AT_CHECK([pspp -o pspp.csv insert.sps], [1], [dnl
122 error.sps:10: error: DISPLAY: AKSDJ is not a variable name.
123 warning: Error encountered while ERROR=STOP is effective.
124 error.sps:10: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
128 AT_SETUP([INSERT ERROR=CONTINUE])
130 AT_DATA([insert.sps], [INSERT FILE='error.sps' ERROR=CONTINUE.
133 AT_CHECK([pspp -o pspp.csv insert.sps], [1], [dnl
134 error.sps:10: error: DISPLAY: AKSDJ is not a variable name.
136 AT_CHECK([cat pspp.csv], [0], [dnl
137 error.sps:10: error: DISPLAY: AKSDJ is not a variable name.
147 dnl Test for regression against bug #24569 in which PSPP crashed
148 dnl upon attempt to insert a nonexistent file.
149 AT_SETUP([INSERT nonexistent file])
150 AT_DATA([insert.sps], [dnl
158 AT_CHECK([pspp -O format=csv insert.sps], [1], [dnl
159 insert.sps:3: error: INSERT: Can't find `nonexistent' in include file search path.
161 insert.sps:6: error: LIST: LIST is allowed only after the active file has been defined.