]> git.eshelyaron.com Git - emacs.git/commitdiff
Test refactor/move
authorEric Ludlam <eric@siege-engine.com>
Sat, 11 Apr 2015 23:21:23 +0000 (19:21 -0400)
committerEdward John Steere <edward.steere@gmail.com>
Wed, 25 Jan 2017 18:21:28 +0000 (20:21 +0200)
* 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.

test/manual/cedet/cedet/semantic/ia-utest.el

index bc5b7391cbc88edd8e664c15944f90a635b23a63..faab6e26617db9728f410504059b347056336e0e 100644 (file)
@@ -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 <eric@siege-engine.com>
 
@@ -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))