aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gpgscm/ffi.scm (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gpgscm: Improve error handling of foreign functions.Justus Winter2017-06-191-2/+1
| | | | | | | * tests/gpgscm/ffi.scm (ffi-fail): Do not needlessly join the error message. Signed-off-by: Justus Winter <[email protected]>
* tests: Check expiration times of created keys.Justus Winter2017-02-151-0/+3
| | | | | | | | | | | | * tests/gpgscm/ffi.c (do_get_time): New function. (ffi_init): Expose new function. * tests/gpgscm/ffi.scm (get-time): Document new function. * tests/gpgscm/time.scm: New file. * tests/openpgp/quick-key-manipulation.scm: Use the new facilities to check the expiration times of created keys. * tests/openpgp/tofu.scm: Use the new module. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Better error reporting.Justus Winter2016-12-081-36/+0
| | | | | | | | | | | | | | | | | | | | * tests/gpgscm/ffi.scm: Move the customized exception handling and atexit logic... * tests/gpgscm/init.scm: ... here. (throw): Record the current history. (throw'): New function that is history-aware. (rethrow): New function. (*error-hook*): Use the new throw'. * tests/gpgscm/main.c (load): Fix error handling. (main): Save and use the 'sc->retcode' as exit code. * tests/gpgscm/repl.scm (repl): Print call history. * tests/gpgscm/scheme.c (_Error_1): Make a snapshot of the history, use it to provide a accurate location of the expression causing the error at runtime, and hand the history trace to the '*error-hook*'. (opexe_5): Tag all lists at parse time with the current location. * tests/gpgscm/tests.scm: Update calls to 'throw', use 'rethrow'. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix installation of error handler.Justus Winter2016-11-221-0/+1
| | | | | | | * tests/gpgscm/ffi.scm: Set '*error-hook*' again so that the interpreter will use our function. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Implement 'atexit'.Justus Winter2016-11-041-0/+18
| | | | | | | | | | | | * tests/gpgscm/ffi.scm (throw): Run *run-atexit-handlers* when terminating the interpreter. (*atexit-handlers*): New variable. (*run-atexit-handlers*): New function. (atexit): Likewise. * tests/gpgscm/main.c (main): Run *run-atexit-handlers* at normal interpreter shutdown. Signed-off-by: Justus Winter <[email protected]>
* tests: Implement interpreter shutdown using exceptions.Justus Winter2016-09-191-0/+22
| | | | | | | | | | | * tests/gpgscm/ffi.c (ffi_init): Rename 'exit' to '_exit'. * tests/gpgscm/ffi.scm (*interpreter-exit*): New variable. (throw): New function. (exit): New function. -- This allows a proper cleanup of resources. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Use native string searching functions.Justus Winter2016-06-211-0/+4
| | | | | | | | | | | | | | | | | * 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]>
* tests/gpgscm: Add a TinySCHEME-based test driver.Justus Winter2016-06-171-0/+40
* 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]>