From 32bb5bd88c719861375528da70440f15c9edf9c7 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Sat, 28 Feb 2004 21:37:41 +0000 Subject: [PATCH] (execl, execlp, execle): Exercise errors where program not found. --- test-suite/tests/posix.test | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/test-suite/tests/posix.test b/test-suite/tests/posix.test index a4c9ee362..d00fca3f6 100644 --- a/test-suite/tests/posix.test +++ b/test-suite/tests/posix.test @@ -1,6 +1,6 @@ ;;;; posix.test --- Test suite for Guile POSIX functions. -*- scheme -*- ;;;; -;;;; Copyright 2003 Free Software Foundation, Inc. +;;;; Copyright 2003, 2004 Free Software Foundation, Inc. ;;;; ;;;; This program is free software; you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by @@ -20,6 +20,32 @@ (use-modules (test-suite lib)) +;; +;; execl +;; + +(with-test-prefix "execl" + (pass-if-exception "./nosuchprog" '(system-error . ".*") + (execl "./nosuchprog" "./nosuchprog" "some arg"))) + +;; +;; execlp +;; + +(with-test-prefix "execlp" + (pass-if-exception "./nosuchprog" '(system-error . ".*") + (execlp "./nosuchprog" "./nosuchprog" "some arg"))) + +;; +;; execle +;; + +(with-test-prefix "execle" + (pass-if-exception "./nosuchprog" '(system-error . ".*") + (execle "./nosuchprog" '() "./nosuchprog" "some arg")) + (pass-if-exception "./nosuchprog" '(system-error . ".*") + (execle "./nosuchprog" '("FOO=1" "BAR=2") "./nosuchprog" "some arg"))) + ;; ;; putenv ;;