1. 23 Jan, 2017 1 commit
  2. 16 Jan, 2017 1 commit
  3. 10 Jan, 2017 2 commits
  4. 05 Jan, 2017 2 commits
  5. 04 Jan, 2017 1 commit
    • Justus Winter's avatar
      tests,w32: Fix locating the components. · 28e14960
      Justus Winter authored
      * tests/openpgp/defs.scm (percent-decode): New function.
      (bin-prefix): New variable.
      (installed?): Likewise.
      (tool-hardcoded): Use the new variables.
      (gpg-conf): Use the new function to decode the values.
      (gpg-components): Do not use '--build-prefix' when 'installed?'.
      Signed-off-by: 's avatarJustus Winter <justus@g10code.com>
      28e14960
  6. 02 Jan, 2017 4 commits
    • Justus Winter's avatar
      tests: Fix faked time in the TOFU test. · 6d065198
      Justus Winter authored
      * tests/openpgp/tofu.scm (GPG): Fix time delta.
      Signed-off-by: 's avatarJustus Winter <justus@g10code.com>
      6d065198
    • Justus Winter's avatar
      gpgscm: Fail if too many arguments are given. · b0e14bd6
      Justus Winter authored
      * tests/gpgscm/scheme.c (opexe_0): Enable check.
      * tests/gpgscm/tests.scm (test::report): Remove superfluous argument.
      Signed-off-by: 's avatarJustus Winter <justus@g10code.com>
      b0e14bd6
    • Justus Winter's avatar
      gpgscm: Add 'finally', rework all macros. · b79274a3
      Justus Winter authored
      * tests/gpgscm/init.scm (finally): New macro.
      * tests/gpgscm/tests.scm (letfd): Rewrite.
      (with-working-directory): Likewise.
      (with-temporary-working-directory): Likewise.
      (lettmp): Likewise.
      --
      
      Rewrite all our macros using 'define-macro'. Use the new control flow
      mechanism 'finally', or 'dynamic-wind' where appropriate.  Make sure
      the macros are hygienic.  Reduce code duplication.
      Signed-off-by: 's avatarJustus Winter <justus@g10code.com>
      b79274a3
    • Justus Winter's avatar
      gpgscm: Use boxed values for source locations. · e8b84350
      Justus Winter authored
      * tests/gpgscm/scheme-private.h (struct port): Use boxed values for
      filename and current line.  This allows us to use the same Scheme
      object for labeling all expressions in a file.
      * tests/gpgscm/scheme.c (file_push): Use boxed type for filename.
      (mark): Mark location objects of port objects.
      (gc): Mark location objects in the load stack.
      (port_clear_location): New function.
      (port_reset_current_line): Likewise.
      (port_increment_current_line): Likewise.
      (file_pop): Adapt accordingly.
      (port_rep_from_filename): Likewise.
      (port_rep_from_file): Likewise.
      (port_close): Likewise.
      (skipspace): Likewise.
      (token): Likewise.
      (_Error_1): Likewise.
      (opexe_0): Likewise.
      (opexe_5): Likewise.
      (scheme_deinit): Likewise.
      (scheme_load_file): Likewise.
      (scheme_load_named_file): Likewise.
      Signed-off-by: 's avatarJustus Winter <justus@g10code.com>
      e8b84350
  7. 21 Dec, 2016 1 commit
  8. 20 Dec, 2016 4 commits
    • Justus Winter's avatar
      tests: Add test suite for gpgsm. · 36c14139
      Justus Winter authored
      * configure.ac (AC_CONFIG_FILES): Add new file.
      * tests/Makefile.am (SUBDIRS): Add new directory.
      * tests/gpgsm/32100C27173EF6E9C4E9A25D3D69F86D37A4F939: New file.
      * tests/gpgsm/Makefile.am: Likewise.
      * tests/gpgsm/cert_dfn_pca01.der: Likewise.
      * tests/gpgsm/cert_dfn_pca15.der: Likewise.
      * tests/gpgsm/cert_g10code_test1.der: Likewise.
      * tests/gpgsm/decrypt.scm: Likewise.
      * tests/gpgsm/encrypt.scm: Likewise.
      * tests/gpgsm/export.scm: Likewise.
      * tests/gpgsm/gpgsm-defs.scm: Likewise.
      * tests/gpgsm/import.scm: Likewise.
      * tests/gpgsm/plain-1.cms.asc: Likewise.
      * tests/gpgsm/plain-2.cms.asc: Likewise.
      * tests/gpgsm/plain-3.cms.asc: Likewise.
      * tests/gpgsm/plain-large.cms.asc: Likewise.
      * tests/gpgsm/run-tests.scm: Likewise.
      * tests/gpgsm/setup.scm: Likewise.
      * tests/gpgsm/shell.scm: Likewise.
      * tests/gpgsm/sign.scm: Likewise.
      * tests/gpgsm/verify.scm: Likewise.
      --
      The certificates and keys are taken from GPGME's test suite.
      Signed-off-by: 's avatarJustus Winter <justus@g10code.com>
      36c14139
    • Justus Winter's avatar
      tests: Add macro managing ephemeral home directories. · c067a012
      Justus Winter authored
      * tests/openpgp/defs.scm (with-ephemeral-home-directory): New macro.
      * tests/openpgp/setup.scm: Use the new macro.
      c067a012
    • Justus Winter's avatar
      tests: Move argument parser. · a30c0a69
      Justus Winter authored
      * tests/gpgme/gpgme-defs.scm (flag): Move...
      * tests/gpgscm/tests.scm: ... over here.
      Signed-off-by: 's avatarJustus Winter <justus@g10code.com>
      a30c0a69
    • Justus Winter's avatar
      tests: Add missing encrypted sample, cleanup samples handling. · e2ed3c15
      Justus Winter authored
      * tests/openpgp/Makefile.am (TEST_FILES): Add new file.
      * tests/openpgp/defs.scm (plain-files): Add 'plain-large'.
      (all-files): New variable.
      (create-sample-files): New function.
      (create-legacy-gpghome): Use new function.
      * tests/openpgp/plain-large.asc: New file.
      Signed-off-by: 's avatarJustus Winter <justus@g10code.com>
      e2ed3c15
  9. 19 Dec, 2016 7 commits
  10. 15 Dec, 2016 2 commits
  11. 14 Dec, 2016 3 commits
    • Justus Winter's avatar
      tests: Reuse GPGME's tests. · 948cca9c
      Justus Winter authored
      * configure.ac (AC_CONFIG_FILES): Add new Makefile.
      * tests/Makefile.am (SUBDIRS): Add new directory.
      * tests/gpgme/Makefile.am: New file.
      * tests/gpgme/gpgme-defs.scm: Likewise.
      * tests/gpgme/run-tests.scm: Likewise.
      * tests/gpgme/setup.scm: Likewise.
      * tests/gpgme/wrap.scm: Likewise.
      Signed-off-by: 's avatarJustus Winter <justus@g10code.com>
      948cca9c
    • Justus Winter's avatar
      common: Support locating components in the build tree. · ca1e9749
      Justus Winter authored
      * common/homedir.c (gnupg_build_directory): New variable.
      (gnupg_module_name_called): Likewise.
      (gnupg_set_builddir): New function.
      (gnupg_set_builddir_from_env): Likewise.
      (gnupg_module_name): Support locating components in the build tree.
      * common/util.h (gnupg_set_builddir): New prototype.
      * tests/openpgp/defs.scm (tools): Drop 'gpg and 'gpg-agent.
      (tool): Rename to 'tool-hardcoded.
      (gpg-conf): New function, with accessors for the results.
      (gpg-components): New variable.
      (tool): New function.
      * tools/gpgconf.c (enum cmd_and_opt_values): New key.
      (opts): New option '--build-prefix'.
      (main): Handle new option.
      --
      
      This change makes sure that the components from the build tree are
      used, and not some older installed version in PATH.  It also lets us
      make GPGME use components from the build tree, making it possible to
      execute GPGME's test suite with them.
      Signed-off-by: 's avatarJustus Winter <justus@g10code.com>
      ca1e9749
    • Justus Winter's avatar
      tests: Rework check for trust models. · 55dc8112
      Justus Winter authored
      * tests/openpgp/defs.scm (gpg-has-option?): New function.
      (have-opt-always-trust): Use a simpler test for that option.  This way
      that is less distracting when we run the tests with verbose=3.
      Signed-off-by: 's avatarJustus Winter <justus@g10code.com>
      55dc8112
  12. 13 Dec, 2016 8 commits
  13. 09 Dec, 2016 2 commits
  14. 08 Dec, 2016 2 commits
    • Justus Winter's avatar
      gpgscm: Better error reporting. · e7429b1c
      Justus Winter authored
      * 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: 's avatarJustus Winter <justus@g10code.com>
      e7429b1c
    • Justus Winter's avatar
      gpgscm: Keep a history of calls for error messages. · 404e8a41
      Justus Winter authored
      * tests/gpgscm/init.scm (vm-history-print): New function.
      * tests/gpgscm/opdefines.h: New opcodes 'CALLSTACK_POP', 'APPLY_CODE',
      and 'VM_HISTORY'.
      * tests/gpgscm/scheme-private.h (struct history): New definition.
      (struct scheme): New field 'history'.
      * tests/gpgscm/scheme.c (gc): Mark objects in the history.
      (history_free): New function.
      (history_init): Likewise.
      (history_mark): Likewise.
      (add_mod): New macro.
      (sub_mod): Likewise.
      (tailstack_clear): New function.
      (callstack_pop): Likewise.
      (callstack_push): Likewise.
      (tailstack_push): Likewise.
      (tailstack_flatten): Likewise.
      (callstack_flatten): Likewise.
      (history_flatten): Likewise.
      (opexe_0): New variable 'callsite', keep track of the expression if it
      is a call, implement the new opcodes, record function applications in
      the history.
      (opexe_6): Implement new opcode.
      (scheme_init_custom_alloc): Initialize history.
      (scheme_deinit): Free history.
      * tests/gpgscm/scheme.h (USE_HISTORY): New macro.
      --
      
      This patch makes TinySCHEME keep a history of function calls.  This
      history can be used to produce helpful error messages.  The history
      data structure is inspired by MIT/GNU Scheme.
      Signed-off-by: 's avatarJustus Winter <justus@g10code.com>
      
      fu history
      404e8a41