;;; semantic-utest.el --- Miscellaneous Semantic tests.
-;;; Copyright (C) 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
+;;; Copyright (C) 2003-2004, 2007-2013 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
(y-or-n-p "New database created. Reload system databases? ")
(y-or-n-p "Load in all system databases? "))
(semanticdb-load-ebrowse-caches)))
- ;; Ok, databases were creatd. Lets try some searching.
+ ;; Ok, databases were created. Let's try some searching.
(when (not (or (eq major-mode 'c-mode)
(eq major-mode 'c++-mode)))
(error "Please make your default buffer be a C or C++ file, then
-run the test again..")))
+run the test again")))
(defun semanticdb-ebrowse-dump ()
"Find the first loaded ebrowse table, and dump out the contents."
(defun semanticdb-test-gnu-global (searchfor &optional standardfile)
"Test the GNU Global semanticdb.
Argument SEARCHFOR is the text to search for.
-If optional arg STANDARDFILE is non nil, use a standard file w/ global enabled."
+If optional arg STANDARDFILE is non-nil, use a standard file w/ global enabled."
(interactive "sSearch For Tag: \nP")
(require 'data-debug)
(data-debug-new-buffer "*SemanticDB Gnu Global Result*")
(data-debug-insert-thing result "?" ""))))
-;;; From semantic-find
-
-(require 'semantic/find)
-
-(defun semantic-find-benchmark ()
- "Run some simple benchmarks to see how we are doing.
-Optional argument ARG is the number of iterations to run."
- (interactive)
- (require 'benchmark)
- (let ((f-name nil)
- (b-name nil)
- (f-comp)
- (b-comp)
- (f-regex)
- )
- (garbage-collect)
- (setq f-name
- (benchmark-run-compiled
- 1000 (semantic-find-first-tag-by-name "class3"
- "test/test.cpp")))
- (garbage-collect)
- (setq b-name
- (benchmark-run-compiled
- 1000 (semantic-brute-find-first-tag-by-name "class3"
- "test/test.cpp")))
- (garbage-collect)
- (setq f-comp
- (benchmark-run-compiled
- 1000 (semantic-find-tags-for-completion "method"
- "test/test.cpp")))
- (garbage-collect)
- (setq b-comp
- (benchmark-run-compiled
- 1000 (semantic-brute-find-tag-by-name-regexp "^method"
- "test/test.cpp")))
- (garbage-collect)
- (setq f-regex
- (benchmark-run-compiled
- 1000 (semantic-find-tags-by-name-regexp "^method"
- "test/test.cpp")))
-
- (message "Name [new old] [ %.3f %.3f ] Complete [newc/new old] [ %.3f/%.3f %.3f ]"
- (car f-name) (car b-name)
- (car f-comp) (car f-regex)
- (car b-comp))
- ))
-
;;; From semantic-format
(require 'semantic/format)
(defun semantic-lex-test-full-depth (arg)
"Test the semantic lexer in the current buffer parsing through lists.
-Usually the lexer parses
+Usually the lexer parses.
If universal argument ARG, then try the whole buffer."
(interactive "P")
(let* ((start (current-time))
(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
+Then 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))
(semantic-tag-start tag)
(semantic-tag-end tag))
(when (interactive-p)
- (message "Found %d occurances of %s in %.2f seconds"
+ (message "Found %d occurrences of %s in %.2f seconds"
Lcount (semantic-tag-name target)
(semantic-elapsed-time start (current-time))))
Lcount)))