aboutsummaryrefslogtreecommitdiffstats
path: root/gpgscm/lib.scm (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-10-05gpgscm: Change license from GPLv3+ to LGPLv2.1+Werner Koch1-12/+11
-- All changes to TinySCHEME were done by employees of g10 Code GmbH and some minor things by a contractor. Signed-off-by: Werner Koch <[email protected]>
2017-10-05gpgscm: Move files to a gpgscm subdirectory.Werner Koch1-0/+0
-- Note that we used git filter-branch --subdirectory-filter tests/gpgscm in gnupg master to filter out the gpgscm part. This commit merely moves these files to a subdirectory which will be used in libgpg-error for gpgscm. Signed-off-by: Werner Koch <[email protected]>
2017-04-24gpgscm: Emit JUnit-style XML reports.Justus Winter1-0/+7
* tests/gpgscm/Makefile.am (EXTRA_DIST): Add new file. * tests/gpgscm/lib.scm (string-translate): New function. * tests/gpgscm/main.c (main): Load new file. * tests/gpgscm/tests.scm (dirname): New function. (test-pool): Record execution times, emit XML report. (test): Record execution times, record log file name, emit XML report. (run-tests-parallel): Write XML report. (run-tests-sequential): Likewise. * tests/gpgscm/xml.scm: New file. * tests/gpgme/Makefile.am (CLEANFILES): Add 'report.xml'. * tests/gpgsm/Makefile.am: Likewise. * tests/migrations/Makefile.am: Likewise. * tests/openpgp/Makefile.am: Likewise. Signed-off-by: Justus Winter <[email protected]>
2017-04-24gpgscm: Move 'trace' and 'stringify'.Justus Winter1-0/+12
* tests/gpgscm/tests.scm (trace, stringify): Move... * tests/gpgscm/lib.scm: ... here. Signed-off-by: Justus Winter <[email protected]>
2017-04-10gpgscm: Add and use opcode for reversing a list in place.Justus Winter1-4/+4
* tests/gpgscm/lib.scm (string-split-pln): Use 'reverse!'. (string-rtrim): Likewise. * tests/gpgscm/opdefines.h (reverse!): New opcode. * tests/gpgscm/scheme.c (opexe_0): Handle new opcode. Signed-off-by: Justus Winter <[email protected]>
2017-02-17gpgscm: Guard use of tagged expressions.Justus Winter1-1/+1
* tests/gpgscm/init.scm (vm-history-print): Check that the tag added to expressions when parsing source files matches the expected format. * tests/gpgscm/lib.scm (assert): Likewise. -- This makes the error handling more robust. We saw the assumption about the format of the tags being violated on one build system, and it obscured the view on the underlying problem. Signed-off-by: Justus Winter <[email protected]>
2016-12-19gpgscm: Display location when assertions fail.Justus Winter1-6/+9
* tests/gpgscm/lib.scm (assert): Use location information if available. Signed-off-by: Justus Winter <[email protected]>
2016-12-13gpgscm: Improve library functions.Justus Winter1-25/+76
* tests/gpgscm/tests.scm (absolute-path?): New function. (canonical-path): Use the new function. * tests/gpgscm/lib.scm (string-split-pln): New function. (string-indexp, string-splitp): Likewise. (string-splitn): Express using the above function. (string-ltrim, string-rtrim): Fix corner case. (list->string-reversed): New function. (read-line): Fix performance. Signed-off-by: Justus Winter <[email protected]>
2016-11-08gpgscm: Expose seek and associated constants.Justus Winter1-0/+8
* 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]>
2016-11-07gpgscm: Generalize splice to write to multiple sinks.Justus Winter1-2/+3
* 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]>
2016-11-07gpgscm: Drop 'len' argument from splice.Justus Winter1-0/+3
* 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]>
2016-11-07gpgscm,w32: Provide schemish file handling for binary files.Justus Winter1-0/+14
* tests/gpgscm/lib.scm (call-with-binary-input-file): New function. (call-with-binary-output-file): Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-11-07gpgscm: Add support for pseudo-random numbers.Justus Winter1-0/+21
* 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]>
2016-11-03gpgscm,tests: Add new functions to the test environment.Justus Winter1-0/+18
* tests/gpgscm/lib.scm (first, last, powerset): New functions. * tests/gpgscm/tests.scm (interactive-shell): New function. * tests/openpgp/Makefile.am (EXTRA_DIST): Add new file. * tests/openpgp/README: Document 'interactive-shell'. * tests/openpgp/shell.scm: New file. Signed-off-by: Justus Winter <[email protected]>
2016-10-07tests: Improve handling of Windows newlines.Justus Winter1-0/+9
* tests/gpgscm/lib.scm (string-split-newlines): New function. * tests/openpgp/default-key.scm: Use new function. * tests/openpgp/defs.scm: Likewise. * tests/openpgp/export.scm: Likewise. * tests/openpgp/import.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-07-21gpgscm: Make assert macro more accurate.Justus Winter1-1/+2
* tests/gpgscm/lib.scm (assert): Print the representation of the failed expression. Signed-off-by: Justus Winter <[email protected]>
2016-06-21gpgscm: Improve test framework.Justus Winter1-4/+0
* 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]>
2016-06-21gpgscm: Use native string searching functions.Justus Winter1-43/+43
* 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]>
2016-06-17tests/gpgscm: Add a TinySCHEME-based test driver.Justus Winter1-0/+163
* 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]>