Skip to content
run-shell-command-test.script 1.05 KiB
Newer Older
;;; TODO: write tests for run-program/ instead -- and/or
;;; import those from the original xcvb-driver-test

;;; test asdf run-shell-command function
  (when (asdf::os-unix-p)
   (setf asdf::*verbose-out* nil)
   (assert-equal 1 (asdf:run-shell-command "false"))
   (assert-equal 0 (asdf:run-shell-command "true"))
   (unless (< 0 (asdf:run-shell-command "./bad-shell-command"))
     (error "Failed to capture exit status indicating shell command failure."))
   (unless (equal 0 (asdf:run-shell-command "./good-shell-command"))
     (error "Failed to capture exit status indicating shell command failure."))
   ;; NB1: run-shell-command is deprecated. Use run-program/ instead.
   ;; NB2: we do NOT support stderr capture to *verbose-out* anymore in run-shell-command.
   ;; If you want 2>&1 redirection, you know where to find it.
   (assert-equal '("ok 1") (asdf::run-program/ "echo ok  1" :output :lines))
   (assert-equal '("ok  1") (asdf::run-program/ '("echo" "ok  1") :output :lines))
   ))