]> git.eshelyaron.com Git - emacs.git/commitdiff
Update CEDET manual tests so that they run.
authorEric Ludlam <eric@siege-engine.com>
Tue, 15 Oct 2019 00:46:01 +0000 (20:46 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 15 Oct 2019 15:08:18 +0000 (11:08 -0400)
To run visit test/manual/cedet/cedet-utests.el
M-x eval-buffer
M-x cedet-utest
Author: Eric Ludlam <zappo@gnu.org>

lisp/emacs-lisp/chart.el
test/manual/cedet/cedet-utests.el
test/manual/cedet/semantic-tests.el
test/manual/cedet/srecode-tests.el

index 124ede17fd368139d244d206a498bb212d8f2b1d..e4b41f41984fd255f873fbc0b859a178f5db8320 100644 (file)
@@ -607,6 +607,8 @@ SORT-PRED if desired."
   (chart-bar-quickie 'vertical "Test Bar Chart"
                     '( "U1" "ME2" "C3" "B4" "QT" "EZ") "Items"
                     '( 5 -10 23 20 30 -3) "Values")
+  (if (not (called-interactively-p 'any))
+      (kill-buffer "*Test Bar Chart*"))
   )
 
 ;;; Sample utility function
index b8f08886fe7f46e4305d275d63d0d191a60c9395..369dff98f6985cc8d670a81ad0ae35cca51519fb 100644 (file)
 ;; into one command.
 
 (require 'cedet)
+(require 'inversion)
+
+(defvar cedet-utest-directory
+  (let* ((C (file-name-directory (locate-library "cedet")))
+         (D (expand-file-name "../../test/manual/cedet/" C)))
+    D)
+  "Location of test files for this test suite.")
+
+(defvar cedet-utest-libs '("ede-tests"
+                           "semantic-tests"
+                           "srecode-tests"
+                           )
+  "List of test srcs that need to be loaded.")
+
 ;;; Code:
 (defvar cedet-utest-test-alist
   '(
@@ -38,7 +52,9 @@
 
     ;; EZ Image dumping.
     ("ezimage associations" . ezimage-image-association-dump)
-    ("ezimage images" . ezimage-image-dump)
+    ("ezimage images" . (lambda ()
+                          (ezimage-image-dump)
+                          (kill-buffer "*Ezimage Images*")))
 
     ;; Pulse
     ("pulse interactive test" . (lambda () (pulse-test t)))
     ;;
     ;; EIEIO
     ;;
-    ("eieio" . (lambda () (let ((lib (locate-library "eieio-tests.el"
-                                                    t)))
-                           (load-file lib))))
-    ("eieio: browser" . eieio-browse)
+
+    ("eieio: browser" . (lambda ()
+                          (eieio-browse)
+                          (kill-buffer "*EIEIO OBJECT BROWSE*")))
     ("eieio: custom" . (lambda ()
                         (require 'eieio-custom)
-                        (customize-variable 'eieio-widget-test)))
+                        (customize-variable 'eieio-widget-test)
+                         (kill-buffer "*Customize Option: Eieio Widget Test*")
+                         ))
     ("eieio: chart" . (lambda ()
+                        (require 'chart)
                        (if noninteractive
                            (message " ** Skipping test in noninteractive mode.")
                          (chart-test-it-all))))
@@ -71,9 +90,9 @@
     ;; SEMANTIC
     ;;
     ("semantic: lex spp table write" . semantic-lex-spp-write-utest)
-    ("semantic: multi-lang parsing" . semantic-utest-main)
-    ("semantic: C preprocessor" . semantic-utest-c)
-    ("semantic: analyzer tests" . semantic-ia-utest)
+    ;;("semantic: multi-lang parsing" . semantic-utest-main)
+    ;;("semantic: C preprocessor" . semantic-utest-c) - Now in automated suite
+    ;;("semantic: analyzer tests" . semantic-ia-utest)
     ("semanticdb: data cache" . semantic-test-data-cache)
     ("semantic: throw-on-input" .
      (lambda ()
           (message " ** Skipping test in noninteractive mode.")
         (semantic-test-throw-on-input))))
 
-    ("semantic: gcc: output parse test" . semantic-gcc-test-output-parser)
+    ;;("semantic: gcc: output parse test" . semantic-gcc-test-output-parser)
+
     ;;
     ;; SRECODE
     ;;
-    ("srecode: fields" . srecode-field-utest)
-    ("srecode: templates" . srecode-utest-template-output)
+
+    ;; TODO - fix the fields test
+    ;;("srecode: fields" . srecode-field-utest)
+    ;;("srecode: templates" . srecode-utest-template-output)
     ("srecode: show maps" . srecode-get-maps)
-    ("srecode: getset" . srecode-utest-getset-output)
+    ;;("srecode: getset" . srecode-utest-getset-output)
    )
   "Alist of all the tests in CEDET we should run.")
 
 EXIT-ON-ERROR causes the test suite to exit on an error, instead
 of just logging the error."
   (interactive)
-  (if (or (not (featurep 'semanticdb-mode))
+  (if (or (not (featurep 'semantic/db-mode))
          (not (semanticdb-minor-mode-p)))
-      (error "CEDET Tests require: M-x semantic-load-enable-minimum-features"))
+      (error "CEDET Tests require semantic-mode to be enabled"))
+  (dolist (L cedet-utest-libs)
+    (load-file (expand-file-name (concat L ".el") cedet-utest-directory)))
   (cedet-utest-log-setup "ALL TESTS")
   (let ((tl cedet-utest-test-alist)
        (notes nil)
@@ -489,7 +513,7 @@ When optional NO-ERROR don't throw an error if we can't run tests."
     (when (interactive-p)
       (message "<Press a key> Pulse line a specific color.")
       (read-char))
-    (pulse-momentary-highlight-one-line (point) 'modeline)
+    (pulse-momentary-highlight-one-line (point) 'mode-line)
     (when (interactive-p)
       (message "<Press a key> Pulse a pre-existing overlay.")
       (read-char))
index 9109d665fa3a025b7cbdbdd609e3ae496a2ca2aa..ce6467dedd8457214485a4ddcacd0c601d96210d 100644 (file)
@@ -228,13 +228,16 @@ Analyze the area between BEG and END."
 (defun semantic-lex-spp-write-utest ()
   "Unit test using the test spp file to test the slot write fcn."
   (interactive)
-  (let* ((sem (locate-library "semantic-lex-spp.el"))
-        (dir (file-name-directory sem)))
-    (save-excursion
-      (set-buffer (find-file-noselect
-                  (expand-file-name "tests/testsppreplace.c"
-                                    dir)))
-      (semantic-lex-spp-write-test))))
+  (save-excursion
+    (let ((buff (find-file-noselect
+                (expand-file-name "tests/testsppreplace.c"
+                                  cedet-utest-directory))))
+      (set-buffer buff)
+      (semantic-lex-spp-write-test)
+      (kill-buffer buff)
+      (when (not (interactive-p))
+        (kill-buffer "*SPP Write Test*"))
+      )))
 
 ;;; From semantic-tag-write:
 
index 94c5dbbd9521dbd3a3f621c97527962dc7b255af..355bc0715d1ed171a86f9ab1f31e5559127b0e08 100644 (file)
@@ -243,7 +243,7 @@ It is filled with some text."
 
 ;;; From srecode-document:
 
-(require 'srecode/doc)
+(require 'srecode/document)
 
 (defun srecode-document-function-comment-extract-test ()
   "Test old comment extraction.