aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2016-07-14 12:27:41 +0200
committerMichael Albinus2016-07-14 12:27:41 +0200
commit8f5a8b69157ed73f14faed6d3dd943d65bce9264 (patch)
tree8984c7d749368550795df9326150b7474a5e9990
parent05ba7a0f83205e647546c2a3bb90e16add58cf06 (diff)
downloademacs-8f5a8b69157ed73f14faed6d3dd943d65bce9264.tar.gz
emacs-8f5a8b69157ed73f14faed6d3dd943d65bce9264.zip
Improve timing in `tramp-test29-environment-variables'
* test/automated/tramp-tests.el (tramp-test--shell-command-to-string-asynchronously): Add additional `accept-process-output' call. (tramp-test29-environment-variables): Remove additional sleep calls.
-rw-r--r--test/automated/tramp-tests.el22
1 files changed, 9 insertions, 13 deletions
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el
index cc90d1950cd..34d8d6ad495 100644
--- a/test/automated/tramp-tests.el
+++ b/test/automated/tramp-tests.el
@@ -1604,10 +1604,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1604 (async-shell-command command (current-buffer)) 1604 (async-shell-command command (current-buffer))
1605 ;; Suppress nasty messages. 1605 ;; Suppress nasty messages.
1606 (set-process-sentinel (get-buffer-process (current-buffer)) nil) 1606 (set-process-sentinel (get-buffer-process (current-buffer)) nil)
1607 (while 1607 (while (get-buffer-process (current-buffer))
1608 (and (get-buffer-process (current-buffer)) 1608 (accept-process-output (get-buffer-process (current-buffer)) 0.1))
1609 (eq (process-status (get-buffer-process (current-buffer))) 'run)) 1609 (accept-process-output)
1610 (accept-process-output (get-buffer-process (current-buffer)) 1))
1611 (buffer-substring-no-properties (point-min) (point-max)))) 1610 (buffer-substring-no-properties (point-min) (point-max))))
1612 1611
1613;; This test is inspired by Bug#23952. 1612;; This test is inspired by Bug#23952.
@@ -1620,9 +1619,6 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1620 (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) 1619 (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory)
1621 'tramp-sh-file-name-handler)) 1620 'tramp-sh-file-name-handler))
1622 1621
1623 ;; Implementation note: There is a "sleep 1" at the end of every
1624 ;; test. Otherwise, the scripts could return too early, without
1625 ;; expected output.
1626 (dolist (this-shell-command-to-string 1622 (dolist (this-shell-command-to-string
1627 '(;; Synchronously. 1623 '(;; Synchronously.
1628 shell-command-to-string 1624 shell-command-to-string
@@ -1644,7 +1640,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1644 "foo" 1640 "foo"
1645 (funcall 1641 (funcall
1646 this-shell-command-to-string 1642 this-shell-command-to-string
1647 (format "echo -n ${%s:?bla}; sleep 1" envvar)))))) 1643 (format "echo -n ${%s:?bla}" envvar))))))
1648 1644
1649 (unwind-protect 1645 (unwind-protect
1650 ;; Set the empty value. 1646 ;; Set the empty value.
@@ -1656,12 +1652,12 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1656 "bla" 1652 "bla"
1657 (funcall 1653 (funcall
1658 this-shell-command-to-string 1654 this-shell-command-to-string
1659 (format "echo -n ${%s:?bla}; sleep 1" envvar)))) 1655 (format "echo -n ${%s:?bla}" envvar))))
1660 ;; Variable is set. 1656 ;; Variable is set.
1661 (should 1657 (should
1662 (string-match 1658 (string-match
1663 (regexp-quote envvar) 1659 (regexp-quote envvar)
1664 (funcall this-shell-command-to-string "set; sleep 1"))))) 1660 (funcall this-shell-command-to-string "set")))))
1665 1661
1666 ;; We force a reconnect, in order to have a clean environment. 1662 ;; We force a reconnect, in order to have a clean environment.
1667 (tramp-cleanup-connection 1663 (tramp-cleanup-connection
@@ -1678,7 +1674,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1678 "foo" 1674 "foo"
1679 (funcall 1675 (funcall
1680 this-shell-command-to-string 1676 this-shell-command-to-string
1681 (format "echo -n ${%s:?bla}; sleep 1" envvar)))) 1677 (format "echo -n ${%s:?bla}" envvar))))
1682 (let ((process-environment 1678 (let ((process-environment
1683 (cons envvar process-environment))) 1679 (cons envvar process-environment)))
1684 ;; Variable is unset. 1680 ;; Variable is unset.
@@ -1687,12 +1683,12 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1687 "bla" 1683 "bla"
1688 (funcall 1684 (funcall
1689 this-shell-command-to-string 1685 this-shell-command-to-string
1690 (format "echo -n ${%s:?bla}; sleep 1" envvar)))) 1686 (format "echo -n ${%s:?bla}" envvar))))
1691 ;; Variable is unset. 1687 ;; Variable is unset.
1692 (should-not 1688 (should-not
1693 (string-match 1689 (string-match
1694 (regexp-quote envvar) 1690 (regexp-quote envvar)
1695 (funcall this-shell-command-to-string "set; sleep 1"))))))))) 1691 (funcall this-shell-command-to-string "set")))))))))
1696 1692
1697(ert-deftest tramp-test30-vc-registered () 1693(ert-deftest tramp-test30-vc-registered ()
1698 "Check `vc-registered'." 1694 "Check `vc-registered'."