From: David Engster Date: Thu, 1 Dec 2011 19:13:55 +0000 (+0100) Subject: Fix unit testing for several tests and do better error checking. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dacde104b09fee00255fc8a85e25e0e111017d8f;p=emacs.git 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. --- diff --git a/test/manual/cedet/cedet/semantic/lex-spp-utest.el b/test/manual/cedet/cedet/semantic/lex-spp-utest.el index 9721d6a4bf5..8ecfcfb8a60 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