From: Eric Ludlam Date: Sat, 11 Apr 2015 23:21:23 +0000 (-0400) Subject: Test refactor/move X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ab1acb99a5d01cec2a50e1dc74359b13b841ad79;p=emacs.git Test refactor/move * test/manual/cedet/cedet/semantic/ia-utest.el: (semantic-ia-utest-file-list): Add tests/test.texi, test.mk, and test.srt (semantic-ia-utest-buffer, semantic-ia-utest-buffer-refs) (semantic-sr-utest-buffer-refs, semantic-src-utest-buffer-refs): When scanning for comments, wrap comment-start-skip to handle modes that have an unbound or in them. Skip back over whitespace from in front of found test point comments. --- diff --git a/test/manual/cedet/cedet/semantic/ia-utest.el b/test/manual/cedet/cedet/semantic/ia-utest.el index bc5b7391cbc..faab6e26617 100644 --- a/test/manual/cedet/cedet/semantic/ia-utest.el +++ b/test/manual/cedet/cedet/semantic/ia-utest.el @@ -1,6 +1,6 @@ ;;; semantic/ia-utest.el --- Analyzer unit tests -;; Copyright (C) 2008, 2009, 2010, 2011, 2014 Eric M. Ludlam +;; Copyright (C) 2008, 2009, 2010, 2011, 2014, 2015 Eric M. Ludlam ;; Author: Eric M. Ludlam @@ -53,6 +53,9 @@ "tests/testvarnames.java" "tests/testf90.f90" "tests/testwisent.wy" + "tests/test.texi" + "tests/test.mk" + "tests/test.srt" ) "List of files with analyzer completion test points.") @@ -102,6 +105,8 @@ Argument ARG specifies which set of tests to run. (semantic-ia-utest-log " ** Starting tests in %s" (buffer-name)) + ;;(message "Mode: %S" major-mode) + ;;(message "CSS: %S" comment-start-skip) (when (or (not arg) (= arg 1)) (semantic-ia-utest-buffer)) @@ -185,8 +190,10 @@ If the error occurs w/ a C or C++ file, rethrow the error." ) ;; Keep looking for test points until we run out. (while (save-excursion - (setq regex-p (concat "//\\s-*-" (number-to-string idx) "-" ) - regex-a (concat "//\\s-*#" (number-to-string idx) "#" )) + (setq regex-p ((concat "\\(" comment-start-skip "\\)\\s-*-" + (number-to-string idx) "-" ) + regex-a (concat "\\(" comment-start-skip "\\)\\s-*#" + (number-to-string idx) "#" )) (goto-char (point-min)) (save-match-data (when (re-search-forward regex-p nil t) @@ -199,6 +206,7 @@ If the error occurs w/ a C or C++ file, rethrow the error." (save-excursion (goto-char p) + (skip-chars-backward " ") ;; some languages need a space. (let* ((ctxt (semantic-analyze-current-context)) (acomp @@ -211,7 +219,10 @@ If the error occurs w/ a C or C++ file, rethrow the error." (let ((bss (buffer-substring-no-properties (point) (point-at-eol)))) (condition-case nil - (setq desired (read bss)) + (progn + (setq desired (read bss)) + ;;(message "READ of %S from %S" desired bss) + ) (error (setq desired (format " FAILED TO PARSE: %S" bss))))) @@ -260,8 +271,8 @@ If the error occurs w/ a C or C++ file, rethrow the error." ) ;; Keep looking for test points until we run out. (while (save-excursion - (setq regex-p (concat "//\\s-*\\^" (number-to-string idx) "^" ) - ) + (setq regex-p (concat "\\(" comment-start-skip + "\\)\\s-*\\^" (number-to-string idx) "^" ) (goto-char (point-min)) (save-match-data (when (re-search-forward regex-p nil t) @@ -381,7 +392,8 @@ If the error occurs w/ a C or C++ file, rethrow the error." ) ;; Keep looking for test points until we run out. (while (save-excursion - (setq regex-p (concat "//\\s-*\\%" (number-to-string idx) "%" ) + (setq regex-p (concat "\\(" comment-start-skip "\\)\\s-*\\%" + (number-to-string idx) "%" ) ) (goto-char (point-min)) (save-match-data @@ -479,7 +491,7 @@ If the error occurs w/ a C or C++ file, rethrow the error." ) ;; Keep looking for test points until we run out. (while (save-excursion - (setq regex-p (concat "//\\s-*@" + (setq regex-p (concat (setq regex-p (concat "\\(" comment-start-skip "\\)\\s-*@" (number-to-string idx) "@\\s-+\\(\\w+\\)" )) (goto-char (point-min))