aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/thread-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/thread-tests.el')
-rw-r--r--test/src/thread-tests.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/src/thread-tests.el b/test/src/thread-tests.el
index 322547c2e6a..9a065187b5e 100644
--- a/test/src/thread-tests.el
+++ b/test/src/thread-tests.el
@@ -111,14 +111,19 @@
111 (skip-unless (featurep 'threads)) 111 (skip-unless (featurep 'threads))
112 (should-error (thread-join (current-thread)))) 112 (should-error (thread-join (current-thread))))
113 113
114(defun threads-thread-sleeps ()
115 "Put current thread to sleep."
116 (sleep-for 5))
117
114(ert-deftest threads-join-error () 118(ert-deftest threads-join-error ()
115 "Test of error signaling from `thread-join'." 119 "Test of error signaling from `thread-join'."
116 :tags '(:unstable)
117 (skip-unless (featurep 'threads)) 120 (skip-unless (featurep 'threads))
118 (let ((thread (make-thread #'threads-call-error))) 121 (let ((thread (make-thread #'threads-thread-sleeps))
119 (while (thread-live-p thread) 122 err)
120 (thread-yield)) 123 (thread-signal thread 'error "Error signal for thread")
121 (should-error (thread-join thread)))) 124 (thread-yield)
125 (setq err (should-error (thread-join thread)))
126 (should (equal err '(error . "Error signal for thread")))))
122 127
123(defvar threads-test-binding nil) 128(defvar threads-test-binding nil)
124 129