Merge branch 'bugfix'

This commit is contained in:
Ihor Radchenko 2022-12-29 12:53:32 +03:00
commit b86989c8df
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 18 additions and 6 deletions

View File

@ -67,7 +67,6 @@
(ert-deftest ob-octave/graphics-file () (ert-deftest ob-octave/graphics-file ()
"Graphics file. Test that link is correctly inserted and graphics file is created (and not empty). Clean-up side-effects." "Graphics file. Test that link is correctly inserted and graphics file is created (and not empty). Clean-up side-effects."
;; In case a prior test left the Error Output buffer hanging around. ;; In case a prior test left the Error Output buffer hanging around.
(skip-unless nil) ; FIXME: Failing on CI only
(when (get-buffer "*Org-Babel Error Output*") (when (get-buffer "*Org-Babel Error Output*")
(kill-buffer "*Org-Babel Error Output*")) (kill-buffer "*Org-Babel Error Output*"))
(let ((file (make-temp-file "test-ob-octave-" nil ".png"))) (let ((file (make-temp-file "test-ob-octave-" nil ".png")))
@ -80,7 +79,12 @@ sombrero;
(org-babel-execute-src-block) (org-babel-execute-src-block)
(should (search-forward (format "[[file:%s]]" file) nil nil)) (should (search-forward (format "[[file:%s]]" file) nil nil))
(should (file-readable-p file)) (should (file-readable-p file))
(should (> (file-attribute-size (file-attributes file)) 0)) (should (or (> (file-attribute-size (file-attributes file)) 0)
;; Avoid race condition on slow machines.
;; https://orgmode.org/list/87r0wk29dz.fsf@localhost
(progn
(sleep-for 1)
(> (file-attribute-size (file-attributes file)) 0))))
(should-not (get-buffer "*Org-Babel Error Output*"))) (should-not (get-buffer "*Org-Babel Error Output*")))
;; clean-up ;; clean-up
(delete-file file) (delete-file file)
@ -89,7 +93,6 @@ sombrero;
(ert-deftest ob-octave/graphics-file-session () (ert-deftest ob-octave/graphics-file-session ()
"Graphics file in a session. Test that session is started in *Inferior Octave* buffer, link is correctly inserted and graphics file is created (and not empty). Clean-up side-effects." "Graphics file in a session. Test that session is started in *Inferior Octave* buffer, link is correctly inserted and graphics file is created (and not empty). Clean-up side-effects."
(skip-unless nil) ; FIXME: Failing on CI only
(let ((file (make-temp-file "test-ob-octave-" nil ".png"))) (let ((file (make-temp-file "test-ob-octave-" nil ".png")))
(unwind-protect (unwind-protect
(org-test-with-temp-text (org-test-with-temp-text
@ -102,7 +105,12 @@ sombrero;
(should (get-buffer "*Inferior Octave*")) (should (get-buffer "*Inferior Octave*"))
(should (search-forward (format "[[file:%s]]" file) nil nil)) (should (search-forward (format "[[file:%s]]" file) nil nil))
(should (file-readable-p file)) (should (file-readable-p file))
(should (> (file-attribute-size (file-attributes file)) 0)) (or (> (file-attribute-size (file-attributes file)) 0)
;; Avoid race condition on slow machines.
;; https://orgmode.org/list/87r0wk29dz.fsf@localhost
(progn
(sleep-for 1)
(> (file-attribute-size (file-attributes file)) 0)))
(should-not (get-buffer "*Org-Babel Error Output*"))) (should-not (get-buffer "*Org-Babel Error Output*")))
;; clean-up ;; clean-up
(delete-file file) (delete-file file)
@ -113,7 +121,6 @@ sombrero;
(ert-deftest ob-octave/graphics-file-space () (ert-deftest ob-octave/graphics-file-space ()
"Graphics file with a space in filename. Test that session is started in *Inferior Octave* buffer, link is correctly inserted and graphics file is created (and not empty). Clean-up side-effects." "Graphics file with a space in filename. Test that session is started in *Inferior Octave* buffer, link is correctly inserted and graphics file is created (and not empty). Clean-up side-effects."
(skip-unless nil) ; FIXME: Failing on CI only
(let ((file (make-temp-file "test ob octave-" nil ".png"))) (let ((file (make-temp-file "test ob octave-" nil ".png")))
(unwind-protect (unwind-protect
(org-test-with-temp-text (org-test-with-temp-text
@ -124,7 +131,12 @@ sombrero;
(org-babel-execute-src-block) (org-babel-execute-src-block)
(should (search-forward (format "[[file:%s]]" file) nil nil)) (should (search-forward (format "[[file:%s]]" file) nil nil))
(should (file-readable-p file)) (should (file-readable-p file))
(should (> (file-attribute-size (file-attributes file)) 0)) (or (> (file-attribute-size (file-attributes file)) 0)
;; Avoid race condition on slow machines.
;; https://orgmode.org/list/87r0wk29dz.fsf@localhost
(progn
(sleep-for 1)
(> (file-attribute-size (file-attributes file)) 0)))
(should-not (get-buffer "*Org-Babel Error Output*"))) (should-not (get-buffer "*Org-Babel Error Output*")))
;; clean-up ;; clean-up
(delete-file file) (delete-file file)