(async-shell-command command (current-buffer))
;; Suppress nasty messages.
(set-process-sentinel (get-buffer-process (current-buffer)) nil)
- (while
- (and (get-buffer-process (current-buffer))
- (eq (process-status (get-buffer-process (current-buffer))) 'run))
- (accept-process-output (get-buffer-process (current-buffer)) 1))
+ (while (get-buffer-process (current-buffer))
+ (accept-process-output (get-buffer-process (current-buffer)) 0.1))
+ (accept-process-output)
(buffer-substring-no-properties (point-min) (point-max))))
;; This test is inspired by Bug#23952.
(tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory)
'tramp-sh-file-name-handler))
- ;; Implementation note: There is a "sleep 1" at the end of every
- ;; test. Otherwise, the scripts could return too early, without
- ;; expected output.
(dolist (this-shell-command-to-string
'(;; Synchronously.
shell-command-to-string
"foo"
(funcall
this-shell-command-to-string
- (format "echo -n ${%s:?bla}; sleep 1" envvar))))))
+ (format "echo -n ${%s:?bla}" envvar))))))
(unwind-protect
;; Set the empty value.
"bla"
(funcall
this-shell-command-to-string
- (format "echo -n ${%s:?bla}; sleep 1" envvar))))
+ (format "echo -n ${%s:?bla}" envvar))))
;; Variable is set.
(should
(string-match
(regexp-quote envvar)
- (funcall this-shell-command-to-string "set; sleep 1")))))
+ (funcall this-shell-command-to-string "set")))))
;; We force a reconnect, in order to have a clean environment.
(tramp-cleanup-connection
"foo"
(funcall
this-shell-command-to-string
- (format "echo -n ${%s:?bla}; sleep 1" envvar))))
+ (format "echo -n ${%s:?bla}" envvar))))
(let ((process-environment
(cons envvar process-environment)))
;; Variable is unset.
"bla"
(funcall
this-shell-command-to-string
- (format "echo -n ${%s:?bla}; sleep 1" envvar))))
+ (format "echo -n ${%s:?bla}" envvar))))
;; Variable is unset.
(should-not
(string-match
(regexp-quote envvar)
- (funcall this-shell-command-to-string "set; sleep 1")))))))))
+ (funcall this-shell-command-to-string "set")))))))))
(ert-deftest tramp-test30-vc-registered ()
"Check `vc-registered'."