emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/merge-cedet-tests 47d9c79 295/316: Moved tests abo


From: Edward John Steere
Subject: [Emacs-diffs] scratch/merge-cedet-tests 47d9c79 295/316: Moved tests about
Date: Sat, 28 Jan 2017 09:10:12 +0000 (UTC)

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

    Moved tests about
    
    * test/manual/cedet/cedet/semantic/ia-utest.el: (cedet-uutil): New
     require. (semantic-ia-utest): Fix where the test sources are loaded
     from.  (semantic-symref-test-count-hits-in-tag): Copied from other
     related src file.
---
 test/manual/cedet/cedet/semantic/ia-utest.el |   32 ++++++++++++++++++++++----
 1 file changed, 28 insertions(+), 4 deletions(-)

diff --git a/test/manual/cedet/cedet/semantic/ia-utest.el 
b/test/manual/cedet/cedet/semantic/ia-utest.el
index b11cf5f..7fdbeab 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 Eric M. Ludlam
+;; Copyright (C) 2008, 2009, 2010, 2011 Eric M. Ludlam
 
 ;; Author: Eric M. Ludlam <address@hidden>
 
@@ -29,7 +29,7 @@
 ;; where # is 1, 2, 3, etc, and some sort of answer list.
 
 ;;; Code:
-(require 'cedet-utests)
+(require 'cedet-uutil)
 (require 'semantic)
 (require 'semantic/analyze)
 (require 'semantic/analyze/refs)
@@ -73,7 +73,8 @@ Argument ARG specifies which set of tests to run.
       (cedet-utest-log-setup "ANALYZER")
 
       (set-buffer (semantic-find-file-noselect
-                  (locate-library "semantic/ia-utest.el")))
+                  (expand-file-name "cedet/semantic/ia-utest.el"
+                                    cedet-utest-root)))
 
       (while fl
 
@@ -527,6 +528,29 @@ If the error occurs w/ a C or C++ file, rethrow the error."
 
     ))
 
+;;;###autoload
+(defun semantic-symref-test-count-hits-in-tag ()
+  "Lookup in the current tag the symbol under point.
+the count all the other references to the same symbol within the
+tag that contains point, and return that."
+  (interactive)
+  (let* ((ctxt (semantic-analyze-current-context))
+        (target (car (reverse (oref ctxt prefix))))
+        (tag (semantic-current-tag))
+        (start (current-time))
+        (Lcount 0))
+    (when (semantic-tag-p target)
+      (semantic-symref-hits-in-region
+       target (lambda (start end prefix) (setq Lcount (1+ Lcount)))
+       (semantic-tag-start tag)
+       (semantic-tag-end tag))
+      (when (cedet-called-interactively-p)
+       (message "Found %d occurances of %s in %.2f seconds"
+                Lcount (semantic-tag-name target)
+                (semantic-elapsed-time start (current-time))))
+      Lcount)))
+
+
 (defun semantic-ia-utest-start-log ()
   "Start up a testlog for a run."
   ;; Redo w/ CEDET utest framework.
@@ -538,5 +562,5 @@ Pass ARGS to format to create the log message."
   ;; Forward to CEDET utest framework.
   (apply 'cedet-utest-log args))
 
-(provide 'semantic/ia-utest)
+(provide 'cedet/semantic/ia-utest)
 ;;; semantic/ia-utest.el ends here



reply via email to

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