[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/merge-cedet-tests 05006be 049/316: Semantic Symref
From: |
Edward John Steere |
Subject: |
[Emacs-diffs] scratch/merge-cedet-tests 05006be 049/316: Semantic Symref testing. |
Date: |
Fri, 27 Jan 2017 20:03:26 +0000 (UTC) |
branch: scratch/merge-cedet-tests
commit 05006be0d97dce3bc47952d7b88de596bb6b324f
Author: zappo <address@hidden>
Commit: Edward John Steere <address@hidden>
Semantic Symref testing.
---
test/manual/cedet/cit-symref.el | 99 +++++++++++++++++++++++++++++++++++++++
1 file changed, 99 insertions(+)
diff --git a/test/manual/cedet/cit-symref.el b/test/manual/cedet/cit-symref.el
new file mode 100644
index 0000000..e24ae48
--- /dev/null
+++ b/test/manual/cedet/cit-symref.el
@@ -0,0 +1,99 @@
+;;; cit-symref.el ---
+;;
+;; Copyright (C) 2010 Eric M. Ludlam
+;;
+;; Author: Eric M. Ludlam <address@hidden>
+;; X-RCS: $Id: cit-symref.el,v 1.1 2010-04-18 00:33:36 zappo Exp $
+;;
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+;;
+;; Test the Symref refactoring tool against this made up project.
+;;
+;; We can't test much in symref in the utest setup because they can't
+;; do the refactoring steps, so we have to do them here instead.
+
+;;; Code:
+
+
+(defun cit-symref ()
+ "Test the symref tool."
+ ;; Start in a C++ file.
+ (find-file (cit-file "src/main.cpp"))
+
+ (let* ((target (car cit-symref-operations))
+ (dest (car (cdr cit-symref-operations)))
+ )
+ ;; 7 - Run the symref tool
+ ;; Create the UI
+ (semantic-symref-symbol target)
+ (cit-symref-count '(2 3 0 0))
+
+ ;; expand them all
+ (semantic-symref-list-expand-all)
+ (cit-symref-count '(2 3 4 0))
+
+ ;; Perform a rename.
+ (semantic-symref-list-rename-open-hits dest)
+ (save-some-buffers t)
+ (cit-symref-count '(2 3 4 0))
+
+ ;; Create a new symref buffer!
+ (find-file (cit-file "src/main.cpp"))
+ (semantic-symref-symbol dest)
+ (cit-symref-count '(2 3 0 0))
+
+ ;; Compile and run the refactored code.
+ (find-file (cit-file "src/main.cpp"))
+ (cit-compile-and-wait)
+ (find-file (cit-file "src/main.cpp"))
+ (cit-run-target "./Prog")
+ ))
+
+(defun cit-symref-count (expected)
+ "Count the current results, and return a list of the results.
+Argument EXPECTED is the expected result count."
+ (save-excursion
+ (goto-char (point-min))
+ (sit-for 0)
+ (let ((files 0)
+ (hits 0)
+ (res 0)
+ (other 0))
+ (while (not (eobp))
+ (beginning-of-line)
+ (cond ((looking-at "[^ ]")
+ (setq files (1+ files)))
+ ((looking-at " \\[")
+ (setq hits (1+ hits)))
+ ((looking-at " ")
+ (setq res (1+ res)))
+ (t (setq other (1+ other))))
+ (forward-line 1)
+ (end-of-line))
+ (unless (and (= files (nth 0 expected))
+ (= hits (nth 1 expected))
+ (= res (nth 2 expected))
+ (= other (nth 3 expected)))
+ (error "Symref Missmatch: %S != %S"
+ (list files hits res other)
+ expected)))))
+
+
+(provide 'cit-symref)
+
+;;; cit-symref.el ends here
- [Emacs-diffs] scratch/merge-cedet-tests d08bd3b 117/316: C/C++: Fix function pointer parsing, (continued)
- [Emacs-diffs] scratch/merge-cedet-tests d08bd3b 117/316: C/C++: Fix function pointer parsing, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests cd08101 179/316: Added cit uml, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests e96e309 178/316: Added new subdir and ensure that the base dir, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 765b8f9 208/316: (cedet-utest-test-alist): Add ede-detect-linux-utest., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests de289a9 189/316: Compare Code And Documtation For Tags, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 7177e01 210/316: Add compdb EDE project, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 284144e 154/316: Fixes for test execution, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests fd40e7f 212/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 404d4da 242/316: Improve compilation active detection, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 3cb2319 243/316: Added code for test tags, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 05006be 049/316: Semantic Symref testing.,
Edward John Steere <=
- [Emacs-diffs] scratch/merge-cedet-tests 614a6bb 044/316: Synchronize base 'cedet/ede' with Emacs, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests dbfb320 057/316: Test files contributed by Barry OReilly, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests b76efc7 062/316: Determine the STYLE of test to run. If none passed in, use Make., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 573b4a5 059/316: Remove more temporary directories, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 3730a42 069/316: New include for cpproot test that is in a subdirectory., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 4131d23 046/316: Fix typo in last commit., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 6a63635 090/316: ("ede-proj-project"): Add scripts/cit-test.sh, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests e20716d 097/316: ("Lisp"): Added cogre as an aux package., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 68ea5e3 098/316: (Lisp): Use preload compiler., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests b94f97e 101/316: (Lisp): Add cit-externaldb.el, Edward John Steere, 2017/01/27