aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gpgscm (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* tests: Correctly handle exceptions in resource handling macros.Justus Winter2016-09-191-4/+13
| | | | | | | | | | * tests/gpgscm/tests.scm (letfd): Correctly release resources when an exception is thrown. (with-working-directory): Likewise. (with-temporary-working-directory): Likewise. (lettmp): Likewise. Signed-off-by: Justus Winter <[email protected]>
* tests: Refine exception handling.Justus Winter2016-09-192-6/+6
| | | | | | | | | | * tests/gpgscm/init.scm (catch): Bind all arguments to '*error*' in the error handler, update and fix comment. (*error-hook*): Revert to original definition. * tests/gpgscm/tests.scm (tr:do): Adapt accordingly. * tests/openpgp/issue2419.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>
* tests: Use descriptive temporary file names.Justus Winter2016-09-194-4/+21
| | | | | | | | | | | | * tests/gpgscm/ffi.c (do_get_isotime): New function. (ffi_init): Add parameter 'scriptname', bind new function and scriptname. * tests/gpgscm/ffi.h (ffi_init): Update prototype. * tests/gpgscm/main.c (main): Hand in the script name. * tests/gpgscm/tests.scm (mkdtemp): Use current time and script name for the names of temporary directories. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix gcrypt version check.Werner Koch2016-09-191-1/+1
| | | | | | | * tests/gpgscm/main.c (main): Check against required and not installed version. Signed-off-by: Werner Koch <[email protected]>
* Fix more spellingDaniel Kahn Gillmor2016-09-172-2/+2
| | | | | | | | | | | | | | | | | | | * NEWS, acinclude.m4, agent/command-ssh.c, agent/command.c, agent/gpg-agent.c, agent/keyformat.txt, agent/protect-tool.c, common/asshelp.c, common/b64enc.c, common/recsel.c, doc/DETAILS, doc/HACKING, doc/Notes, doc/TRANSLATE, doc/dirmngr.texi, doc/faq.org, doc/gpg-agent.texi, doc/gpg.texi, doc/gpgsm.texi, doc/instguide.texi, g10/armor.c, g10/gpg.c, g10/keyedit.c, g10/mainproc.c, g10/pkclist.c, g10/tofu.c, g13/sh-cmd.c, g13/sh-dmcrypt.c, kbx/keybox-init.c, m4/pkg.m4, sm/call-dirmngr.c, sm/gpgsm.c, tests/Makefile.am, tests/gpgscm/Manual.txt, tests/gpgscm/scheme.c, tests/openpgp/gpgv-forged-keyring.scm, tests/openpgp/multisig.test, tests/openpgp/verify.scm, tests/pkits/README, tools/applygnupgdefaults, tools/gpg-connect-agent.c, tools/mime-maker.c, tools/mime-parser.c: minor spelling cleanup. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* tests/gpgscm: Fix use of pointer.NIIBE Yutaka2016-09-152-4/+4
| | | | | | | | | | | | | | | | | * tests/gpgscm/scheme-private.h (struct scheme): Use (void *) for alloc_seg. * tests/gpgscm/scheme.c (alloc_cellseg): Use (void *) for cp. Use (void *) for coercion of address calculation. -- In old C language, (char *) means an address. In modern C, it's specifically an address with alignment=1. It's good to use (void *) for an address, because newer compiler emits warnings. Note: in this particular case, it is just a warning and the code is safe against invalid alignment, though. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgscm: Fix detection of unbalanced parenthesis.Justus Winter2016-09-062-0/+9
| | | | | | | | * tests/gpgscm/main.c (load): Print error message. * tests/gpgscm/scheme.c (opexe_0): Correctly report nesting level when loading files. Signed-off-by: Justus Winter <[email protected]>
* Call log_set_prefix() with human-readable labels.Daniel Kahn Gillmor2016-08-121-1/+1
| | | | | | | | | | | | | | | | | | * agent/preset-passphrase.c, agent/protect-tool.c, dirmngr/dirmngr.c * dirmngr/t-http.c, g10/gpg.c, g10/gpgv.c, g13/g13-syshelp.c * g13/g13.c, kbx/kbxutil.c, scd/scdaemon.c, sm/gpgsm.c * tests/gpgscm/main.c, tools/gpg-check-pattern.c * tools/gpg-connect-agent.c, tools/gpgconf.c, tools/gpgtar.c * tools/symcryptrun.c: Invoke log_set_prefix() with human-readable labels. -- Some invocations of log_set_prefix() were done with raw numeric values instead of values that humans can understand. Use symbolic representations instead of numeric for better readability. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* tests: Improve temporary directory handling.Justus Winter2016-08-102-3/+12
| | | | | | | | | | | | * tests/gpgscm/ffi.c (ffi_init): Rename 'mkdtemp'. * tests/gpgscm/tests.scm (mkdtemp): New function that uses a sensible location and template if no arguments are given. (with-temporary-working-directory): Simplify accordingly. (make-temporary-file): Likewise. * tests/openpgp/run-tests.scm (run-tests-parallel-isolated): Likewise. (run-tests-sequential-isolated): Likewise. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Make the name of foreign functions more unique.Justus Winter2016-08-101-1/+1
| | | | | | | * tests/gpgscm/ffi-private.h (ffi_define_function_name): Add another underscore. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Do not shadow common function name in catch macro.Justus Winter2016-07-261-2/+2
| | | | | | * tests/gpgscm/init.scm (catch): Do not shadow 'exit'. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Make the verbose setting more useful.Justus Winter2016-07-262-4/+34
| | | | | | | | | | | | | * tests/gpgscm/ffi.c (do_get_verbose): New function. (do_set_verbose): Likewise. (ffi_init): Turn *verbose* into a function, add *set-verbose!*. * tests/gpgscm/tests.scm (call): Adapt accordingly. (call-with-io): Dump output if *verbose* is high. (pipe-do): Adapt accordingly. * tests/openpgp/defs.scm: Set verbosity according to environment. * tests/openpgp/run-tests.scm (test): Adapt accordingly. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Make function more general.Justus Winter2016-07-221-2/+2
| | | | | | * tests/gpgscm/tests.scm (in-srcdir): Accept more path fragments. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Make assert macro more accurate.Justus Winter2016-07-211-1/+2
| | | | | | | * tests/gpgscm/lib.scm (assert): Print the representation of the failed expression. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Make error message more useful.Justus Winter2016-07-211-1/+1
| | | | | | | * tests/gpgscm/scheme.c (opexe_0): Include names of missing function parameters in the error message. Signed-off-by: Justus Winter <[email protected]>
* tests: Add test for ssh support.Justus Winter2016-07-191-3/+11
| | | | | | | | | | | | | | | | * tests/gpgscm/tests.scm (path-expand): New function. * tests/openpgp/Makefile.am (TESTS): Add new test. (sample_keys): Add new keys. (CLEANFILES): Clean ssh socket and control file. * tests/openpgp/fake-pinentry.c (main): Add a default passphrase. * tests/openpgp/gpg-agent.conf.tmpl: Enable ssh support. * tests/openpgp/samplekeys/ssh-dsa.key: New file. * tests/openpgp/samplekeys/ssh-ecdsa.key: Likewise. * tests/openpgp/samplekeys/ssh-ed25519.key: Likewise. * tests/openpgp/samplekeys/ssh-rsa.key: Likewise. * tests/openpgp/ssh.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix linking.Justus Winter2016-07-151-1/+1
| | | | | | * tests/gpgscm/Makefile.am: Add -lintl. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Use kludge to avoid improper use of ffi_schemify_name.Werner Koch2016-07-141-3/+7
| | | | | | | * tests/gpgscm/ffi.c (ffi_schemify_name): Use xstrdup instead of strdup for now. Signed-off-by: Werner Koch <[email protected]>
* gpgscm: Capture output of spawned processes.Justus Winter2016-07-071-3/+6
| | | | | | | | | * tests/gpgscm/tests.scm (call-check): Capture stdout and stderr, and return stdout if the child exited successfully, or include stderr in the error. * tests/openpgp/version.scm: Demonstrate this by checking the stdout. Signed-off-by: Justus Winter <[email protected]>
* tests: Honor environment variable 'TMP'.Justus Winter2016-07-051-4/+16
| | | | | | | | | | | | | | This fixes problems with long socket names, e.g. when doing distcheck. * tests/gpgscm/tests.scm (path-join): New function. (with-temporary-working-directory): Honor 'TMP'. (make-temporary-file): Likewise. * tests/migrations/Makefile.am (TMP): Default to '/tmp'. (TESTS_ENVIRONMENT): Set 'TMP'. * tests/openpgp/Makefile.am (TMP): Default to '/tmp'. (TESTS_ENVIRONMENT): Set 'TMP'. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Improve robustness and compatibility.Justus Winter2016-07-051-2/+8
| | | | | | | * tests/gpgscm/ffi.c (do_getenv): Avoid gccism. (do_mkdtemp): Handle errors. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix reallocating string ports.Justus Winter2016-06-301-1/+2
| | | | | | | * tests/gpgscm/scheme.c (realloc_port_string): Use memcpy because Scheme strings may contain 0s. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Free memory backing string ports.Justus Winter2016-06-301-0/+2
| | | | | | | * tests/gpgscm/scheme.c (finalize_cell): Free memory backing string ports. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Use the allocator from libgcrypt.Justus Winter2016-06-301-1/+2
| | | | | | * tests/gpgscm/main.c (main): Use the allocator from libgcrypt. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix memory leaks.Justus Winter2016-06-283-14/+32
| | | | | | | | | | | | | * tests/gpgscm/ffi-private.h (ffi_schemify_name): Fix prototype. (ffi_define_function_name): Free schemified name. (ffi_define_function): Likewise. (ffi_define_constant): Likewise. (ffi_define_variable_pointer): Likewise. * tests/gpgscm/ffi.c (do_wait_processes): Free arrays. (ffi_schemify_name): Fix type. * tests/gpgscm/main.c (main): Free 'sc'. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Free file names.Justus Winter2016-06-281-0/+5
| | | | | | * tests/gpgscm/scheme.c (scheme_load_named_file): Free file name. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix buffer overflow.Justus Winter2016-06-281-1/+2
| | | | | | | * tests/gpgscm/scheme.c (store_string): Avoid writing past allocated buffer. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Handle exceptions in the transformation monad.Justus Winter2016-06-231-13/+23
| | | | | | | | | | * tests/gpgscm/tests.scm (pipe:do): Raise errors. (tr:spawn): Catch and return errors. (tr:call-with-content): Likewise. (tr:{open,write-to,pipe-do,assert-identity,assert-weak-identity}): Adapt. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Add types for special objects.Justus Winter2016-06-231-6/+14
| | | | | | | | | * tests/gpgscm/scheme.c (enum scheme_types): Add types for boolean, nil, eof, and the sink object. (type_to_string): Handle new types. (scheme_init_custom_alloc): Give special objects a type. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix Scheme initialization.Justus Winter2016-06-231-0/+3
| | | | | | | | | | This potentially causes a crash if the garbage collector marks an eof object. * tests/gpgscm/scheme.c (scheme_init_custom_alloc): Initialize 'EOF_OBJ'. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix manual.Justus Winter2016-06-231-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Add more file handling functions.Justus Winter2016-06-212-0/+44
| | | | | | | | * tests/gpgscm/ffi.c (do_glob): New function. (ffi_init): Define new function. * tests/gpgscm/tests.scm (basename-suffix): New function.x Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Improve test framework.Justus Winter2016-06-212-13/+19
| | | | | | | | | | | * tests/gpgscm/lib.scm (echo): Move... * tests/gpgscm/tests.scm (echo): ... here. (info, error, skip): And use echo here. (file-exists?): New function. (tr:spawn): Check that source exists and if the sink has been created. (tr:call-with-content): Hand in optional arguments. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Use native string searching functions.Justus Winter2016-06-214-43/+118
| | | | | | | | | | | | | | | | | * tests/gpgscm/ffi-private.h: Handle character arguments. * tests/gpgscm/ffi.c (do_string_index): New function. (do_string_rindex): Likewise. (do_string_contains): Likewise. (ffi_init): Define new functions. * tests/gpgscm/ffi.scm (ffi-define): New macro. * tests/gpgscm/lib.scm (string-index): Use native function, demonstrate behavior. (string-rindex): Likewise. (string-contains?): Likewise. Demonstrate behavior of various other functions. (read-all): Rework so that it can handle large files. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Improve error reporting.Justus Winter2016-06-211-2/+27
| | | | | | | * tests/gpgscm/scheme.c (type_to_string): New function. (Eval_Cycle): Include actual type in error message. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Make memory allocation failures fatal.Justus Winter2016-06-211-1/+1
| | | | | | * tests/gpgscm/scheme.c (Eval_Cycle): Exit if we run out of memory. Signed-off-by: Justus Winter <[email protected]>
* tests: Make make distcheck work again.Werner Koch2016-06-171-3/+5
| | | | | | | | | | | | | | | * Makefile.am (tests): Remove test code which would led to doubling calls to for e.g. "make distclean". * tests/Makefile.am: Typo fixes. * tests/gpgscm/Makefile.am (EXTRA_DIST): Fix name of License file. Add repl.scm. (check): Replace by check-local because check is a standard automake target. * tests/openpgp/Makefile.am (TESTS_ENVIRONMENT): Replace gmake0sim by automake generated macro. (EXTRA_DIST): Add defs.scm Signed-off-by: Werner Koch <[email protected]>
* gpgscm: Silence compiler warnings.Werner Koch2016-06-171-7/+12
| | | | | | | | | | | * tests/gpgscm/scheme.c (mk_integer): Rename arg NUM to N. (fill_vector): Ditto. (mark): Rename var NUM to N. (set_slot_in_env): Mark SC as unused. (is_any): Mark P as unused. -- Signed-off-by: Werner Koch <[email protected]>
* Add license notices for TinySCHEME.Werner Koch2016-06-171-0/+0
| | | | | | | | | | | | | * tests/gpgscm/COPYING: Rename to ... * tests/gpgscm/LICENSE.TinySCHEME: this. * AUTHORS: Add a note about TinySCHEME. * build-aux/speedo/w32/pkg-copyright.txt: Add TinySCHEME notice. -- I renamed the file with the license terms to avoid confusion with the standard name for the GPL. Signed-off-by: Werner Koch <[email protected]>
* tests/gpgscm: Add a TinySCHEME-based test driver.Justus Winter2016-06-1713-0/+2548
| | | | | | | | | | | | | | | | | | | | * configure.ac: Add new component. * tests/Makefile.am: Likewise. * tests/gpgscm/Makefile.am: New file. * tests/gpgscm/ffi-private.h: Likewise. * tests/gpgscm/ffi.c: Likewise. * tests/gpgscm/ffi.h: Likewise. * tests/gpgscm/ffi.scm: Likewise. * tests/gpgscm/lib.scm: Likewise. * tests/gpgscm/main.c: Likewise. * tests/gpgscm/private.h: Likewise. * tests/gpgscm/repl.scm: Likewise. * tests/gpgscm/scheme-config.h: Likewise. * tests/gpgscm/t-child.c: Likewise. * tests/gpgscm/t-child.scm: Likewise. * tests/gpgscm/tests.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Foreign objects support for TinySCHEME.Justus Winter2016-06-173-1/+45
| | | | | | | | | | | | | | | | | | | | | * tests/gpgscm/scheme-private.h (struct cell): Add 'foreign_object'. (is_foreign_object): New prototype. (get_foreign_object_{vtable,data}): Likewise. * tests/gpgscm/scheme.c (enum scheme_types): New type. (is_foreign_object): New function. (get_foreign_object_{vtable,data}): Likewise. (mk_foreign_object): Likewise. (finalize_cell): Free foreign objects. (atom2str): Pretty-print foreign objects. (vtbl): Add new functions. * tests/gpgscm/scheme.h (struct foreign_object_vtable): New type. (mk_foreign_object): New prototype. (struct scheme_interface): Add new functions. Patch from Thomas Munro, https://sourceforge.net/p/tinyscheme/patches/13/ Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Dynamically allocate string buffer.Justus Winter2016-06-172-4/+34
| | | | | | | | | | | | | | * tests/gpgscm/scheme-config.h (strbuff{,_size}): Make buffer dynamic. * tests/gpgscm/scheme.c (expand_strbuff): New function. (putcharacter): Adapt length test. (readstrexp): Expand buffer if necessary. (scheme_init_custom_alloc): Initialize buffer. (scheme_deinit): Free buffer. Patch from Thomas Munro, https://sourceforge.net/p/tinyscheme/patches/11/ Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Make exception value available.Justus Winter2016-06-171-4/+5
| | | | | * tests/gpgscm/init.scm (throw): Hand exception value to the handler. (catch): And bind it to *error*.
* tests/gpgscm: Add package macro.Justus Winter2016-06-171-0/+5
| | | | | | * tests/gpgscm/init.scm: Add package macro from manual. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Expose function to open streams as Scheme ports.Justus Winter2016-06-172-1/+3
| | | | | | | | * tests/gpgscm/scheme.c (vtbl): Add 'port_from_file' to the vtable. * tests/gpgscm/scheme.h (struct scheme_interface): New field 'mk_port_from_file'. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Nicer error message.Justus Winter2016-06-171-1/+1
| | | | | | | * tests/gpgscm/scheme.c (opexe_0): Include the value that we tried to evaluate as function-like in the error message. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Fix error hook.Justus Winter2016-06-171-1/+2
| | | | | | | * tests/gpgscm/init.scm (*error-hook*): Fix error hook so that the whole error message is displayed. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Handle unhandled enumeration values.Justus Winter2016-06-171-0/+6
| | | | | | | * tests/gpgscm/scheme.c (opexe_{3,4}): Handle unhandled enumeration values in the opcode dispatching code. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Verbatim import of latest TinySCHEME.Justus Winter2016-06-177-0/+6917
Revision 110 from svn://svn.code.sf.net/p/tinyscheme/code/trunk * tests/gpgscm/COPYING: New file. * tests/gpgscm/Manual.txt: Likewise. * tests/gpgscm/init.scm: Likewise. * tests/gpgscm/opdefines.h: Likewise. * tests/gpgscm/scheme-private.h: Likewise. * tests/gpgscm/scheme.c: Likewise. * tests/gpgscm/scheme.h: Likewise. Signed-off-by: Justus Winter <[email protected]>