From 3234811c4991d046171201b7c6574c813edc554d Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Wed, 29 Feb 2012 09:08:32 -0700 Subject: [PATCH] cleaning headers of test files -- removing loads and requires --- testing/lisp/test-ob-C.el | 14 ++++++++++-- testing/lisp/test-ob-R.el | 12 +++-------- testing/lisp/test-ob-awk.el | 12 +++-------- testing/lisp/test-ob-emacs-lisp.el | 12 ----------- testing/lisp/test-ob-exp.el | 10 --------- testing/lisp/test-ob-fortran.el | 26 +++-------------------- testing/lisp/test-ob-lilypond.el | 11 +++------- testing/lisp/test-ob-maxima.el | 26 ++--------------------- testing/lisp/test-ob-octave.el | 12 ++--------- testing/lisp/test-ob-python.el | 12 +++-------- testing/lisp/test-ob-sh.el | 11 ++-------- testing/lisp/test-ob-table.el | 10 --------- testing/lisp/test-ob-tangle.el | 9 -------- testing/lisp/test-ob.el | 8 ------- testing/lisp/test-org-exp.el | 9 +------- testing/lisp/test-org-html.el | 13 ++---------- testing/lisp/test-org-table.el | 10 --------- testing/lisp/test-org.el | 10 --------- testing/lisp/test-property-inheritance.el | 8 +------ 19 files changed, 37 insertions(+), 198 deletions(-) diff --git a/testing/lisp/test-ob-C.el b/testing/lisp/test-ob-C.el index dfadedb26..5b5e0b42e 100644 --- a/testing/lisp/test-ob-C.el +++ b/testing/lisp/test-ob-C.el @@ -1,5 +1,15 @@ -(require 'ob-C) - +;;; test-ob-awk.el --- tests for ob-awk.el + +;; Copyright (c) 2010-2012 Sergey Litvinov +;; Authors: Sergey Litvinov + +;; Released under the GNU General Public License version 3 +;; see: http://www.gnu.org/licenses/gpl-3.0.html + +;;; Code: +(unless (featurep 'ob-C) + (signal 'missing-test-dependency "Support for C code blocks")) + (ert-deftest ob-C/assert () (should t)) diff --git a/testing/lisp/test-ob-R.el b/testing/lisp/test-ob-R.el index d70d90402..0ebf4d9b4 100644 --- a/testing/lisp/test-ob-R.el +++ b/testing/lisp/test-ob-R.el @@ -6,18 +6,12 @@ ;; Released under the GNU General Public License version 3 ;; see: http://www.gnu.org/licenses/gpl-3.0.html +;;; Code: (org-test-for-executable "R") (unless (featurep 'ess) (signal 'missing-test-dependency "ESS")) - -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) - -(require 'ob-R) +(unless (featurep 'ob-R) + (signal 'missing-test-dependency "Support for R code blocks")) (ert-deftest test-ob-R/simple-session () (org-test-with-temp-text diff --git a/testing/lisp/test-ob-awk.el b/testing/lisp/test-ob-awk.el index ca7638f62..d925b7b90 100644 --- a/testing/lisp/test-ob-awk.el +++ b/testing/lisp/test-ob-awk.el @@ -6,16 +6,10 @@ ;; Released under the GNU General Public License version 3 ;; see: http://www.gnu.org/licenses/gpl-3.0.html +;;; Code: (org-test-for-executable "awk") - -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) - -(require 'ob-awk) +(unless (featurep 'ob-awk) + (signal 'missing-test-dependency "Support for Awk code blocks")) (ert-deftest ob-awk/input-none () "Test with no input file" diff --git a/testing/lisp/test-ob-emacs-lisp.el b/testing/lisp/test-ob-emacs-lisp.el index a83e8e9e5..f262ff747 100644 --- a/testing/lisp/test-ob-emacs-lisp.el +++ b/testing/lisp/test-ob-emacs-lisp.el @@ -10,19 +10,7 @@ ;; Org-mode tests for ob-emacs-lisp.el live here - ;;; Code: - -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) - - -;;; Tests - (ert-deftest ob-emacs-lisp/commented-last-block-line-no-var () (org-test-with-temp-text-in-file " #+begin_src emacs-lisp diff --git a/testing/lisp/test-ob-exp.el b/testing/lisp/test-ob-exp.el index 7b0a878d4..342ebed0b 100644 --- a/testing/lisp/test-ob-exp.el +++ b/testing/lisp/test-ob-exp.el @@ -10,17 +10,7 @@ ;; Template test file for Org-mode tests - ;;; Code: -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) - - -;;; Tests (ert-deftest test-ob-exp/org-babel-exp-src-blocks/w-no-headers () "Testing export without any headlines in the org-mode file." (let ((html-file (concat (file-name-sans-extension org-test-no-heading-file) diff --git a/testing/lisp/test-ob-fortran.el b/testing/lisp/test-ob-fortran.el index e2229bc30..f04009923 100644 --- a/testing/lisp/test-ob-fortran.el +++ b/testing/lisp/test-ob-fortran.el @@ -6,30 +6,10 @@ ;; Released under the GNU General Public License version 3 ;; see: http://www.gnu.org/licenses/gpl-3.0.html +;;; Code: (org-test-for-executable "gfortran") - -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) - -(let ((load-path (cons (expand-file-name - "langs" - (expand-file-name - "babel" - (expand-file-name - "contrib" - (expand-file-name - ".." - (expand-file-name - ".." - (file-name-directory - (or load-file-name buffer-file-name))))))) - load-path))) - - (require 'ob-fortran)) +(unless (featurep 'ob-fortran) + (signal 'missing-test-dependency "Support for Fortran code blocks")) (ert-deftest ob-fortran/assert () (should t)) diff --git a/testing/lisp/test-ob-lilypond.el b/testing/lisp/test-ob-lilypond.el index a2f9e3703..03df6ef9d 100644 --- a/testing/lisp/test-ob-lilypond.el +++ b/testing/lisp/test-ob-lilypond.el @@ -6,14 +6,9 @@ ;; Released under the GNU General Public License version 3 ;; see: http://www.gnu.org/licenses/gpl-3.0.html -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) - -(require 'ob-lilypond) +;;; Code: +(unless (featurep 'ob-lilypond) + (signal 'missing-test-dependency "Support for Lilypond code blocks")) (save-excursion (set-buffer (get-buffer-create "test-ob-lilypond.el")) diff --git a/testing/lisp/test-ob-maxima.el b/testing/lisp/test-ob-maxima.el index 84992f0fe..4c92af0de 100644 --- a/testing/lisp/test-ob-maxima.el +++ b/testing/lisp/test-ob-maxima.el @@ -5,31 +5,9 @@ ;; Released under the GNU General Public License version 3 ;; see: http://www.gnu.org/licenses/gpl-3.0.html - (org-test-for-executable "maxima") - -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) - -(let ((load-path (cons (expand-file-name - "langs" - (expand-file-name - "babel" - (expand-file-name - "contrib" - (expand-file-name - ".." - (expand-file-name - ".." - (file-name-directory - (or load-file-name buffer-file-name))))))) - load-path))) - - (require 'ob-maxima)) +(unless (featurep 'ob-maxima) + (signal 'missing-test-dependency "Support for Maxima code blocks")) (ert-deftest ob-maxima/assert () (should t)) diff --git a/testing/lisp/test-ob-octave.el b/testing/lisp/test-ob-octave.el index f6182861c..e642679f2 100644 --- a/testing/lisp/test-ob-octave.el +++ b/testing/lisp/test-ob-octave.el @@ -5,17 +5,9 @@ ;; Released under the GNU General Public License version 3 ;; see: http://www.gnu.org/licenses/gpl-3.0.html - (org-test-for-executable "octave") - -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) - -(require 'ob-octave) +(unless (featurep 'ob-octave) + (signal 'missing-test-dependency "Support for Octave code blocks")) (ert-deftest ob-octave/input-none () "Number output" diff --git a/testing/lisp/test-ob-python.el b/testing/lisp/test-ob-python.el index b2cd3e5b3..d6a413333 100644 --- a/testing/lisp/test-ob-python.el +++ b/testing/lisp/test-ob-python.el @@ -6,16 +6,10 @@ ;; Released under the GNU General Public License version 3 ;; see: http://www.gnu.org/licenses/gpl-3.0.html +;;; Code: (org-test-for-executable "python") - -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) - -(require 'ob-python) +(unless (featurep 'ob-python) + (signal 'missing-test-dependency "Support for Python code blocks")) (ert-deftest test-ob-python/colnames-yes-header-argument () (org-test-with-temp-text "#+name: eg diff --git a/testing/lisp/test-ob-sh.el b/testing/lisp/test-ob-sh.el index 9d31a8946..297c86e13 100644 --- a/testing/lisp/test-ob-sh.el +++ b/testing/lisp/test-ob-sh.el @@ -8,17 +8,10 @@ ;; Template test file for Org-mode tests - ;;; Code: -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) +(unless (featurep 'ob-sh) + (signal 'missing-test-dependency "Support for Sh code blocks")) - -;;; Tests (ert-deftest test-ob-sh/dont-insert-spaces-on-expanded-bodies () "Expanded shell bodies should not start with a blank line unless the body of the tangled block does." diff --git a/testing/lisp/test-ob-table.el b/testing/lisp/test-ob-table.el index 8f5f1d3e8..d25c7a1e8 100644 --- a/testing/lisp/test-ob-table.el +++ b/testing/lisp/test-ob-table.el @@ -10,17 +10,7 @@ ;; Template test file for Org-mode tests - ;;; Code: -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) - - -;;; Tests ;; TODO Test Broken (wrong-type-argument number-or-marker-p "2.0") ;; (ert-deftest test-ob-table/sbe () diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el index 9db698b8e..17bb43311 100644 --- a/testing/lisp/test-ob-tangle.el +++ b/testing/lisp/test-ob-tangle.el @@ -12,15 +12,6 @@ ;;; Code: -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) - - -;;; Tests ;; TODO ;; (ert-deftest ob-tangle/noweb-on-tangle () diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el index 71fbf626e..6581d69ce 100644 --- a/testing/lisp/test-ob.el +++ b/testing/lisp/test-ob.el @@ -5,14 +5,6 @@ ;; Released under the GNU General Public License version 3 ;; see: http://www.gnu.org/licenses/gpl-3.0.html - -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) - (ert-deftest test-org-babel/multi-line-header-regexp () (should(equal "^[ \t]*#\\+headers?:[ \t]*\\([^\n]*\\)$" org-babel-multi-line-header-regexp)) diff --git a/testing/lisp/test-org-exp.el b/testing/lisp/test-org-exp.el index c5c3b4ee7..1f0149922 100644 --- a/testing/lisp/test-org-exp.el +++ b/testing/lisp/test-org-exp.el @@ -6,14 +6,7 @@ ;; Released under the GNU General Public License version 3 ;; see: http://www.gnu.org/licenses/gpl-3.0.html -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts) - (require 'org-ascii)) - +;;; Code: (ert-deftest test-org-exp/stripping-commas () "Test the stripping of commas from within blocks during export." (org-test-at-id "76d3a083-67fa-4506-a41d-837cc48158b5" diff --git a/testing/lisp/test-org-html.el b/testing/lisp/test-org-html.el index c2cc067f1..74780bd4b 100644 --- a/testing/lisp/test-org-html.el +++ b/testing/lisp/test-org-html.el @@ -10,18 +10,9 @@ ;; Template test file for Org-mode tests - ;;; Code: -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) - - -;;; Tests -(require 'org-html) +(unless (featurep 'org-html) + (signal 'missing-test-dependency "Support for Org-html")) (defmacro org-test-html/export-link (name link expected &optional desc opt-plist) `(ert-deftest ,(intern (concat "test-org-html/export-link/" name)) () diff --git a/testing/lisp/test-org-table.el b/testing/lisp/test-org-table.el index 26eb47bec..cdcc5dd0b 100644 --- a/testing/lisp/test-org-table.el +++ b/testing/lisp/test-org-table.el @@ -10,17 +10,7 @@ ;; Template test file for Org-mode tests - ;;; Code: -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) - - -;;; Tests (ert-deftest test-org-table/org-table-convert-refs-to-an/1 () "Simple reference @1$1." (should diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index 4fc9ac9d4..94ef9ad2c 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -10,17 +10,7 @@ ;; Template test file for Org-mode tests - ;;; Code: -(let* ((testing-lisp-dir (file-name-directory - (or load-file-name buffer-file-name))) - (load-path (cons testing-lisp-dir load-path))) - (dolist (file (directory-files testing-lisp-dir 'full - "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*\\.org$")) - (require (intern (substring file 0 (- (length file) 3)))))) - - -;;; Tests (ert-deftest test-org/org-link-escape-ascii-character () "Escape an ascii character." (should diff --git a/testing/lisp/test-property-inheritance.el b/testing/lisp/test-property-inheritance.el index 247841308..a68d7c6aa 100644 --- a/testing/lisp/test-property-inheritance.el +++ b/testing/lisp/test-property-inheritance.el @@ -6,13 +6,7 @@ ;; Released under the GNU General Public License version 3 ;; see: http://www.gnu.org/licenses/gpl-3.0.html -(let ((load-path (cons (expand-file-name - ".." (file-name-directory - (or load-file-name buffer-file-name))) - load-path))) - (require 'org-test) - (require 'org-test-ob-consts)) - +;;; Code: (defmacro test-org-in-property-buffer (&rest body) `(with-temp-buffer (insert-file-contents (expand-file-name "property-inheritance.org"