annotate test/cedet/semantic-tests.el @ 105471:c23aa87ffa7d

*** empty log message ***
author Michael Albinus <michael.albinus@gmx.de>
date Mon, 05 Oct 2009 11:49:45 +0000
parents 7f4c7f5c0eba
children 1d1d5d9bd884
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
105267
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1 ;;; semantic-utest.el --- Miscellaneous Semantic tests.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
2
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
3 ;;; Copyright (C) 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
4
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
5 ;; Author: Eric M. Ludlam <zappo@gnu.org>
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
6
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
8
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
9 ;; GNU Emacs is free software: you can redistribute it and/or modify
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
11 ;; the Free Software Foundation, either version 3 of the License, or
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
12 ;; (at your option) any later version.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
13
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
17 ;; GNU General Public License for more details.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
18
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
21
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
22 ;;; Commentary:
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
23
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
24 ;; Originally, there are many test functions scattered among the
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
25 ;; Semantic source files. This file consolidates them.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
26
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
27 (require 'data-debug)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
28
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
29 ;;; From semantic-complete
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
30
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
31 (require 'semantic/complete)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
32
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
33 (defun semantic-complete-test ()
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
34 "Test completion mechanisms."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
35 (interactive)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
36 (message "%S"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
37 (semantic-format-tag-prototype
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
38 (semantic-complete-read-tag-project "Symbol: "))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
39
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
40 ;;; From semanticdb-ebrowse
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
41
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
42 (require 'semantic/db-ebrowse)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
43
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
44 (defun semanticdb-ebrowse-run-tests ()
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
45 "Run some tests of the semanticdb-ebrowse system.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
46 All systems are different. Ask questions along the way."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
47 (interactive)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
48 (let ((doload nil))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
49 (when (y-or-n-p "Create a system database to test with? ")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
50 (call-interactively 'semanticdb-create-ebrowse-database)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
51 (setq doload t))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
52 ;; Should we load in caches
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
53 (when (if doload
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
54 (y-or-n-p "New database created. Reload system databases? ")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
55 (y-or-n-p "Load in all system databases? "))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
56 (semanticdb-load-ebrowse-caches)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
57 ;; Ok, databases were creatd. Lets try some searching.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
58 (when (not (or (eq major-mode 'c-mode)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
59 (eq major-mode 'c++-mode)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
60 (error "Please make your default buffer be a C or C++ file, then
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
61 run the test again..")))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
62
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
63 (defun semanticdb-ebrowse-dump ()
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
64 "Find the first loaded ebrowse table, and dump out the contents."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
65 (interactive)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
66 (let ((db semanticdb-database-list)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
67 (ab nil))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
68 (while db
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
69 (when (semanticdb-project-database-ebrowse-p (car db))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
70 (setq ab (data-debug-new-buffer "*EBROWSE Database*"))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
71 (data-debug-insert-thing (car db) "*" "")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
72 (setq db nil)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
73 )
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
74 (setq db (cdr db)))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
75
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
76 ;;; From semanticdb-global:
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
77
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
78 (require 'semantic/db-global)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
79
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
80 (defvar semanticdb-test-gnu-global-startfile "~/src/global-5.7.3/global/global.c"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
81 "File to use for testing.")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
82
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
83 (defun semanticdb-test-gnu-global (searchfor &optional standardfile)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
84 "Test the GNU Global semanticdb.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
85 Argument SEARCHFOR is the text to search for.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
86 If optional arg STANDARDFILE is non nil, use a standard file w/ global enabled."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
87 (interactive "sSearch For Tag: \nP")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
88
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
89 (require 'data-debug)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
90 (save-excursion
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
91 (when standardfile
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
92 (save-match-data
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
93 (set-buffer (find-file-noselect semanticdb-test-gnu-global-startfile))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
94
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
95 (condition-case err
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
96 (semanticdb-enable-gnu-global-in-buffer)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
97 (error (if standardfile
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
98 (error err)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
99 (save-match-data
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
100 (set-buffer (find-file-noselect semanticdb-test-gnu-global-startfile)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
101 (semanticdb-enable-gnu-global-in-buffer))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
102
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
103 (let* ((db (semanticdb-project-database-global "global"))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
104 (tab (semanticdb-file-table db (buffer-file-name)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
105 (result (semanticdb-deep-find-tags-for-completion-method tab searchfor))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
106 )
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
107 (data-debug-new-buffer "*SemanticDB Gnu Global Result*")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
108 (data-debug-insert-thing result "?" ""))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
109
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
110 ;;; From semantic-find
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
111
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
112 (require 'semantic/find)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
113
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
114 (defun semantic-find-benchmark ()
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
115 "Run some simple benchmarks to see how we are doing.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
116 Optional argument ARG is the number of iterations to run."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
117 (interactive)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
118 (require 'benchmark)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
119 (let ((f-name nil)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
120 (b-name nil)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
121 (f-comp)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
122 (b-comp)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
123 (f-regex)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
124 )
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
125 (garbage-collect)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
126 (setq f-name
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
127 (benchmark-run-compiled
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
128 1000 (semantic-find-first-tag-by-name "class3"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
129 "test/test.cpp")))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
130 (garbage-collect)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
131 (setq b-name
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
132 (benchmark-run-compiled
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
133 1000 (semantic-brute-find-first-tag-by-name "class3"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
134 "test/test.cpp")))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
135 (garbage-collect)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
136 (setq f-comp
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
137 (benchmark-run-compiled
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
138 1000 (semantic-find-tags-for-completion "method"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
139 "test/test.cpp")))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
140 (garbage-collect)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
141 (setq b-comp
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
142 (benchmark-run-compiled
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
143 1000 (semantic-brute-find-tag-by-name-regexp "^method"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
144 "test/test.cpp")))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
145 (garbage-collect)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
146 (setq f-regex
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
147 (benchmark-run-compiled
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
148 1000 (semantic-find-tags-by-name-regexp "^method"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
149 "test/test.cpp")))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
150
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
151 (message "Name [new old] [ %.3f %.3f ] Complete [newc/new old] [ %.3f/%.3f %.3f ]"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
152 (car f-name) (car b-name)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
153 (car f-comp) (car f-regex)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
154 (car b-comp))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
155 ))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
156
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
157 ;;; From semantic-format
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
158
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
159 (require 'semantic/format)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
160
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
161 (defun semantic-test-all-format-tag-functions (&optional arg)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
162 "Test all outputs from `semantic-format-tag-functions'.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
163 Output is generated from the function under `point'.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
164 Optional argument ARG specifies not to use color."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
165 (interactive "P")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
166 (semantic-fetch-tags)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
167 (let* ((tag (semantic-current-tag))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
168 (par (semantic-current-tag-parent))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
169 (fns semantic-format-tag-functions))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
170 (with-output-to-temp-buffer "*format-tag*"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
171 (princ "Tag->format function tests:")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
172 (while fns
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
173 (princ "\n")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
174 (princ (car fns))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
175 (princ ":\n ")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
176 (let ((s (funcall (car fns) tag par (not arg))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
177 (save-excursion
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
178 (set-buffer "*format-tag*")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
179 (goto-char (point-max))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
180 (insert s)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
181 (setq fns (cdr fns))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
182 ))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
183
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
184 ;;; From semantic-fw:
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
185
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
186 (require 'semantic/fw)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
187
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
188 (defun semantic-test-data-cache ()
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
189 "Test the data cache."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
190 (interactive)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
191 (let ((data '(a b c)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
192 (save-excursion
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
193 (set-buffer (get-buffer-create " *semantic-test-data-cache*"))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
194 (erase-buffer)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
195 (insert "The Moose is Loose")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
196 (goto-char (point-min))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
197 (semantic-cache-data-to-buffer (current-buffer) (point) (+ (point) 5)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
198 data 'moose 'exit-cache-zone)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
199 (if (equal (semantic-get-cache-data 'moose) data)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
200 (message "Successfully retrieved cached data.")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
201 (error "Failed to retrieve cached data")))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
202
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
203 (defun semantic-test-throw-on-input ()
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
204 "Test that throw on input will work."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
205 (interactive)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
206 (semantic-throw-on-input 'done-die)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
207 (message "Exit Code: %s"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
208 (semantic-exit-on-input 'testing
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
209 (let ((inhibit-quit nil)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
210 (message-log-max nil))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
211 (while t
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
212 (message "Looping ... press a key to test")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
213 (semantic-throw-on-input 'test-inner-loop))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
214 'exit)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
215 (when (input-pending-p)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
216 (if (fboundp 'read-event)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
217 (read-event)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
218 (read-char))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
219
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
220 ;;; From semantic-idle:
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
221
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
222 (require 'semantic/idle)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
223
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
224 (defun semantic-idle-pnf-test ()
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
225 "Test `semantic-idle-scheduler-work-parse-neighboring-files' and time it."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
226 (interactive)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
227 (let ((start (current-time))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
228 (junk (semantic-idle-scheduler-work-parse-neighboring-files))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
229 (end (current-time)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
230 (message "Work took %.2f seconds." (semantic-elapsed-time start end))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
231
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
232 ;;; From semantic-lex:
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
233
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
234 (require 'semantic/lex)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
235
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
236 (defun semantic-lex-test-full-depth (arg)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
237 "Test the semantic lexer in the current buffer parsing through lists.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
238 Usually the lexer parses
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
239 If universal argument ARG, then try the whole buffer."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
240 (interactive "P")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
241 (let* ((start (current-time))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
242 (result (semantic-lex
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
243 (if arg (point-min) (point))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
244 (point-max)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
245 100))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
246 (end (current-time)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
247 (message "Elapsed Time: %.2f seconds."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
248 (semantic-elapsed-time start end))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
249 (pop-to-buffer "*Lexer Output*")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
250 (require 'pp)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
251 (erase-buffer)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
252 (insert (pp-to-string result))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
253 (goto-char (point-min))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
254
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
255 (defun semantic-lex-test-region (beg end)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
256 "Test the semantic lexer in the current buffer.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
257 Analyze the area between BEG and END."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
258 (interactive "r")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
259 (let ((result (semantic-lex beg end)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
260 (pop-to-buffer "*Lexer Output*")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
261 (require 'pp)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
262 (erase-buffer)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
263 (insert (pp-to-string result))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
264 (goto-char (point-min))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
265
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
266 ;;; From semantic-lex-spp:
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
267
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
268 (require 'semantic/lex-spp)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
269
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
270 (defun semantic-lex-spp-write-test ()
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
271 "Test the semantic tag writer against the current buffer."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
272 (interactive)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
273 (with-output-to-temp-buffer "*SPP Write Test*"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
274 (semantic-lex-spp-table-write-slot-value
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
275 (semantic-lex-spp-save-table))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
276
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
277 (defun semantic-lex-spp-write-utest ()
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
278 "Unit test using the test spp file to test the slot write fcn."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
279 (interactive)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
280 (let* ((sem (locate-library "semantic-lex-spp.el"))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
281 (dir (file-name-directory sem)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
282 (save-excursion
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
283 (set-buffer (find-file-noselect
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
284 (expand-file-name "tests/testsppreplace.c"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
285 dir)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
286 (semantic-lex-spp-write-test))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
287
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
288 ;;; From semantic-tag-write:
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
289
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
290 ;;; TESTING.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
291
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
292 (require 'semantic/tag-write)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
293
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
294 (defun semantic-tag-write-test ()
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
295 "Test the semantic tag writer against the tag under point."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
296 (interactive)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
297 (with-output-to-temp-buffer "*Tag Write Test*"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
298 (semantic-tag-write-one-tag (semantic-current-tag))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
299
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
300 (defun semantic-tag-write-list-test ()
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
301 "Test the semantic tag writer against the tag under point."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
302 (interactive)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
303 (with-output-to-temp-buffer "*Tag Write Test*"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
304 (semantic-tag-write-tag-list (semantic-fetch-tags))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
305
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
306 ;;; From semantic-symref-filter:
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
307
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
308 (require 'semantic/symref/filter)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
309
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
310 (defun semantic-symref-test-count-hits-in-tag ()
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
311 "Lookup in the current tag the symbol under point.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
312 the count all the other references to the same symbol within the
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
313 tag that contains point, and return that."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
314 (interactive)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
315 (let* ((ctxt (semantic-analyze-current-context))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
316 (target (car (reverse (oref ctxt prefix))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
317 (tag (semantic-current-tag))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
318 (start (current-time))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
319 (Lcount 0))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
320 (when (semantic-tag-p target)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
321 (semantic-symref-hits-in-region
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
322 target (lambda (start end prefix) (setq Lcount (1+ Lcount)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
323 (semantic-tag-start tag)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
324 (semantic-tag-end tag))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
325 (when (interactive-p)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
326 (message "Found %d occurances of %s in %.2f seconds"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
327 Lcount (semantic-tag-name target)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
328 (semantic-elapsed-time start (current-time))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
329 Lcount)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
330
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
331 ;;; From bovine-gcc:
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
332
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
333 (require 'semantic/bovine/gcc)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
334
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
335 ;; Example output of "gcc -v"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
336 (defvar semantic-gcc-test-strings
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
337 '(;; My old box:
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
338 "Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
339 Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
340 Thread model: posix
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
341 gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
342 ;; Alex Ott:
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
343 "Using built-in specs.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
344 Target: i486-linux-gnu
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
345 Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.1-9ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
346 Thread model: posix
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
347 gcc version 4.3.1 (Ubuntu 4.3.1-9ubuntu1)"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
348 ;; My debian box:
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
349 "Using built-in specs.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
350 Target: x86_64-unknown-linux-gnu
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
351 Configured with: ../../../sources/gcc/configure --prefix=/usr/local/glibc-2.3.6/x86_64/apps/gcc-4.2.3 --with-gmp=/usr/local/gcc/gmp --with-mpfr=/usr/local/gcc/mpfr --enable-languages=c,c++,fortran --with-as=/usr/local/glibc-2.3.6/x86_64/apps/gcc-4.2.3/bin/as --with-ld=/usr/local/glibc-2.3.6/x86_64/apps/gcc-4.2.3/bin/ld --disable-multilib
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
352 Thread model: posix
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
353 gcc version 4.2.3"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
354 ;; My mac:
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
355 "Using built-in specs.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
356 Target: i686-apple-darwin8
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
357 Configured with: /private/var/tmp/gcc/gcc-5341.obj~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=powerpc-apple-darwin8 --with-arch=pentium-m --with-tune=prescott --program-prefix= --host=i686-apple-darwin8 --target=i686-apple-darwin8
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
358 Thread model: posix
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
359 gcc version 4.0.1 (Apple Computer, Inc. build 5341)"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
360 ;; Ubuntu Intrepid
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
361 "Using built-in specs.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
362 Target: x86_64-linux-gnu
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
363 Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.2-1ubuntu12' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
364 Thread model: posix
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
365 gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
366 ;; Red Hat EL4
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
367 "Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
368 Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=x86_64-redhat-linux
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
369 Thread model: posix
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
370 gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
371 ;; Red Hat EL5
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
372 "Using built-in specs.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
373 Target: x86_64-redhat-linux
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
374 Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
375 Thread model: posix
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
376 gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
377 ;; David Engster's german gcc on ubuntu 4.3
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
378 "Es werden eingebaute Spezifikationen verwendet.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
379 Ziel: i486-linux-gnu
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
380 Konfiguriert mit: ../src/configure -v --with-pkgversion='Ubuntu 4.3.2-1ubuntu12' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
381 Thread-Modell: posix
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
382 gcc-Version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
383 ;; Damien Deville bsd
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
384 "Using built-in specs.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
385 Target: i386-undermydesk-freebsd
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
386 Configured with: FreeBSD/i386 system compiler
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
387 Thread model: posix
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
388 gcc version 4.2.1 20070719 [FreeBSD]"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
389 )
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
390 "A bunch of sample gcc -v outputs from different machines.")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
391
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
392 (defvar semantic-gcc-test-strings-fail
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
393 '(;; A really old solaris box I found
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
394 "Reading specs from /usr/local/gcc-2.95.2/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/specs
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
395 gcc version 2.95.2 19991024 (release)"
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
396 )
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
397 "A bunch of sample gcc -v outputs that fail to provide the info we want.")
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
398
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
399 (defun semantic-gcc-test-output-parser ()
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
400 "Test the output parser against some collected strings."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
401 (interactive)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
402 (let ((fail nil))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
403 (dolist (S semantic-gcc-test-strings)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
404 (let* ((fields (semantic-gcc-fields S))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
405 (v (cdr (assoc 'version fields)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
406 (h (or (cdr (assoc 'target fields))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
407 (cdr (assoc '--target fields))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
408 (cdr (assoc '--host fields))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
409 (p (cdr (assoc '--prefix fields)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
410 )
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
411 ;; No longer test for prefixes.
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
412 (when (not (and v h))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
413 (let ((strs (split-string S "\n")))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
414 (message "Test failed on %S\nV H P:\n%S %S %S" (car strs) v h p))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
415 (setq fail t))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
416 ))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
417 (dolist (S semantic-gcc-test-strings-fail)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
418 (let* ((fields (semantic-gcc-fields S))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
419 (v (cdr (assoc 'version fields)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
420 (h (or (cdr (assoc '--host fields))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
421 (cdr (assoc 'target fields))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
422 (p (cdr (assoc '--prefix fields)))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
423 )
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
424 (when (and v h p)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
425 (message "Negative test failed on %S" S)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
426 (setq fail t))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
427 ))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
428 (if (not fail) (message "Tests passed."))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
429 ))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
430
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
431 (defun semantic-gcc-test-output-parser-this-machine ()
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
432 "Test the output parser against the machine currently running Emacs."
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
433 (interactive)
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
434 (let ((semantic-gcc-test-strings (list (semantic-gcc-query "gcc" "-v"))))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
435 (semantic-gcc-test-output-parser))
c99cf31de3f2 Add CEDET tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
436 )
105377
7f4c7f5c0eba Add arch tagline
Miles Bader <miles@gnu.org>
parents: 105267
diff changeset
437
7f4c7f5c0eba Add arch tagline
Miles Bader <miles@gnu.org>
parents: 105267
diff changeset
438 ;; arch-tag: 91686489-4ab3-4392-8277-b3831269ddbb