3 # recins.sh - System tests for recins.
5 # Copyright (C) 2010-2015 Jose E. Marchesi.
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25 .
$srcdir/testutils.sh
32 test_declare_input_file empty-file \
35 test_declare_input_file one-record \
41 test_declare_input_file multiple-records \
55 test_declare_input_file multiple-records-case \
69 test_declare_input_file multiple-named \
89 test_declare_input_file integrity \
96 test_declare_input_file only-descriptor \
100 test_declare_input_file comments-and-descriptor \
108 test_declare_input_file external-descriptor-types \
113 test_declare_input_file external-descriptor \
114 '%rec: Patata recins-external-descriptor-types.in
119 test_declare_input_file auto-fields \
122 %type: myrange range 0 10
129 test_declare_input_file auto-notype \
136 test_declare_input_file auto-fields-several \
139 %type: myrange range 0 10
147 test_declare_input_file auto-range-overflow \
149 %type: myrange range 0 10
155 test_declare_input_file marks \
157 %type: Class enum A B C
170 test_tool recins-empty ok \
172 '-f field1 -v "value1"' \
177 test_tool recins-empty-with-type ok \
179 '-t Type1 -f field1 -v "value1"' \
186 test_tool recins-several-fields ok \
188 '-f field1 -v "value1" -f field2 -v "value2"' \
194 test_tool recins-append ok \
196 '-f afield1 -v "appended1"' \
213 test_tool recins-append-in-type ok \
215 '-t Type2 -f afield1 -v "appended1"' \
238 test_tool recins-append-new-type ok \
240 '-t NewType -f afield1 -v "appended1"' \
259 test_tool recins-replace ok \
261 '-n 1 -f afield1 -v "replaced"' \
274 test_tool recins-replace-range ok \
276 '-n 1-2 -f afield1 -v "replaced"' \
287 test_tool recins-replace-several-indexes ok \
289 '-n 0,2 -f afield1 -v "replaced"' \
300 test_tool recins-replace-sex ok \
302 '-e "field2 = '\''value22'\''" -f afield1 -v "replaced"' \
315 test_tool recins-violate-restrictions xfail \
317 '-t Integrity -f Id -v "not a number"' \
320 test_tool recins-force-restrictions ok \
322 '--force -t Integrity -f Id -v "not a number"' \
332 test_tool recins-only-descriptor ok \
339 test_tool recins-comments-and-descriptor ok \
342 comments-and-descriptor \
350 test_tool recins-external-descriptor ok \
352 '-t Patata -f foo -v 20' \
353 external-descriptor \
354 '%rec: Patata recins-external-descriptor-types.in
361 test_tool recins-auto-fields ok \
363 '-t foo -f foo -v bar' \
367 %type: myrange range 0 10
378 test_tool recins-auto-notype ok \
380 '-t foo -f foo -v bar' \
391 test_tool recins-auto-fields-several ok \
393 '-t foo -f foo -v bar' \
394 auto-fields-several \
397 %type: myrange range 0 10
409 test_tool recins-no-auto ok \
411 '--no-auto -t foo -f foo -v bar' \
415 %type: myrange range 0 10
424 test_tool recins-auto-range-overflow xfail \
426 '-t foo -f foo -v bar' \
429 test_tool recins-auto-range-overflow-force ok \
431 '--force -t foo -f foo -v bar' \
432 auto-range-overflow \
434 %type: myrange range 0 10
443 test_tool recins-quick-simple ok \
445 '-q value22 -f foo -v bar' \
458 test_tool recins-random-all ok \
460 '-m 0 -f foo -v bar' \
477 test_tool recins-random-one ok \
479 '-m 1 -f foo -v bar' \
484 test_tool recins-case-insensitive ok \
486 '-i -q value22 -f foo -v bar' \
487 multiple-records-case \
499 test_tool recins-case-sensitive ok \
501 '-q value22 -f foo -v bar' \
502 multiple-records-case \
516 test_tool recins-insert-default-type ok \
518 '-f Name -v Xavier -f Class -v X' \
524 %type: Class enum A B C