summaryrefslogtreecommitdiff
path: root/tests/Makefile.am
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright yearsSergey Poznyakoff2023-01-221-1/+1
|
* Test database file dumping and loadingSergey Poznyakoff2022-07-031-0/+2
|
* Update copyright yearsSergey Poznyakoff2022-01-021-1/+1
|
* Rearrange the directory structureSergey Poznyakoff2021-11-201-2/+2
| | | | | | Sources for the libgdbm library reside in src/. Sources for building accompanying tools are moved to the tools/ subdirectory.
* Word wrapping output functions for gdbm appsSergey Poznyakoff2021-11-181-1/+4
| | | | | | | | | | | | | | * src/Makefile.am (libgdbmapp_a_SOURCES): Add wordwrap.c * src/wordwrap.c: New file. * tests/Makefile.am: Add t_wordwrap and wordspit.at * tests/testsuite.at: Add new test. * tests/t_wordwrap.c: New file. * src/gdbmshell.c (help_handler): Use wordwrap functions. * src/parseopt.c: Rewrite help output using wordwrap. Add support for the ARGP_HELP_FMT environment variable. Make sure no empty strings are ever passed to gettext.
* Switch to hash table cache implementationSergey Poznyakoff2021-11-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/cachetree.c: Remove. * src/Makefile.am: Remove cachetree.c * doc/gdbm.texi: Document the changes. * src/bucket.c (cache_tab_lookup_slot) (cache_tab_resize): New function. (cache_elem_new): Initialize ca_coll. (cache_elem_free, cache_lookup) (_gdbm_cache_init,_gdbm_cache_free): Rewrite with hash-based cache lookup. (_gdbm_fetch_data): Remove unused function. * src/gdbm.h.in (GDBM_GETDBFORMAT, GDBM_GETDIRDEPTH) (GDBM_GETBUCKETSIZE, GDBM_GETCACHEAUTO, GDBM_SETCACHEAUTO): New option codes. * src/gdbmdefs.h (cache_node): Remove. (cache_elem): Remove ca_node. Add ca_coll (collision resolution pointer). (gdbm_file_info): New members: cache_auto, cache_bits, cache. * src/gdbmopen.c (gdbm_fd_open): Change cache initialization. * src/gdbmsetopt.c (GDBM_GETDBFORMAT,GDBM_GETDIRDEPTH) (GDBM_GETBUCKETSIZE,GDBM_GETCACHEAUTO) (GDBM_SETCACHEAUTO): Implement new options. (setopt_gdbm_getflags): Reflect the state of GDBM_CLOEXEC and GDBM_NUMSYNC. * src/proto.h (_gdbm_fetch_data,_gdbm_cache_tree_alloc) (_gdbm_cache_tree_destroy,_gdbm_cache_tree_delete) (_gdbm_cache_tree_lookup): Remove protos. * src/recover.c (_gdbm_finish_transfer): Restore original cache settings. * tests/Makefile.am: Add new test. * tests/testsuite.at: Likewise. * tests/gtcacheopt.c: New file. * tests/setopt02.at: New test case.
* Fix testing with DejaGNU 1.6.3Sergey Poznyakoff2021-09-071-33/+1
| | | | | | | | | | | | | DejaGNU starting from version 1.6.3 looks for the testsuite in the directory testsuite. See https://puszcza.gnu.org.ua/bugs/index.php?519 * configure.ac: Register tests/gdbmtool/Makefile * tests/Makefile.am: Move dejagnu tests to the gdbmtool subdir. * tests/gdbmtool/Makefile.am: New file. * tests/config/default.exp: Move to tests/gdbmtool/config/default.exp * tests/gdbmtool/base.exp: Move to tests/gdbmtool/testsuite/gdbmtool/base.exp
* Test conversion to extended format.Sergey Poznyakoff2021-07-291-0/+2
| | | | | | | | | * src/gdbmdefs.h (gdbm_ext_header): Add new field: version. Pad to 8 integers. * tests/gtconv.c: New auxiliary program. * tests/conv.at: New test. * tests/Makefile.am: Add new tests. * tests/testsuite.at: Likewise.
* Update copyright yearsSergey Poznyakoff2021-01-021-1/+1
|
* Update copyright yearsSergey Poznyakoff2020-12-231-1/+1
|
* Update copyright yearsSergey Poznyakoff2019-04-081-1/+1
|
* Change return value of gdbm_close and gdbm_syncSergey Poznyakoff2018-07-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gdbm.h.in (gdbm_close, gdbm_sync): Return int (GDBM_FILE_CLOSE_ERROR, GDBM_FILE_SYNC_ERROR): New error codes. * src/gdbmclose.c (gdbm_close): Return 0 on success, -1 on failure. Set gdbm_errno and errno. * src/gdbmsync.c (gdbm_sync): Likewise. * src/gdbmerrno.c: Handle new error codes. * src/mmap.c (_gdbm_mapped_sync): Set gdbm_errno. * src/proto.h (gdbm_file_sync): Set gdbm_errno. * doc/gdbm.3: Document changes. * doc/gdbm.texi: Document changes. * NEWS: Document changes. * configure.ac: Set patchlevel. * tests/Makefile.am: Add new test. * tests/testsuite.at: Add new test. * tests/closerr.at: New test case. * tests/closerr.c: New test program. * tests/gtdel.c: Check gdbm_close return. * tests/gtdump.c: Likewise. * tests/gtfetch.c: Likewise. * tests/gtload.c: Likewise. * tests/gtopt.c: Likewise. * tests/gtrecover.c: Likewise.
* Various fixesSergey Poznyakoff2018-05-241-5/+0
| | | | | | | | | | | | | | | * src/input-std.c: Bugfix * doc/gdbm.texi: Document changes. * README: Update. * configure.ac: New option --enable-gdbmtool-debug. * src/Makefile.am: Conditionally augment AM_YFLAGS and AM_LFLAGS with options that enable debugging. * src/gdbmtool.c: Conditionally enable --lex-trace and --gram-trace options. * src/gram.y: Likewise. * src/lex.l: Likewise. * tests/Makefile.am: Remove architecure-dependent tests. * tests/testsuite.at: Likewise.
* BugfixSergey Poznyakoff2018-05-241-1/+3
| | | | * tests/Makefile.am (EXTRA_DIST): Add missing file.
* Add new testSergey Poznyakoff2018-05-241-0/+1
|
* gdbmtool: accept commands from command line as well as from fileSergey Poznyakoff2018-05-231-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Catch more errorsSergey Poznyakoff2018-05-191-0/+2
| | | | | | | | | | | * src/gdbmdump.c (_gdbm_dump_ascii): Break on errors * src/gdbmopen.c (compute_directory_size): Remove unused argument. (validate_header): Catch dir_size and dir_bits mismatches. * src/mmap.c (_gdbm_mapped_lseek): Bail out on negative offsets. * tests/dump03.at: New test. * tests/dump04.at: New test. * tests/Makefile.am: Add new tests. * tests/testsuite.at: Add new tests.
* Add new testsSergey Poznyakoff2018-05-191-0/+3
| | | | | | | | | | | | * src/gdbm_dump.c: Fix exit code. * configure.ac: Determine presence of gzip and base64 (GZIP_BIN,BASE64_BIN): New variables. * tests/atlocal.in (GZIP_BIN,BASE64_BIN): New variables. * tests/dump00.at: New file. * tests/dump01.at: New file. * tests/dump02.at: New file. * tests/Makefile.am: Add new tests. * tests/testsuite.at: Add new tests.
* Happy GNU YearSergey Poznyakoff2018-01-011-1/+1
|
* Happy GNU YearSergey Poznyakoff2017-01-021-1/+1
|
* Add debug info.Sergey Poznyakoff2016-07-251-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Fix description wording. * src/Makefile.am [GDBM_COND_DEBUG_ENABLE]: Don't define GDBM_DEBUG_ENABLE. * tests/Makefile.am: Likewise. * src/debug.c (gdbm_debug_printer) (gdbm_debug_flags): New globals. (gdbm_debug_token, gdbm_debug_parse_state) (gdbm_debug_datum): New functions. * src/gdbm.h.in [@GDBM_DEBUG_ENABLE@]: Define GDBM_DEBUG_ENABLE. (gdbm_debug_printer_t): New typedef. (gdbm_debug_printer, gdbm_debug_flags): New externs. (GDBM_DEBUG_ERR,GDBM_DEBUG_OPEN) (GDBM_DEBUG_READ,GDBM_DEBUG_STORE) (GDBM_DEBUG_LOOKUP,GDBM_DEBUG_ALL): New defines. (gdbm_debug_token,gdbm_debug_parse_state) (gdbm_debug_datum): New protos. * src/gdbmdefs.h (GDBM_DEBUG,GDBM_DEBUG_DATUM): New macros. * src/findkey.c: Add debugging info. * src/gdbmfetch.c: Likewise. * src/gdbmopen.c: Likewise. * src/gdbmseq.c: Likewise. * src/gdbmstore.c: Likewise. * src/gdbmtool.c (open_handler): Allow the use of ~/ (command) <repeat,variadic>: New members. (run_command): Handle variadic functions. (run_last_command): New command. In interactive mode, repeats the last command if it was marked with repeat=1 (currently, only "next"). New command: "debug". (all functions): Use terror instead of fprintf(stderr,...); * src/gdbmtool.h (handler_param) <vararg>: New member. (run_last_command): New proto. * src/gram.y: Call run_last_command) on empty input. * tests/gtload.c: New option: -debug=
* Introduce debug hooks.Sergey Poznyakoff2016-07-201-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: New option --enable-debug Print feature summary at the end of the run. * src/debug.c: New file. * src/Makefile.am [GDBM_COND_DEBUG_ENABLE]: Build debug.o Define GDBM_DEBUG_ENABLE. * src/gdbmdefs.h [GDBM_DEBUG_ENABLE] (_gdbm_debug_hook_install) (_gdbm_debug_hook_remove,_gdbm_debug_hook_check) (_gdbm_debug_hook_val): New protos. (GDBM_DEBUG_HOOK, GDBM_DEBUG_OVERRIDE) (GDBM_DEBUG_ALLOC): New defines. * src/gdbm.h.in (GDBM_RCVR_FORCE): New flag. * src/recover.c (gdbm_recover): Check database before attempting recovery, unless GDBM_RCVR_FORCE flag is set. * doc/gdbm.texi: Document GDBM_RCVR_FORCE * src/gdbmreorg.c (gdbm_reorganize): Use GDBM_RCVR_FORCE. * src/gdbmtool.c (main): Always allocate file_name. * src/bucket.c: Put GDBM_DEBUG_OVERRIDE and GDBM_DEBUG_ALLOC in critical places. * src/falloc.c: Likewise. * src/findkey.c: Likewise. * src/gdbmopen.c: Likewise. * src/gdbmstore.c: Likewise. * src/update.c: Likewise. * tests/Makefile.am [GDBM_COND_DEBUG_ENABLE]: Define GDBM_DEBUG_ENABLE. * tests/gtload.c: New options -hook, -recover, -verbose, -backup, -max-failures, -max-failed-keys, and -max-failed-buckets. Attempt recovery after errors.
* Implement gdbm_recover functionSergey Poznyakoff2016-07-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Don't check for rename. * src/Makefile.am (libgdbm_la_SOURCES): Add recover.c * src/recover.c: New file. * src/bucket.c (_gdbm_get_bucket): Remove extra space before [ * src/err.c (prerror): Take additional argument (gdbm_perror): Print system errno if necessary. * src/gdbm.h.in (GDBM_CLOERROR): New flag. (gdbm_fd_open, gdbm_copy_meta): New proto. (gdbm_last_syserr,gdbm_db_strerror,gdbm_recover): New proto. (gdbm_syserr): New extern. (gdbm_recovery): New struct. (GDBM_RCVR_DEFAULT,GDBM_RCVR_ERRFUN) (GDBM_RCVR_MAX_FAILED_KEYS) (GDBM_RCVR_MAX_FAILED_BUCKETS) (GDBM_RCVR_MAX_FAILURES) (GDBM_RCVR_BACKUP): New flags. (GDBM_BACKUP_FAILED): New error code. * src/gdbmclose.c (gdbm_close): Work correctly if dbf->desc == -1. * src/gdbmcount.c (gdbm_count): Remove spurious sorting. Use _gdbm_next_bucket_dir for iterating over the buckets. * src/gdbmdefs.h (struct gdbm_file_info)<last_syserror> <last_errstr>: New members. * src/gdbmerrno.c (gdbm_set_errno): Set last_syserror as well. (gdbm_clear_error): Reset last_syserror. (gdbm_last_syserr): New function. (gdbm_errlist): New entry for GDBM_BACKUP_FAILED. (gdbm_db_strerror): New function. (gdbm_syserr): New global. * src/gdbmload.c (get_parms): Buffer can be NULL. * src/gdbmopen.c (gdbm_fd_open): New function. (gdbm_open): Rewrite as a wrapper over gdbm_fd_open. * src/gdbmreorg.c (gdbm_reorganize): Rewrite as a wrapper over gdbm_recover. * src/proto.h (_gdbm_next_bucket_dir): New proto. * src/gdbmtool.c: New command: recover. * tests/.gitignore: Add gtrecover * tests/gtrecover.c: New test program. * tests/Makefile.am: Build gtrecover
* New gdbm_setopt option to get the actual block size valueSergey Poznyakoff2016-07-151-0/+3
| | | | | | | | | | | | | | | | | | * src/gdbm.h.in (GDBM_GETBLOCKSIZE): New option. * src/gdbmcount.c (gdbm_count): Fix memory leak on error. * src/gdbmsetopt.c (gdbm_setopt): Rewrite. Handle GDBM_GETBLOCKSIZE. * NEWS: Document GDBM_GETBLOCKSIZE * doc/gdbm.texi: Likewise. * tests/gtload.c: New options -bsexact and -verbose. * tests/Makefile.am: Add new testcases. * tests/testsuite.at: Likewise. * tests/blocksize00.at: New testcase. * tests/blocksize01.at: Likewise. * tests/blocksize02.at: Likewise.
* Use AM_CPPFLAGS instead of INCLUDES in MakefilesSergey Poznyakoff2013-05-091-1/+1
|
* Implement cloexec in gdbm_reorganize. Add test cases.Sergey Poznyakoff2011-11-111-1/+12
| | | | | | | | | | | | | | | | | | | | | | | * compat/dbmopen.c: Apply O_CLOEXEC for newly created dir file, if requested. * src/gdbmdefs.h (gdbm_file_info) <cloexec>: New member. * src/gdbmopen.c (gdbm_open): Initialize cloexec member. * src/gdbmreorg.c (gdbm_reorganize): Propagate cloexec bit to the new database. * tests/.cvsignore: Update. * tests/cloexec00.at: New test case. * tests/cloexec01.at: Likewise. * tests/cloexec02.at: Likewise. * tests/cloexec03.at: Likewise. * fdop.c: New auxiliary program. * g_open_ce: New test program. * g_reorg_ce: New test program. * d_creat_ce: New test program. * tests/Makefile.am: Add new test cases and test programs. * tests/testsuite.at: Include new test cases. * doc/gdbm.texinfo: Minor change.
* Fix handling of NDBM databases in read-only mode.Sergey Poznyakoff2011-11-101-0/+3
| | | | | | | | | | * compat/dbmopen.c (ndbm_open_dir_file0): Open dir file in read-only mode if the database is being opened as GDBM_READER. * tests/dbmcvt.at: New file. * tests/dbmfetch02.at: New file. * tests/dbmfetch03.at: New file. * tests/Makefile.am (TESTSUITE_AT): Add new files. * tests/testsuite.at: Include new testcases.
* Bugfixes (pointed out by Matthew Burgess).Sergey Poznyakoff2011-08-121-1/+1
| | | | | * src/gdbmopen.c: Fix a typo. * tests/Makefile.am ($(srcdir)/package.m4): Fix improper dependency.
* Add testcases for gdbm_setopt.Sergey Poznyakoff2011-08-111-0/+4
| | | | | | | | | * tests/gtopt.c: New file * tests/.cvsignore: Update. * tests/setopt00.at: New testcase. * tests/setopt01.at: New testcase. * tests/Makefile.am: Build gtopt. Add setopt00.at and setopt01.at. * tests/testsuite.at: Include setopt00.at and setopt01.at.
* Define AT_PACKAGE_VERSION_MAJOR,Sergey Poznyakoff2011-08-051-0/+3
| | | | AT_PACKAGE_VERSION_MINOR, and AT_PACKAGE_VERSION_PATCH.
* Add new files.Sergey Poznyakoff2011-08-051-2/+20
|
* (check_PROGRAMS): Add gtver.Sergey Poznyakoff2011-08-031-1/+2
|
* Add delete tests.Sergey Poznyakoff2011-08-021-3/+8
|
* Add tests.Sergey Poznyakoff2011-08-021-0/+90