]> git.eshelyaron.com Git - emacs.git/commitdiff
Synchronize cedet/semantic with Emacs.
authorxscript <xscript@users.sourceforge.net>
Sun, 15 May 2011 20:16:47 +0000 (22:16 +0200)
committerEdward John Steere <edward.steere@gmail.com>
Wed, 25 Jan 2017 15:59:25 +0000 (17:59 +0200)
test/manual/cedet/cedet/semantic/db-global.el [new file with mode: 0644]

diff --git a/test/manual/cedet/cedet/semantic/db-global.el b/test/manual/cedet/cedet/semantic/db-global.el
new file mode 100644 (file)
index 0000000..91a39ed
--- /dev/null
@@ -0,0 +1,27 @@
+(defvar semanticdb-test-gnu-global-startfile "~/src/global-5.7.3/global/global.c"
+  "File to use for testing.")
+
+(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."
+  (interactive "sSearch For Tag: \nP")
+
+  (save-excursion
+    (when standardfile
+      (save-match-data
+        (set-buffer (find-file-noselect semanticdb-test-gnu-global-startfile))))
+
+    (condition-case err
+        (semanticdb-enable-gnu-global-in-buffer)
+      (error (if standardfile
+                 (error err)
+               (save-match-data
+                 (set-buffer (find-file-noselect semanticdb-test-gnu-global-startfile)))
+               (semanticdb-enable-gnu-global-in-buffer))))
+
+    (let* ((db (semanticdb-project-database-global "global"))
+           (tab (semanticdb-file-table db (buffer-file-name)))
+           (result (semanticdb-deep-find-tags-for-completion-method tab searchfor)))
+      (data-debug-new-buffer "*SemanticDB Gnu Global Result*")
+      (data-debug-insert-thing result "?" ""))))