]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix unit testing for several tests and do better error checking.
authorDavid Engster <dengste@eml.cc>
Thu, 1 Dec 2011 19:13:55 +0000 (20:13 +0100)
committerEdward John Steere <edward.steere@gmail.com>
Wed, 25 Jan 2017 15:47:55 +0000 (17:47 +0200)
* 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

index 9721d6a4bf5ae4ed67717ac0deaf8b08f0343799..8ecfcfb8a600f5693ce0fcd31195db838e36f0f1 100644 (file)
 (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