diff --git a/Makefile b/Makefile index aa48be68..b0bbc74b 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ orgtest: ${CASK_EXEC} ${emacs} -Q -batch -l ${INIT} -l test/org-test-setup.el -l test/org-ert.el -f org-ert-tangle-tests mytest: orgtest - ${CASK_EXEC} ${emacs} -Q -batch -l ${INIT} -l test/org-test-setup.el -l test/*-test.el -f ert-run-tests-batch-and-exit + ${CASK_EXEC} ${emacs} -Q -batch -l ${INIT} -l test/org-test-setup.el -l test/*-test.el -f ert-run-tests-batch-and-exit compile: ${CASK} build diff --git a/test/all-org-test.el b/test/all-org-test.el index e805a748..7f7d0927 100644 --- a/test/all-org-test.el +++ b/test/all-org-test.el @@ -835,3 +835,6 @@ bibliography:%s" (org-ref-process-buffer 'html) t)) +(ert-deftest load-org-ref-latex () + (require 'org-ref-latex)) + diff --git a/test/all-org-test.org b/test/all-org-test.org index 8c2e99fa..ab9ec885 100644 --- a/test/all-org-test.org +++ b/test/all-org-test.org @@ -21,60 +21,61 @@ Run this to run tests and tangle the results for CI. #+END_SRC #+RESULTS: -| [[elisp:(org-babel-goto-nth-test-block 1)][or-key-file-p]] | t | -| [[elisp:(org-babel-goto-nth-test-block 2)][or-key-file-p-nil]] | t | -| [[elisp:(org-babel-goto-nth-test-block 3)][swap-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 4)][swap-2]] | t | -| [[elisp:(org-babel-goto-nth-test-block 5)][orfb-3]] | t | -| [[elisp:(org-babel-goto-nth-test-block 6)][orfb-3a]] | t | -| [[elisp:(org-babel-goto-nth-test-block 7)][unique-keys]] | t | -| [[elisp:(org-babel-goto-nth-test-block 8)][unique-keys-sort]] | t | -| [[elisp:(org-babel-goto-nth-test-block 9)][short-titles]] | t | -| [[elisp:(org-babel-goto-nth-test-block 10)][long-titles]] | t | -| [[elisp:(org-babel-goto-nth-test-block 11)][title-case-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 12)][title-case-2]] | t | -| [[elisp:(org-babel-goto-nth-test-block 13)][title-case-3]] | t | -| [[elisp:(org-babel-goto-nth-test-block 14)][title-case-4]] | t | -| [[elisp:(org-babel-goto-nth-test-block 15)][sentence-case-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 16)][sentence-case-2]] | t | -| [[elisp:(org-babel-goto-nth-test-block 17)][stringify]] | t | -| [[elisp:(org-babel-goto-nth-test-block 18)][next-entry-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 19)][prev-entry-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 20)][get-bibtex-keys]] | t | -| [[elisp:(org-babel-goto-nth-test-block 21)][set-bibtex-keys]] | t | -| [[elisp:(org-babel-goto-nth-test-block 22)][clean-year-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 23)][clean-year-2]] | t | -| [[elisp:(org-babel-goto-nth-test-block 24)][clean-&]] | t | -| [[elisp:(org-babel-goto-nth-test-block 25)][clean-comma]] | t | -| [[elisp:(org-babel-goto-nth-test-block 26)][clean-pages-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 27)][clean-doi-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 28)][bib-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 29)][bib-1a]] | t | -| [[elisp:(org-babel-goto-nth-test-block 30)][bib-2]] | t | -| [[elisp:(org-babel-goto-nth-test-block 31)][bad-ref]] | t | -| [[elisp:(org-babel-goto-nth-test-block 32)][bad-file-link]] | t | -| [[elisp:(org-babel-goto-nth-test-block 33)][cite-export-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 34)][cite-export-2]] | t | -| [[elisp:(org-babel-goto-nth-test-block 35)][cite-export-3]] | t | -| [[elisp:(org-babel-goto-nth-test-block 36)][label-export-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 37)][ref-export-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 38)][curly-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 39)][curly-2]] | t | -| [[elisp:(org-babel-goto-nth-test-block 40)][bib-string]] | t | -| [[elisp:(org-babel-goto-nth-test-block 41)][bib-list]] | t | -| [[elisp:(org-babel-goto-nth-test-block 42)][bad-cite-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 43)][bad-cite-1a]] | t | -| [[elisp:(org-babel-goto-nth-test-block 44)][bad-cite-1b]] | t | -| [[elisp:(org-babel-goto-nth-test-block 45)][bad-cite-1c]] | t | -| [[elisp:(org-babel-goto-nth-test-block 46)][bad-cite-1d]] | t | -| [[elisp:(org-babel-goto-nth-test-block 47)][v2-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 48)][v2-2]] | t | -| [[elisp:(org-babel-goto-nth-test-block 49)][v2-3]] | t | -| [[elisp:(org-babel-goto-nth-test-block 50)][v2-4]] | t | -| [[elisp:(org-babel-goto-nth-test-block 51)][tooltip-1]] | t | -| [[elisp:(org-babel-goto-nth-test-block 52)][tooltip-2]] | t | -| [[elisp:(org-babel-goto-nth-test-block 53)][key-cursor]] | t | -| [[elisp:(org-babel-goto-nth-test-block 54)][preprocess]] | t | +| [[elisp:(org-babel-goto-nth-test-block 1)][or-key-file-p]] | error | +| [[elisp:(org-babel-goto-nth-test-block 2)][or-key-file-p-nil]] | error | +| [[elisp:(org-babel-goto-nth-test-block 3)][swap-1]] | t | +| [[elisp:(org-babel-goto-nth-test-block 4)][swap-2]] | t | +| [[elisp:(org-babel-goto-nth-test-block 5)][orfb-3]] | error | +| [[elisp:(org-babel-goto-nth-test-block 6)][orfb-3a]] | error | +| [[elisp:(org-babel-goto-nth-test-block 7)][unique-keys]] | t | +| [[elisp:(org-babel-goto-nth-test-block 8)][unique-keys-sort]] | t | +| [[elisp:(org-babel-goto-nth-test-block 9)][short-titles]] | t | +| [[elisp:(org-babel-goto-nth-test-block 10)][long-titles]] | t | +| [[elisp:(org-babel-goto-nth-test-block 11)][title-case-1]] | t | +| [[elisp:(org-babel-goto-nth-test-block 12)][title-case-2]] | t | +| [[elisp:(org-babel-goto-nth-test-block 13)][title-case-3]] | t | +| [[elisp:(org-babel-goto-nth-test-block 14)][title-case-4]] | t | +| [[elisp:(org-babel-goto-nth-test-block 15)][sentence-case-1]] | t | +| [[elisp:(org-babel-goto-nth-test-block 16)][sentence-case-2]] | t | +| [[elisp:(org-babel-goto-nth-test-block 17)][stringify]] | t | +| [[elisp:(org-babel-goto-nth-test-block 18)][next-entry-1]] | t | +| [[elisp:(org-babel-goto-nth-test-block 19)][prev-entry-1]] | t | +| [[elisp:(org-babel-goto-nth-test-block 20)][get-bibtex-keys]] | t | +| [[elisp:(org-babel-goto-nth-test-block 21)][set-bibtex-keys]] | t | +| [[elisp:(org-babel-goto-nth-test-block 22)][clean-year-1]] | t | +| [[elisp:(org-babel-goto-nth-test-block 23)][clean-year-2]] | t | +| [[elisp:(org-babel-goto-nth-test-block 24)][clean-&]] | t | +| [[elisp:(org-babel-goto-nth-test-block 25)][clean-comma]] | t | +| [[elisp:(org-babel-goto-nth-test-block 26)][clean-pages-1]] | t | +| [[elisp:(org-babel-goto-nth-test-block 27)][clean-doi-1]] | t | +| [[elisp:(org-babel-goto-nth-test-block 28)][bib-1]] | t | +| [[elisp:(org-babel-goto-nth-test-block 29)][bib-1a]] | error | +| [[elisp:(org-babel-goto-nth-test-block 30)][bib-2]] | error | +| [[elisp:(org-babel-goto-nth-test-block 31)][bad-ref]] | t | +| [[elisp:(org-babel-goto-nth-test-block 32)][bad-file-link]] | t | +| [[elisp:(org-babel-goto-nth-test-block 33)][cite-export-1]] | t | +| [[elisp:(org-babel-goto-nth-test-block 34)][cite-export-2]] | t | +| [[elisp:(org-babel-goto-nth-test-block 35)][cite-export-3]] | t | +| [[elisp:(org-babel-goto-nth-test-block 36)][label-export-1]] | t | +| [[elisp:(org-babel-goto-nth-test-block 37)][ref-export-1]] | t | +| [[elisp:(org-babel-goto-nth-test-block 38)][curly-1]] | t | +| [[elisp:(org-babel-goto-nth-test-block 39)][curly-2]] | t | +| [[elisp:(org-babel-goto-nth-test-block 40)][bib-string]] | t | +| [[elisp:(org-babel-goto-nth-test-block 41)][bib-list]] | t | +| [[elisp:(org-babel-goto-nth-test-block 42)][bad-cite-1]] | t | +| [[elisp:(org-babel-goto-nth-test-block 43)][bad-cite-1a]] | error | +| [[elisp:(org-babel-goto-nth-test-block 44)][bad-cite-1b]] | error | +| [[elisp:(org-babel-goto-nth-test-block 45)][bad-cite-1c]] | error | +| [[elisp:(org-babel-goto-nth-test-block 46)][bad-cite-1d]] | error | +| [[elisp:(org-babel-goto-nth-test-block 47)][v2-1]] | t | +| [[elisp:(org-babel-goto-nth-test-block 48)][v2-2]] | t | +| [[elisp:(org-babel-goto-nth-test-block 49)][v2-3]] | t | +| [[elisp:(org-babel-goto-nth-test-block 50)][v2-4]] | t | +| [[elisp:(org-babel-goto-nth-test-block 51)][tooltip-1]] | error | +| [[elisp:(org-babel-goto-nth-test-block 52)][tooltip-2]] | error | +| [[elisp:(org-babel-goto-nth-test-block 53)][key-cursor]] | error | +| [[elisp:(org-babel-goto-nth-test-block 54)][preprocess]] | error | +| [[elisp:(org-babel-goto-nth-test-block 55)][load-org-ref-latex]] | org-ref-latex | @@ -97,9 +98,6 @@ Run this to run tests and tangle the results for CI. (file-name-directory (locate-library "org-ref"))))))) #+END_SRC -#+RESULTS: or-key-file-p -: t - @@ -131,9 +129,6 @@ Run this to run tests and tangle the results for CI. (file-name-directory (locate-library "org-ref")))))) #+END_SRC -#+RESULTS: or-key-file-p-nil -: t - @@ -211,6 +206,7 @@ Run this to run tests and tangle the results for CI. + #+name: swap-2 @@ -257,6 +253,7 @@ Run this to run tests and tangle the results for CI. + * Get bibliography @@ -281,9 +278,6 @@ Run this to run tests and tangle the results for CI. (org-ref-find-bibliography))))) #+END_SRC -#+RESULTS: orfb-3 -: t - @@ -345,9 +339,6 @@ Run this to run tests and tangle the results for CI. (org-ref-find-bibliography)))) #+END_SRC -#+RESULTS: orfb-3a -: t - @@ -430,6 +421,7 @@ bibliography:tests/test-1.bib + #+name: unique-keys-sort @@ -479,6 +471,7 @@ bibliography:tests/test-1.bib + * Bibtex tests @@ -528,6 +521,7 @@ bibliography:tests/test-1.bib + #+name: long-titles @@ -578,6 +572,7 @@ bibliography:tests/test-1.bib + ** Changing the case of titles @@ -645,6 +640,7 @@ bibliography:tests/test-1.bib + #+name: title-case-2 @@ -708,6 +704,7 @@ bibliography:tests/test-1.bib + #+name: title-case-3 @@ -775,6 +772,7 @@ bibliography:tests/test-1.bib + #+name: title-case-4 @@ -841,6 +839,7 @@ bibliography:tests/test-1.bib + #+name: sentence-case-1 @@ -915,6 +914,7 @@ bibliography:tests/test-1.bib + #+name: sentence-case-2 @@ -979,6 +979,7 @@ bibliography:tests/test-1.bib + ** Convert journal title to string @@ -1044,6 +1045,7 @@ bibliography:tests/test-1.bib + ** next/previous bibtex entries @@ -1127,6 +1129,7 @@ bibliography:tests/test-1.bib + #+name: prev-entry-1 @@ -1219,6 +1222,7 @@ bibliography:tests/test-1.bib + ** Get/set bibtex keys @@ -1311,6 +1315,7 @@ bibliography:tests/test-1.bib + #+name: set-bibtex-keys @@ -1393,6 +1398,7 @@ bibliography:tests/test-1.bib + #+name: clean-year-1 @@ -1467,6 +1473,7 @@ bibliography:tests/test-1.bib + #+name: clean-year-2 @@ -1541,6 +1548,7 @@ bibliography:tests/test-1.bib + #+name: clean-& @@ -1615,6 +1623,7 @@ bibliography:tests/test-1.bib + #+name: clean-comma @@ -1690,6 +1699,7 @@ bibliography:tests/test-1.bib + #+name: clean-pages-1 @@ -1765,6 +1775,7 @@ bibliography:tests/test-1.bib + #+name: clean-doi-1 @@ -1841,6 +1852,7 @@ bibliography:tests/test-1.bib + ** bibtex functionality @@ -1918,6 +1930,7 @@ the in the past. + #+name: bib-1a @@ -1934,9 +1947,6 @@ the in the past. (bibtex-search-entry "kitchin-2015-examp"))))) #+END_SRC -#+RESULTS: bib-1a -: t - @@ -1996,9 +2006,6 @@ the in the past. (bibtex-search-entry "bad-key")))) #+END_SRC -#+RESULTS: bib-2 -: t - @@ -2117,6 +2124,7 @@ label:four + #+name: bad-file-link #+BEGIN_SRC emacs-lisp :test (should @@ -2157,6 +2165,7 @@ not loaded. + * exports @@ -2191,6 +2200,7 @@ not loaded. + #+name: cite-export-2 #+BEGIN_SRC emacs-lisp :test @@ -2222,6 +2232,7 @@ not loaded. + #+name: cite-export-3 @@ -2254,6 +2265,7 @@ not loaded. + ** labels @@ -2287,6 +2299,7 @@ not loaded. + ** ref @@ -2320,6 +2333,7 @@ not loaded. + * org-ref-glossary #+name: curly-1 @@ -2351,6 +2365,7 @@ not loaded. + #+name: curly-2 #+BEGIN_SRC emacs-lisp :test (should @@ -2379,6 +2394,7 @@ not loaded. + * bib tests #+name: bib-string @@ -2410,6 +2426,7 @@ not loaded. + #+RESULTS: curly-3 | test.bib | @@ -2447,6 +2464,7 @@ not loaded. + #+name: bad-cite-1 #+BEGIN_SRC emacs-lisp :test (should (= 1 (length (let ((bibtex-completion-bibliography "test-1.bib")) @@ -2474,6 +2492,7 @@ not loaded. + #+RESULTS: : t @@ -2487,9 +2506,6 @@ not loaded. (org-ref-bad-cite-candidates)))))) #+END_SRC -#+RESULTS: bad-cite-1a -: t - @@ -2514,9 +2530,6 @@ not loaded. #+END_SRC -#+RESULTS: bad-cite-1b -: t - @@ -2541,9 +2554,6 @@ not loaded. (org-ref-bad-cite-candidates)))))) #+END_SRC -#+RESULTS: bad-cite-1c -: t - @@ -2569,9 +2579,6 @@ not loaded. #+END_SRC -#+RESULTS: bad-cite-1d -: t - @@ -2606,6 +2613,7 @@ not loaded. + t @@ -2628,6 +2636,7 @@ t + t @@ -2650,6 +2659,7 @@ t + t @@ -2673,6 +2683,7 @@ t + #+name: tooltip-1 #+BEGIN_SRC emacs-lisp :test (should @@ -2692,9 +2703,6 @@ bibliography:%s" (display-local-help)))) #+END_SRC -#+RESULTS: tooltip-1 -: t - @@ -2724,9 +2732,6 @@ bibliography:%s" (org-no-properties (org-ref-cite-tooltip (selected-window) (selected-frame) 8))))) #+END_SRC -#+RESULTS: tooltip-2 -: t - @@ -2754,9 +2759,6 @@ bibliography:%s" (org-ref-get-bibtex-key-under-cursor)))) #+END_SRC -#+RESULTS: key-cursor -: t - @@ -2783,9 +2785,14 @@ bibliography:%s" t) #+END_SRC -#+RESULTS: preprocess -: t +* org-ref-latex +#+name: load-org-ref-latex +#+BEGIN_SRC emacs-lisp :test +(require 'org-ref-latex) +#+END_SRC +#+RESULTS: load-org-ref-latex +: org-ref-latex diff --git a/test/init.el b/test/init.el index b963cd76..31dee1a7 100644 --- a/test/init.el +++ b/test/init.el @@ -33,5 +33,4 @@ (require 'org-ref) - (message "done") diff --git a/test/org-ert.el b/test/org-ert.el index 08913d7b..1dc30ad2 100644 --- a/test/org-ert.el +++ b/test/org-ert.el @@ -6,6 +6,8 @@ (require 'ert) (require 'lispy) +(require 'cl-lib) + ;;; Code: (defun org-src-test-p () @@ -49,7 +51,7 @@ Returns the result unless an error comes up, and then it returns 'error." (let ((results '()) (i 0)) (while (org-goto-next-test-block) - (incf i) + (cl-incf i) (org-babel-remove-result) (save-restriction (org-narrow-to-block) @@ -76,7 +78,7 @@ Returns the result unless an error comes up, and then it returns 'error." (let ((test-string "") (i 0)) (while (org-goto-next-test-block) - (incf i) + (cl-incf i) (setq test-string (concat test-string (format "(ert-deftest %s ()\n%s)\n\n"