[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/merge-cedet-tests 3651195 269/316: Added test func
From: |
Edward John Steere |
Subject: |
[Emacs-diffs] scratch/merge-cedet-tests 3651195 269/316: Added test functions |
Date: |
Fri, 27 Jan 2017 20:03:46 +0000 (UTC) |
branch: scratch/merge-cedet-tests
commit 3651195a0fb2ffcf9906331efcae899f405fbf78
Author: Eric Ludlam <address@hidden>
Commit: Edward John Steere <address@hidden>
Added test functions
* test/manual/cedet/cedet/semantic/utest-c.el: (semantic-utest-c-ede):
New (semantic-utest-c): Add call to
below. (semantic-utest-c-with-ede): New test function
(semantic-utest-c-setup-ede): New.
---
test/manual/cedet/cedet/semantic/utest-c.el | 64 +++++++++++++++++++++++++--
1 file changed, 61 insertions(+), 3 deletions(-)
diff --git a/test/manual/cedet/cedet/semantic/utest-c.el
b/test/manual/cedet/cedet/semantic/utest-c.el
index a3f3247..4f3e482 100644
--- a/test/manual/cedet/cedet/semantic/utest-c.el
+++ b/test/manual/cedet/cedet/semantic/utest-c.el
@@ -1,6 +1,6 @@
;;; semantic/utest-c.el --- C based parsing tests.
-;; Copyright (C) 2008, 2009, 2010, 2011 Eric M. Ludlam
+;; Copyright (C) 2008, 2009, 2010, 2011, 2015 Eric M. Ludlam
;; Author: Eric M. Ludlam <address@hidden>
@@ -32,6 +32,10 @@
'( "testsppcond.cpp" )
"List of files for testing conditionals.")
+(defvar semantic-utest-c-ede
+ '( ( "testede.c" . "testedereplaced.c") )
+ "List of files for testing conditionals.")
+
;;; Code:
;;;###autoload
(defun semantic-utest-c ()
@@ -39,6 +43,7 @@
(interactive)
(semantic-utest-c-compare)
(semantic-utest-c-conditionals)
+ (semantic-utest-c-with-ede)
;; Passed?
(message "PASSED!")
)
@@ -78,8 +83,8 @@ expand to."
(setq tags-expected (cdr tags-expected))
(with-mode-local c-mode
(error "Found: >> %s << Expected: >> %s <<"
- (semantic-format-tag-prototype tag nil t)
- (semantic-format-tag-prototype (car tags-expected) nil t)
+ (semantic-format-tag-prototype tag nil (not
noninteractive))
+ (semantic-format-tag-prototype (car tags-expected) nil
(not noninteractive))
)))
))
)))
@@ -120,5 +125,58 @@ those with PASS in the name will pass."
)))))
)
+
+;;; WITH EDE
+;;
+;; Some spp tests that include an EDE project, and pulling macros
+;; that were setup via that project.
+
+(defun semantic-utest-c-setup-ede (root)
+ "Set up an ede-cpp-root project at ROOT."
+ (ede-cpp-root-project "TMP" :file (expand-file-name "edeconfig.h" root)
+ :spp-table '( ("EDEPART" . "C")
+ )
+ :spp-files '( "edeconfig.h" ))
+ )
+
+(defun semantic-utest-c-with-ede ()
+ "Unit tests for spp macros pulled into a file from EDE for parsing."
+ (dolist (fp semantic-utest-c-ede)
+ (let* ((sem (or (locate-library "cedet/semantic/utest-c")
+ (error "Cannot locate library 'cedet/semantic/utest-c'.")))
+ (sdir (file-name-directory sem))
+ (filename1 (expand-file-name (concat "testwithede/" (car fp)) sdir))
+ (filename2 (expand-file-name (concat "testwithede/" (cdr fp)) sdir))
+ (tmpede (semantic-utest-c-setup-ede (expand-file-name "testwithede/"
sdir)))
+ (semantic-lex-c-nested-namespace-ignore-second nil)
+ (tags-actual
+ (save-excursion
+ (unless (file-exists-p filename1)
+ (error "Cannot load %s." filename1))
+ (set-buffer (find-file-noselect filename1))
+ (semantic-clear-toplevel-cache)
+ (semantic-fetch-tags)))
+ (tags-expected
+ (save-excursion
+ (unless (file-exists-p filename2)
+ (error "Cannot load %s." filename2))
+ (set-buffer (find-file-noselect filename2))
+ (semantic-clear-toplevel-cache)
+ (semantic-fetch-tags))))
+ ;; Now that we have the tags, compare them for SPP accuracy.
+ (dolist (tag tags-actual)
+ (if (and (semantic-tag-of-class-p tag 'variable)
+ (semantic-tag-variable-constant-p tag))
+ nil ; skip the macros.
+ (if (semantic-tag-similar-with-subtags-p tag (car tags-expected))
+ (setq tags-expected (cdr tags-expected))
+ (with-mode-local c-mode
+ (error "Found: >> %s << Expected: >> %s <<"
+ (semantic-format-tag-prototype tag nil (not
noninteractive))
+ (semantic-format-tag-prototype (car tags-expected) nil
(not noninteractive))
+ )))
+ ))
+ )))
+
(provide 'cedet/semantic/utest-c)
;;; semantic/utest-c.el ends here
- [Emacs-diffs] scratch/merge-cedet-tests 6f76589 250/316: Synchronize cedet/semantic with Emacs., (continued)
- [Emacs-diffs] scratch/merge-cedet-tests 6f76589 250/316: Synchronize cedet/semantic with Emacs., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests cd9aeb4 258/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 6adc6be 266/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 1e14f6f 226/316: New setup testing., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 23fa6fe 316/316: Remove tests and redundant resources not destined for merge, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests a020f37 004/316: (inhibit-splash-screen): Set this., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 89526ab 134/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 5a2a1da 293/316: (priority): Set to a low number. (cit-project-template): New template., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 1373a94 285/316: (cit-gnu-externaldb-test-one): Improve test for bad search result., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 4a820de 289/316: Fix provide. (cedet-utests): Remove., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 3651195 269/316: Added test functions,
Edward John Steere <=
- [Emacs-diffs] scratch/merge-cedet-tests 2ce4443 307/316: (cit-globalref-test): Note where the test is occuring., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests b6ebafc 233/316: Added more test data, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests ec14f1c 315/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 802df00 246/316: Enable global to find hh and hpp files, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 727bca8 248/316: Ensure that the correct buffer is active when, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 5cc7300 264/316: Synchronize cedet/semantic with Emacs., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 760fef4 309/316: Fix typo, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests ce2952b 312/316: Revert rev. 6995, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests a25699b 222/316: semantic/bovine/c: Parse C++ override/final correctly, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 2448a55 268/316: Fix unit testing for several tests and do better error checking., Edward John Steere, 2017/01/27