aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gpgscm/ffi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* build: New configure option --enable-all-tests.Werner Koch2017-08-081-0/+8
| | | | | | | | | | | | | | | * configure.ac: New option --enable-all-tests. * tests/gpgscm/ffi.c (ffi_init): New gloabl var *run-all-tests*. * tests/openpgp/all-tests.scm (all-tests): Use that var instead of *maintainer-mode*. * Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Add --enable-all-tests. -- It is better to have a separate option to run all tests than to put this on top of --enable-maintainer-mode. This way we can also make sure to run all tests during "make distcheck". Signed-off-by: Werner Koch <[email protected]>
* tests: Do not run all tests unless in maintainer mode.Justus Winter2017-08-071-0/+8
| | | | | | | | | | | | | * configure.ac: Leak the maintainer mode flag into 'config.h'. * tests/gpgscm/ffi.c: Pass it into the scheme environment. * tests/openpgp/all-tests.scm: Only run tests against non-default configurations (keyring, extended-key-format) in maintainer mode. -- Werner is concerned that the tests do take up too much time and asked me to reduce the runtime of the tests for normal users. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Limit the number of parallel jobs.Justus Winter2017-06-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | * ffi.c (do_wait_processes): Suppress the timeout error. * tests.scm (semaphore): New definition. (test-pool): Only run a bounded number of tests in parallel. (test::started?): New function. (run-tests-parallel): Do not report results, do not start the tests. (run-tests-sequential): Adapt. (run-tests): Parse the number of parallel jobs. -- This change limits the number of tests that are run in parallel. This way we do not overwhelm the operating systems' scheduler. As a side-effect, we also get more accurate runtime information, and it will be easy to implement timeouts on top of this. Use TESTFLAGS to limit the number of jobs: $ make check-all TESTFLAGS=--parallel=16 Signed-off-by: Justus Winter <[email protected]>
* tests,w32: Use GetTempPath to get the path for temporary files.Justus Winter2017-03-211-0/+19
| | | | | | | | | * tests/gpgscm/ffi.c (do_get_temp_path): New function. (ffi_init): Make function available. * tests/gpgscm/tests.scm (mkdtemp): Use the new function. Fixes-commit: 06f1f163e96f1039304fd3cf565cf9de1ca45849 Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix creation of temporary directories.Justus Winter2017-03-061-1/+6
| | | | | | | * tests/gpgscm/ffi.c (do_mkdtemp): Use a larger buffer for the template. Signed-off-by: Justus Winter <[email protected]>
* tests: Check expiration times of created keys.Justus Winter2017-02-151-0/+9
| | | | | | | | | | | | * 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: Expose seek and associated constants.Justus Winter2016-11-081-0/+19
| | | | | | | | * tests/gpgscm/ffi.c (do_seek): New function. (ffi_init): Expose 'seek' and 'SEEK_{SET,CUR,END}'. * tests/gpgscm/lib.scm: Document the new function. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix error message.Justus Winter2016-11-081-18/+21
| | | | | | | * tests/gpgscm/ffi.c (do_wait_processes): Fix and improve error messages. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Generalize splice to write to multiple sinks.Justus Winter2016-11-071-5/+39
| | | | | | | | * tests/gpgscm/ffi.c (ordinal_suffix): New function. (do_splice): Generalize splice to write to multiple sinks. * tests/gpgscm/lib.scm (splice): Document this fact. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Drop 'len' argument from splice.Justus Winter2016-11-071-11/+2
| | | | | | | * tests/gpgscm/ffi.c (do_splice): Drop 'len' argument, no-one uses it. * tests/gpgscm/lib.scm (splice): Document foreign function. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Add support for pseudo-random numbers.Justus Winter2016-11-071-0/+73
| | | | | | | | | | | | * tests/gpgscm/ffi.c (do_getpid): New function. (do_srandom): Likewise. (random_scaled): Likewise. (do_random): Likewise. (do_make_random_string): Likewise. (ffi_init): Expose the new functions. * tests/gpgscm/lib.scm: Document the new functions. Signed-off-by: Justus Winter <[email protected]>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* gpgscm: Fix inclusion of readline header.Justus Winter2016-11-021-0/+1
| | | | | | | | * tests/gpgscm/ffi.c: Define magic macro to prevent the completion function from redefined. GnuPG-bug-id: 2824 Signed-off-by: Justus Winter <[email protected]>
* common,w32: Fix setting environment variables on Windows.Justus Winter2016-10-201-1/+3
| | | | | | | | | * common/sysutils.c (gnupg_setenv): Also update the environment block maintained by the C runtime. (gnupg_unsetenv): Likewise. * tests/gpgscm/ffi.c (do_setenv): Fix error handling. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Improve path handling.Justus Winter2016-10-071-0/+9
| | | | | | | | | * tests/gpgscm/ffi.c (ffi_init): New Scheme variable '*win32*'. * tests/gpgscm/tests.scm (canonical-path): Correctly handle paths with drive letter on Windows. Use 'path-join'. (path-expand): Use 'path-join'. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Update callsite of 'gnupg_spawn_process'.Justus Winter2016-10-061-1/+1
| | | | | | | | | * tests/gpgscm/ffi.c (do_spawn_process): Adapt to the changes to 'gnupg_spawn_process'. Fixes-commit: 44a32455 Fixes-commit: 96c7901e Signed-off-by: Justus Winter <[email protected]>
* tests,w32: Do not expose 'glob' to gpgscm.Justus Winter2016-10-041-38/+0
| | | | | | | | | | * tests/gpgscm/ffi.c (do_glob): Remove function. (ffi_init): Likewise. -- 'glob' is not available on mingw, and portability is the whole point of gpgscm. Signed-off-by: Justus Winter <[email protected]>
* tests: Implement interpreter shutdown using exceptions.Justus Winter2016-09-191-1/+1
| | | | | | | | | | | * 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]>
* tests: Use descriptive temporary file names.Justus Winter2016-09-191-1/+14
| | | | | | | | | | | | * 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]>
* tests: Improve temporary directory handling.Justus Winter2016-08-101-1/+1
| | | | | | | | | | | | * 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 verbose setting more useful.Justus Winter2016-07-261-1/+26
| | | | | | | | | | | | | * 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: 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: 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 memory leaks.Justus Winter2016-06-281-1/+4
| | | | | | | | | | | | | * 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: Add more file handling functions.Justus Winter2016-06-211-0/+38
| | | | | | | | * 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: Use native string searching functions.Justus Winter2016-06-211-0/+69
| | | | | | | | | | | | | | | | | * 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/+1167
* 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]>