aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Thompson <davet@gnu.org>2015-06-24 20:50:34 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-07-07 18:46:44 -0400
commitb4abdeb63b4e29f89a0a8e54f7b442bb31da87c9 (patch)
tree31b46689ab9160a91c635a4ec248c4b0334e55fc /tests
parentb16d138a0af44740894ecd42eca4d71fd74aea1a (diff)
downloadguix-b4abdeb63b4e29f89a0a8e54f7b442bb31da87c9.tar
guix-b4abdeb63b4e29f89a0a8e54f7b442bb31da87c9.tar.gz
build: syscalls: Add mkdtemp!
* guix/build/syscalls.scm (mkdtemp!): New procedure. * tests/syscalls.scm ("mkdtemp!"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/syscalls.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 706f3dff44..049ca93267 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015 David Thompson <davet@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -67,6 +68,14 @@
(lambda args
(memv (system-error-errno args) (list EPERM EINVAL ENOENT)))))
+(test-assert "mkdtemp!"
+ (let* ((tmp (or (getenv "TMPDIR") "/tmp"))
+ (dir (mkdtemp! (string-append tmp "/guix-test-XXXXXX"))))
+ (and (file-exists? dir)
+ (begin
+ (rmdir dir)
+ #t))))
+
(test-assert "all-network-interfaces"
(match (all-network-interfaces)
(((? string? names) ..1)