emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/merge-cedet-tests dacde10 013/316: Fix unit testin


From: Edward John Steere
Subject: [Emacs-diffs] scratch/merge-cedet-tests dacde10 013/316: Fix unit testing for several tests and do better error checking.
Date: Sat, 28 Jan 2017 09:09:42 +0000 (UTC)

branch: scratch/merge-cedet-tests
commit dacde104b09fee00255fc8a85e25e0e111017d8f
Author: David Engster <address@hidden>
Commit: Edward John Steere <address@hidden>

    Fix unit testing for several tests and do better error checking.
    
    * semantic/lex-spp-utests.el (semantic-lex-spp-write-utest):
    * tests/cedet-utests.el (cedet-utest-eieio-classloader): Throw
      error if we cannot locate test files.
    
    * semantic/utest-c.el (semantic-utest-c-compare)
      (semantic-utest-c-conditionals):
    * semantic/lex-spp-utest.el (semantic-lex-spp-write-utest): Adapt
      to new directory structure and do better error checking to avoid
      silent failures in the future.
---
 test/manual/cedet/cedet/semantic/lex-spp-utest.el |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/test/manual/cedet/cedet/semantic/lex-spp-utest.el 
b/test/manual/cedet/cedet/semantic/lex-spp-utest.el
index 9721d6a..8ecfcfb 100644
--- a/test/manual/cedet/cedet/semantic/lex-spp-utest.el
+++ b/test/manual/cedet/cedet/semantic/lex-spp-utest.el
@@ -34,15 +34,17 @@
 (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"
+  (let* ((sem (or (locate-library "cedet/semantic/lex-spp-utest.el")
+                 (error "Could not locate library 
'cedet/semantic/lex-spp-utest.el'.")))
+        (dir (file-name-directory sem))
+        (filename (expand-file-name "tests/testsppreplace.c"
                                     dir)))
+    (save-excursion
+      (unless (file-exists-p filename)
+       (error "Could not find file %s." filename))
+      (set-buffer (find-file-noselect filename))
       (semantic-lex-spp-write-test))))
 
-
 (provide 'cedet/semantic/lex-spp-utest)
 
 ;;; lex-spp-utest.el ends here



reply via email to

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