#+AUTHOR: Leo Butler #+DATE: 10 Jan 2023 #+TITLE: False positives in ~org~ tests #+STARTUP: show2levels * Summary Applying the [[patch-to--org-test-with-temp-text]] reveals 4 tests that fail, but which are passed with the unpatched ~org-test-with-temp-text~ macro. The next sections show the test failures. References: - *Org-Babel Error Output* :: [[https://orgmode.org/list/87bknh5nva.fsf@localhosthttps://orgmode.org/list/87bknh5nva.fsf@localhost]] - buffer-live-p :: [[https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60626]] #+name: patch-to--org-test-with-temp-text #+begin_example diff --git a/testing/org-test.el b/testing/org-test.el index 22ac60670..7909f36cc 100644 --- a/testing/org-test.el +++ b/testing/org-test.el @@ -196,7 +196,18 @@ otherwise place the point at the beginning of the inserted text." (insert inside-text) (goto-char (point-min)))) (font-lock-ensure (point-min) (point-max)) - ,@body))) + (prog1 + (progn ,@body) + (unwind-protect + (should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))) + (when (get-buffer "*Org-Babel Error Output*") + (message "Detected: *Org-Babel Error Output*") + (message "Contents:") + (message (with-current-buffer "*Org-Babel Error Output*" + (buffer-substring-no-properties (point-min) (point-max)))) + (message "End:") + (kill-buffer "*Org-Babel Error Output*")))) + ))) (defmacro org-test-with-temp-text-in-file (text &rest body) "Run body in a temporary file buffer with Org mode as the active mode. #+end_example * Command The tests are run in-place like so: #+begin_src sh :exports none :results raw drawer make test-dirty #+end_src * Test Failures ** Failure 1 #+begin_example Detected: *Org-Babel Error Output* Contents: /tmp/tmp-orgtest/fortran-src-ym6m0X.F90:5:17: 5 | write (*, ’(i2)’), nint(s(1,2)) | 1 Warning: Legacy Extension: Comma before i/o item list at (1) [ Babel evaluation exited with code 0 ] /tmp/tmp-orgtest/fortran-src-EYVgCk.F90:5:17: 5 | write (*, ’(i2)’), nint(s(2,3)) | 1 Warning: Legacy Extension: Comma before i/o item list at (1) [ Babel evaluation exited with code 0 ] /tmp/tmp-orgtest/fortran-src-SwTuHS.F90:5:20: 5 | write (*, ’(3f5.2)’), s | 1 Warning: Legacy Extension: Comma before i/o item list at (1) [ Babel evaluation exited with code 0 ] /tmp/tmp-orgtest/fortran-src-xnH1cO.F90:5:20: 5 | write (*, ’(2f5.2)’), s | 1 Warning: Legacy Extension: Comma before i/o item list at (1) [ Babel evaluation exited with code 0 ] End: Test ob-java/args-quoted-string backtrace: ert-fail(((should-not (buffer-live-p (get-buffer "*Org-Babel Error O (if (not (unwind-protect (setq value-1015 (apply fn-1013 args-1014)) (let (form-description-1017) (if (not (unwind-protect (setq value-10 (let ((value-1015 'ert-form-evaluation-aborted-1016)) (let (form-des (let* ((fn-1013 #'buffer-live-p) (args-1014 (condition-case err (let (unwind-protect (let* ((fn-1013 #'buffer-live-p) (args-1014 (conditi (prog1 (progn (let* ((fn-1008 #'string=) (args-1009 (condition-case (progn (org-mode) (let ((point (string-match "" inside-text)) (unwind-protect (progn (org-mode) (let ((point (string-match ") :value t)) FAILED 71/1116 ob-java/args-quoted-string (0.313545 sec) #+end_example ** Failure 2 #+begin_example Detected: *Org-Babel Error Output* Contents: [ Babel evaluation exited with code 1 ] [ Babel evaluation exited with code 2 ] End: Test ob-shell/remote-with-stdin-or-cmdline backtrace: ert-fail(((should-not (buffer-live-p (get-buffer "*Org-Babel Error O (if (not (unwind-protect (setq value-2299 (apply fn-2297 args-2298)) (let (form-description-2301) (if (not (unwind-protect (setq value-22 (let ((value-2299 'ert-form-evaluation-aborted-2300)) (let (form-des (let* ((fn-2297 #'buffer-live-p) (args-2298 (condition-case err (let (unwind-protect (let* ((fn-2297 #'buffer-live-p) (args-2298 (conditi (prog1 (progn (org-trim (org-babel-execute-src-block))) (unwind-prot (progn (org-mode) (let ((point (string-match "" inside-text)) (unwind-protect (progn (org-mode) (let ((point (string-match ") :value t)) FAILED 190/1116 ob-shell/remote-with-stdin-or-cmdline (0.013323 sec) #+end_example ** Failure 3 #+begin_example Detected: *Org-Babel Error Output* Contents: [ Babel evaluation exited with code 2 ] End: Test ob-tangle/jump-to-org backtrace: ert--should-signal-hook(ert-test-failed (((should-not (buffer-live-p ert-fail(((should-not (buffer-live-p (get-buffer "*Org-Babel Error O (if (not (unwind-protect (setq value-2414 (apply fn-2412 args-2413)) (let (form-description-2416) (if (not (unwind-protect (setq value-24 (let ((value-2414 'ert-form-evaluation-aborted-2415)) (let (form-des (let* ((fn-2412 #'buffer-live-p) (args-2413 (condition-case err (let (unwind-protect (let* ((fn-2412 #'buffer-live-p) (args-2413 (conditi (prog1 (progn (org-babel-tangle-jump-to-org) (buffer-string)) (unwin (progn (org-mode) (let ((point (string-match "" inside-text)) (unwind-protect (progn (org-mode) (let ((point (string-match ") :value t)) FAILED 206/1116 ob-tangle/jump-to-org (0.007505 sec) #+end_example ** Failure 4 #+begin_example Detected: *Org-Babel Error Output* Contents: ls: cannot access ’NoSuchFileOrDirectory.txt’: No such file or directory [ Babel evaluation exited with code 2 ] End: Test test-ob/allow-spaces-around-=-in-var-specs backtrace: ert-fail(((should-not (buffer-live-p (get-buffer "*Org-Babel Error O (if (not (unwind-protect (setq value-3233 (apply fn-3231 args-3232)) (let (form-description-3235) (if (not (unwind-protect (setq value-32 (let ((value-3233 'ert-form-evaluation-aborted-3234)) (let (form-des (let* ((fn-3231 #'buffer-live-p) (args-3232 (condition-case err (let (unwind-protect (let* ((fn-3231 #'buffer-live-p) (args-3232 (conditi (prog1 (progn (let* ((fn-3226 #'=) (args-3227 (condition-case err (l (progn (org-mode) (let ((point (string-match "" inside-text)) (unwind-protect (progn (org-mode) (let ((point (string-match ") :value t)) FAILED 315/1116 test-ob/allow-spaces-around-=-in-var-specs (0.003319 sec) #+end_example ** Test Summary #+begin_example Ran 1116 tests, 1102 results as expected, 4 unexpected, 10 skipped (2023-01-10 11:36:40-0600, 64.394581 sec) 2 expected failures 4 unexpected results: FAILED ob-java/args-quoted-string ((should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))) :form (buffer-live-p #) :value t) FAILED ob-shell/remote-with-stdin-or-cmdline ((should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))) :form (buffer-live-p #) :value t) FAILED ob-tangle/jump-to-org ((should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))) :form (buffer-live-p #) :value t) FAILED test-ob/allow-spaces-around-=-in-var-specs ((should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))) :form (buffer-live-p #) :value t) 10 skipped results: SKIPPED org-missing-dependency/test-ob-R ((skip-unless nil) :form nil :value nil) SKIPPED org-missing-dependency/test-ob-clojure ((skip-unless nil) :form nil :value nil) SKIPPED org-missing-dependency/test-ob-eshell ((skip-unless nil) :form nil :value nil) SKIPPED org-missing-dependency/test-ob-julia ((skip-unless nil) :form nil :value nil) SKIPPED org-missing-dependency/test-ob-lua ((skip-unless nil) :form nil :value nil) SKIPPED org-missing-dependency/test-ob-ruby ((skip-unless nil) :form nil :value nil) SKIPPED org-missing-dependency/test-ob-scheme ((skip-unless nil) :form nil :value nil) SKIPPED org-missing-dependency/test-ob-sql ((skip-unless nil) :form nil :value nil) SKIPPED org-missing-dependency/test-ob-sqlite ((skip-unless nil) :form nil :value nil) SKIPPED org-missing-dependency/test-org-attach-git ((skip-unless nil) :form nil :value nil) make: *** [mk/targets.mk:100: test-dirty] Error 1 #+end_example