"emacs" (current-buffer)
(concat invocation-directory invocation-name)
"--version")))
- (accept-process-output proc)
- (goto-char (point-min))
- (should (search-forward emacs-version nil t))
- ;; Don't stop the test run with a query, as the subprocess
- ;; may or may not be dead by the time we reach here.
- (set-process-query-on-exit-flag proc nil)
- ;; On MS-Windows, wait for the process to die, since the OS
- ;; will not let us delete a directory that is the cwd of a
- ;; running process.
- (when (eq system-type 'windows-nt)
- (while (process-live-p proc)
- (sleep-for 0.1)))))))
+ (unwind-protect
+ (progn
+ (accept-process-output proc)
+ (goto-char (point-min))
+ (should (search-forward emacs-version nil t))
+ ;; Don't stop the test run with a query, as the subprocess
+ ;; may or may not be dead by the time we reach here.
+ (set-process-query-on-exit-flag proc nil)
+ ;; On MS-Windows, wait for the process to die, since the OS
+ ;; will not let us delete a directory that is the cwd of a
+ ;; running process.
+ (when (eq system-type 'windows-nt)
+ (while (process-live-p proc)
+ (sleep-for 0.1))))
+ (delete-process proc))))))
(files-tests--with-temp-non-special-and-file-name-handler
(tmpdir nospecial-dir t)
(with-temp-buffer