diff options
author | Justus Winter <[email protected]> | 2017-07-14 10:59:00 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2017-07-14 10:59:00 +0000 |
commit | 58eafd11ed5501c0b72fcb553eb3e097ad29b3c6 (patch) | |
tree | 5d1a989cd7ecfeee8fc92a87d216e1d7076b5010 /tests/openpgp/shell.scm | |
parent | gpgscm: Library improvements. (diff) | |
download | gnupg-58eafd11ed5501c0b72fcb553eb3e097ad29b3c6.tar.gz gnupg-58eafd11ed5501c0b72fcb553eb3e097ad29b3c6.zip |
tests: Improve 'shell.scm' script.
* tests/openpgp/defs.scm (create-file): Unlink file first.
* tests/openpgp/shell.scm: Ask whether to import legacy test keys or
not, and whether to drop 'batch' from the configuration. Add paths to
all the programs to 'PATH'.
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to '')
-rw-r--r-- | tests/openpgp/shell.scm | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/tests/openpgp/shell.scm b/tests/openpgp/shell.scm index bd6059a86..347b3a08c 100644 --- a/tests/openpgp/shell.scm +++ b/tests/openpgp/shell.scm @@ -18,7 +18,6 @@ ;; along with this program; if not, see <http://www.gnu.org/licenses/>. (load (in-srcdir "tests" "openpgp" "defs.scm")) -(setup-environment) ;; This is not a test, but can be used to inspect the test ;; environment. Simply execute @@ -27,7 +26,28 @@ ;; ;; to run it. -(echo "Note that gpg.conf includes 'batch'. If you want to use gpg") -(echo "interactively you should drop that.") -(echo) +(if (prompt-yes-no? "Load legacy test environment" #t) + (setup-legacy-environment) + (setup-environment)) + +(if (prompt-yes-no? "Drop 'batch' from gpg.conf" #t) + (apply create-file + (cons "gpg.conf" + (filter (lambda (line) (not (equal? "batch" line))) + (string-split-newlines + (call-with-input-file "gpg.conf" read-all))))) + (begin + (echo "Note that gpg.conf includes 'batch'. If you want to use gpg") + (echo "interactively you should drop that."))) + +;; Add paths to tools to PATH. +(setenv "PATH" (pathsep-join + (append (map (lambda (t) (dirname (tool t))) + '(gpg gpg-agent scdaemon gpgsm dirmngr gpgconf)) + (pathsep-split (getenv "PATH")))) + #t) + +(echo "\nEnjoy your test environment. " + "Type 'exit' to exit it, it will be cleaned up after you.\n") + (interactive-shell) |