]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Tramp tests for MS Windows
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 14 Feb 2020 13:50:55 +0000 (14:50 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 14 Feb 2020 13:50:55 +0000 (14:50 +0100)
* test/lisp/net/tramp-tests.el (tramp-test29-start-file-process)
(tramp-test30-make-process): Improve for MS-Windows.

test/lisp/net/tramp-tests.el

index 3e192899d45c4d5f3b0d69584c97f5cf5da661f8..9409cc2a39ff83cb27421a4e94c8a87fa50116fa 100644 (file)
@@ -4194,7 +4194,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
            (setq proc (start-file-process "test1" (current-buffer) "cat"))
            (should (processp proc))
            (should (equal (process-status proc) 'run))
-           (process-send-string proc "foo")
+           (process-send-string proc "foo\n")
            (process-send-eof proc)
            ;; Read output.
            (with-timeout (10 (tramp--test-timeout-handler))
@@ -4237,7 +4237,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
            (set-process-filter
             proc
             (lambda (p s) (with-current-buffer (process-buffer p) (insert s))))
-           (process-send-string proc "foo")
+           (process-send-string proc "foo\n")
            (process-send-eof proc)
            ;; Read output.
            (with-timeout (10 (tramp--test-timeout-handler))
@@ -4275,7 +4275,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
                     :file-handler t)))
            (should (processp proc))
            (should (equal (process-status proc) 'run))
-           (process-send-string proc "foo")
+           (process-send-string proc "foo\n")
            (process-send-eof proc)
            ;; Read output.
            (with-timeout (10 (tramp--test-timeout-handler))
@@ -4324,7 +4324,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
                     :file-handler t)))
            (should (processp proc))
            (should (equal (process-status proc) 'run))
-           (process-send-string proc "foo")
+           (process-send-string proc "foo\n")
            (process-send-eof proc)
            ;; Read output.
            (with-timeout (10 (tramp--test-timeout-handler))
@@ -4350,7 +4350,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
                     :file-handler t)))
            (should (processp proc))
            (should (equal (process-status proc) 'run))
-           (process-send-string proc "foo")
+           (process-send-string proc "foo\n")
            (process-send-eof proc)
            (delete-process proc)
            ;; Read output.
@@ -4358,8 +4358,13 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
              (while (accept-process-output proc 0 nil t)))
            ;; We cannot use `string-equal', because tramp-adb.el
            ;; echoes also the sent string.  And a remote macOS sends
-           ;; a slightly modified string.
-           (should (string-match "killed.*\n\\'" (buffer-string))))
+           ;; a slightly modified string. On MS-Windows,
+           ;; `delete-process' sends an unknown signal.
+           (should
+            (string-match
+             (if (eq system-type 'windows-nt)
+                 "unknown signal\n\\'" "killed.*\n\\'")
+             (buffer-string))))
 
        ;; Cleanup.
        (ignore-errors (delete-process proc)))
@@ -6302,9 +6307,7 @@ If INTERACTIVE is non-nil, the tests are run interactively."
 ;; * Fix `tramp-test06-directory-file-name' for `ftp'.
 ;; * Investigate, why `tramp-test11-copy-file' and `tramp-test12-rename-file'
 ;;   do not work properly for `nextcloud'.
-;; * Fix `tramp-test29-start-file-process' and
-;;   `tramp-test30-make-process' on MS Windows (`process-send-eof'?).
-;; * Implement `tramp-test31-interrupt-process' for `adb'.  Fix `:unstable'.
+;; * Implement `tramp-test31-interrupt-process' for `adb'.
 ;; * Fix Bug#16928 in `tramp-test43-asynchronous-requests'.  A remote
 ;;   file name operation cannot run in the timer.  Remove `:unstable' tag?