emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/merge-cedet-tests ab1acb9 300/316: Test refactor/m


From: Edward John Steere
Subject: [Emacs-diffs] scratch/merge-cedet-tests ab1acb9 300/316: Test refactor/move
Date: Fri, 27 Jan 2017 20:03:48 +0000 (UTC)

branch: scratch/merge-cedet-tests
commit ab1acb99a5d01cec2a50e1dc74359b13b841ad79
Author: Eric Ludlam <address@hidden>
Commit: Edward John Steere <address@hidden>

    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.
---
 test/manual/cedet/cedet/semantic/ia-utest.el |   28 ++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/test/manual/cedet/cedet/semantic/ia-utest.el 
b/test/manual/cedet/cedet/semantic/ia-utest.el
index bc5b739..faab6e2 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 <address@hidden>
 
@@ -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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]