emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master c07459f 5/8: Move semantic/format.el tests to follow our conventi


From: Stefan Kangas
Subject: master c07459f 5/8: Move semantic/format.el tests to follow our conventions
Date: Wed, 10 Feb 2021 00:45:44 -0500 (EST)

branch: master
commit c07459fd10a9352b32d4de6e9145a419772bd70b
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Move semantic/format.el tests to follow our conventions
    
    * test/lisp/cedet/semantic-utest-fmt.el: Move from here...
    * test/lisp/cedet/semantic/format-tests.el: ...to here.
    (ert, ert-x): Require.
    (semantic-fmt-utest-file-list): Use ert-resource-file.
    * test/manual/cedet/tests/test-fmt.cpp:
    * test/manual/cedet/tests/test-fmt.el: Move from here...
    * test/lisp/cedet/semantic/format-resources/test-fmt.cpp:
    * test/lisp/cedet/semantic/format-resources/test-fmt.el: ...to here.
---
 .../cedet/semantic/format-resources}/test-fmt.cpp  |  0
 .../cedet/semantic/format-resources}/test-fmt.el   |  2 +-
 .../format-tests.el}                               | 38 +++++++---------------
 3 files changed, 12 insertions(+), 28 deletions(-)

diff --git a/test/manual/cedet/tests/test-fmt.cpp 
b/test/lisp/cedet/semantic/format-resources/test-fmt.cpp
similarity index 100%
rename from test/manual/cedet/tests/test-fmt.cpp
rename to test/lisp/cedet/semantic/format-resources/test-fmt.cpp
diff --git a/test/manual/cedet/tests/test-fmt.el 
b/test/lisp/cedet/semantic/format-resources/test-fmt.el
similarity index 95%
rename from test/manual/cedet/tests/test-fmt.el
rename to test/lisp/cedet/semantic/format-resources/test-fmt.el
index 1225713..941aaae 100644
--- a/test/manual/cedet/tests/test-fmt.el
+++ b/test/lisp/cedet/semantic/format-resources/test-fmt.el
@@ -1,4 +1,4 @@
-;;; test-fmt.el --- test semantic tag formatting
+;;; test-fmt.el --- test semantic tag formatting  -*- lexical-binding: t -*-
 
 ;;; Copyright (C) 2012, 2019-2021 Free Software Foundation, Inc.
 
diff --git a/test/lisp/cedet/semantic-utest-fmt.el 
b/test/lisp/cedet/semantic/format-tests.el
similarity index 79%
rename from test/lisp/cedet/semantic-utest-fmt.el
rename to test/lisp/cedet/semantic/format-tests.el
index d6e5ce7..a9eb448 100644
--- a/test/lisp/cedet/semantic-utest-fmt.el
+++ b/test/lisp/cedet/semantic/format-tests.el
@@ -1,4 +1,4 @@
-;;; cedet/semantic-utest-fmt.el --- Parsing / Formatting tests -*- 
lexical-binding:t -*-
+;;; semantic/format-tests.el --- Parsing / Formatting tests -*- 
lexical-binding:t -*-
 
 ;;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc.
 
@@ -28,19 +28,14 @@
 ;; make sure that the semantic-tag-format-* functions in question
 ;; created the desired output.
 
-(require 'semantic)
-(require 'semantic/format)
-
 ;;; Code:
 
-(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.")
+(require 'ert)
+(require 'ert-x)
+(require 'semantic/format)
 
 (defvar semantic-fmt-utest-file-list
-  '("tests/test-fmt.cpp"
+  (list (ert-resource-file "test-fmt.cpp")
     ;; "tests/test-fmt.el" - add this when elisp is support by dflt in Emacs
     )
   "List of files to run unit tests in.")
@@ -53,21 +48,10 @@
 Files to visit are in `semantic-fmt-utest-file-list'."
   (save-current-buffer
     (semantic-mode 1)
-    (let ((fl semantic-fmt-utest-file-list)
-         (fname nil)
-         )
-
-      (dolist (FILE fl)
-
-       (save-current-buffer
-         (setq fname (expand-file-name FILE cedet-utest-directory))
-
-         ;; Make sure we have the files we think we have.
-         (should (file-exists-p fname))
-         ;; (error "Cannot find unit test file: %s" fname))
-
-         ;; Run the tests.
-         (let ((fb (find-buffer-visiting fname))
+    (let ((fl semantic-fmt-utest-file-list))
+      (dolist (fname fl)
+        (save-current-buffer
+          (let ((fb (find-buffer-visiting fname))
                (b (semantic-find-file-noselect fname))
                (tags nil))
 
@@ -122,6 +106,6 @@ Files to visit are in `semantic-fmt-utest-file-list'."
       )))
 
 
-(provide 'cedet/semantic/fmt-utest)
+(provide 'format-tests)
 
-;;; semantic-fmt-utest.el ends here
+;;; format-tests.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]