1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

tests: Use descriptive temporary file names.

* 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 <justus@g10code.com>
This commit is contained in:
Justus Winter 2016-09-19 15:59:19 +02:00
parent 998643666c
commit 83a406b38a
4 changed files with 21 additions and 4 deletions

View file

@ -253,7 +253,10 @@
;; generic name is used.
(define (mkdtemp . components)
(_mkdtemp (if (null? components)
(path-join (getenv "TMP") "gpgscm-XXXXXX")
(path-join (getenv "TMP")
(string-append "gpgscm-" (get-isotime) "-"
(basename-suffix *scriptname* ".scm")
"-XXXXXX"))
(apply path-join components))))
(macro (with-temporary-working-directory form)