diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2018-05-23 19:18:14 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2018-05-23 19:18:14 +0300 |
commit | 7edbff3372dfd387e4f6da45f43ba8ada6dfbe43 (patch) | |
tree | d3049ab8c07773c82104e720f92be555ae276179 /tests/Makefile.am | |
parent | 008b71a4d58ad33cf5a41e2aa55b9393e8420531 (diff) | |
download | gdbm-7edbff3372dfd387e4f6da45f43ba8ada6dfbe43.tar.gz |
gdbmtool: accept commands from command line as well as from file
Commands can be supplied to gdbmtool in three ways:
1. From a file, using the --file (-f) option:
gdbmtool -f comfile
2. From the command line, if first argument is the database name:
gdbmtool test.db count \; fetch mykey \; avail
Note the use of semicolon to delimit commands.
3. From the interactive shell, if neither of the above is used.
* src/Makefile.am: Add new sources.
* src/gdbmtool.c: Use new stream functions for input.
* src/gdbmtool.h (setsource): Remove proto.
(instream_t): New data type.
(instream_name, instream_read)
(instream_close, instream_interactive)
(instream_eq): New functions.
(instream_stdin_create)
(instream_argv_create)
(instream_file_create)
(interactive, input_context_push): New protos.
* src/gram.y: Accept ; in place of newline.
* src/input-argv.c: New file.
* src/input-file.c: New file.
* src/input-rl.c: Rewrite to provide instream_t API.
* src/input-std.c: Likewise.
* src/lex.l: Rewrite.
* tests/.gitignore: Update.
* tests/Makefile.am: Add new tests. Incorporate
DejaGNU tests.
* tests/config/default.exp: New file.
* tests/gdbmtool/base.exp: New file.
* tests/gdbmtool00.at: New file.
* tests/gdbmtool01.at: New file.
* tests/gdbmtool02.at: New file.
* tests/testsuite.at: Include new tests.
Diffstat (limited to 'tests/Makefile.am')
-rw-r--r-- | tests/Makefile.am | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index b85110d..409ce0b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -22,7 +22,6 @@ EXTRA_DIST = \ DISTCLEANFILES = atconfig MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE) - ## ------------ ## ## package.m4. ## ## ------------ ## @@ -73,6 +72,9 @@ TESTSUITE_AT = \ delete00.at\ delete01.at\ delete02.at\ + gdbmtool00.at\ + gdbmtool01.at\ + gdbmtool02.at\ fetch00.at\ fetch01.at\ setopt00.at\ @@ -135,4 +137,35 @@ dtfetch_LDADD = ../src/libgdbm.la ../compat/libgdbm_compat.la dtdel_LDADD = ../src/libgdbm.la ../compat/libgdbm_compat.la d_creat_ce_LDADD = ../src/libgdbm.la ../compat/libgdbm_compat.la - +## -------------------- ## +## DejaGNU Test suite. ## +## -------------------- ## +AUTOMAKE_OPTIONS = dejagnu +DEJATOOL = gdbmtool +RUNTESTFLAGS = +CLEANFILES = *.log + +site.exp: Makefile + @echo 'Making a new site.exp file...' + @test ! -f site.bak || rm -f site.bak + @echo '## these variables are automatically generated by make ##' > $@-t + @echo '# Do not edit here. If you wish to override these values' >> $@-t + @echo '# edit the last section' >> $@-t + @echo 'set tool $(DEJATOOL)' >> $@-t + @echo "set top_srcdir `cd $(top_srcdir); pwd`" >> $@-t + @echo "set top_builddir `cd $(top_builddir); pwd`" >> $@-t + @echo "set srcdir `cd $(srcdir); pwd`" >> $@-t + @echo 'set objdir' `pwd` >> $@-t + @echo 'set host_alias "$(host_alias)"' >> $@-t + @echo 'set host_triplet $(host_triplet)' >> $@-t + @echo 'set target_alias "$(target_alias)"' >> $@-t + @echo 'set target_triplet $(target_triplet)' >> $@-t + @echo 'set build_alias "$(build_alias)"' >> $@-t + @echo 'set build_triplet $(build_triplet)' >> $@-t + @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t + @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t + @test ! -f site.exp || mv site.exp site.bak + @mv $@-t site.exp + +EXTRA_DIST += \ + gdbmtool/base.exp |