[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: |
Sat, 28 Jan 2017 09:10:10 +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 800b575 081/316: Move tests in cedet/semantic, (continued)
- [Emacs-diffs] scratch/merge-cedet-tests 800b575 081/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests a9cd804 265/316: New tests., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 4a820de 289/316: Fix provide. (cedet-utests): Remove., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 9d2c338 251/316: New test file., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests a60b900 267/316: Fix provide., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests fba6409 297/316: Add test for parsing local variables, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 27001fd 271/316: Accept the make-tipe argument to control tests, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 28e2c81 239/316: (cit-remove-and-do-shared-lib): New., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 6f76589 250/316: Synchronize cedet/semantic with Emacs., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 802df00 246/316: Enable global to find hh and hpp files, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 3651195 269/316: Added test functions,
Edward John Steere <=
- [Emacs-diffs] scratch/merge-cedet-tests 1e14f6f 226/316: New setup testing., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 59e7c3e 237/316: Patch from David Engster, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 743c553 294/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 2ce4443 307/316: (cit-globalref-test): Note where the test is occuring., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 5b8af47 283/316: * tests/cit-externaldb.el: Fix requires., Edward John Steere, 2017/01/28