[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/merge-cedet-tests da23314 286/316: Don't fail the
From: |
Edward John Steere |
Subject: |
[Emacs-diffs] scratch/merge-cedet-tests da23314 286/316: Don't fail the test for errors which don't mean a failure |
Date: |
Sat, 28 Jan 2017 09:10:11 +0000 (UTC) |
branch: scratch/merge-cedet-tests
commit da233147bf9dba4cf2f9429f4e10b50b92dbfc72
Author: Eric Ludlam <address@hidden>
Commit: Edward John Steere <address@hidden>
Don't fail the test for errors which don't mean a failure
* test/manual/cedet/cit-externaldb.el: (cit-externaldb-test): Catch
failures that shouldn't fail tests. (cit-externaldb-cleanup): New
(cit-gnu-externaldb-test-one): Catch if the create fails from the
external program, cleanup, and throw. Improve fail messages to help
identify problems.
---
test/manual/cedet/cit-externaldb.el | 57 ++++++++++++++++++++++++-----------
1 file changed, 40 insertions(+), 17 deletions(-)
diff --git a/test/manual/cedet/cit-externaldb.el
b/test/manual/cedet/cit-externaldb.el
index 34dfd45..e241c48 100644
--- a/test/manual/cedet/cit-externaldb.el
+++ b/test/manual/cedet/cit-externaldb.el
@@ -90,14 +90,26 @@
(message "Skipping %s test -- tool not installed." (nth 0 TOOL))
(sit-for 1))
- ;; Call to test this instance.
- (cit-gnu-externaldb-test-one (nth 0 TOOL)
- (nth 3 TOOL)
- (nth 4 TOOL)
- (nth 6 TOOL)
- (nth 7 TOOL)
- (nth 8 TOOL)
- ))))
+ (catch 'abort-test-for-good-reason
+ ;; Call to test this instance.
+ (cit-gnu-externaldb-test-one (nth 0 TOOL)
+ (nth 3 TOOL)
+ (nth 4 TOOL)
+ (nth 6 TOOL)
+ (nth 7 TOOL)
+ (nth 8 TOOL)
+ ))
+ )))
+
+(defun cit-externaldb-cleanup (cleanupfiles)
+ "Clean up the files created by a database."
+ ;; Delete the files created by external tool.
+ (dolist (F cleanupfiles)
+ (if (file-exists-p F)
+ (progn
+ (message "DB Cleanup: delete-file %s" F)
+ (delete-file F))
+ (message "DB Cleanup: File not found to delete: %s" F))))
(defun cit-gnu-externaldb-test-one (symrefsym
createfcn
@@ -107,11 +119,22 @@
cleanupfiles)
"Test external database tooling integration if it is available."
(let ((bufftokill (find-file (cit-file "Project.ede"))))
-
;; 1) Create
;; We are at the root of the created CIT project. Lets create a
;; database.
- (funcall createfcn default-directory)
+ (condition-case findcrash
+ (funcall createfcn default-directory)
+ (error
+ (if (and (eq (car findcrash) 'error)
+ (string-match "^Output:" (cadr findcrash)))
+ (progn
+ (message " !! Database create external program crashed !!
Aborting test for %S\n"
+ symrefsym)
+ (message "%S" (cadr findcrash))
+ (cit-externaldb-cleanup cleanupfiles)
+ (throw 'abort-test-for-good-reason t))
+ ;; ELSE, throw the actual error.
+ (message "An error occured creating the database.\n %S" findcrash))))
;; 2) force ede's find file to use external tool
(require 'ede/locate)
@@ -170,18 +193,18 @@
;; 4) Symref symbol lookup via our external tool
(setq semantic-symref-tool 'detect)
- (when (not (eq (semantic-symref-detect-symref-tool) symrefsym))
- (error "Symref doesn't recognize %s backend." symrefsym))
+ (let ((detectedtool (semantic-symref-detect-symref-tool)))
+ (when (not (eq detectedtool symrefsym))
+ (error "Symref doesn't recognize %s backend. Found %s instead"
+ symrefsym detectedtool)))
;; Do the tests again.
(cit-symref-quick-find-test)
- ;; Delete the files created by external tool.
- (dolist (F cleanupfiles)
- (when (file-exists-p F)
- (delete-file F)))
+ (cit-externaldb-cleanup cleanupfiles)
- (kill-buffer bufftokill)))
+ (kill-buffer bufftokill))
+ )
(provide 'cit-externaldb)
- [Emacs-diffs] scratch/merge-cedet-tests ad45c79 263/316: Remove obsolete cvs-auto-updated 'X-RCS' line., (continued)
- [Emacs-diffs] scratch/merge-cedet-tests ad45c79 263/316: Remove obsolete cvs-auto-updated 'X-RCS' line., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 9e6abad 241/316: Run the code for the compiled binary, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 5a2a1da 293/316: (priority): Set to a low number. (cit-project-template): New template., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 7f7d6bf 229/316: Synchronize cedet/srecode with Emacs., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 66c8eb7 256/316: Remove useless generated skeleton and old NEWS, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 86ed340 147/316: Additions to detection testing, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests a7926fd 155/316: detect-utest.el: (ede-detect-utest-configdir): New fcn (ede-detect-utest-arduino-install): New faux install dir (ede-detect-utest-init-dirmatch): Point at fake intalldir to get fake board., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 446edba 291/316: Base template for cit testing., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 760fef4 309/316: Fix typo, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 07892f6 287/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests da23314 286/316: Don't fail the test for errors which don't mean a failure,
Edward John Steere <=
- [Emacs-diffs] scratch/merge-cedet-tests 764db86 236/316: (cit-remove-add-to-project-cpp): Wait for make to finish., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests b804ecf 166/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 11d45fa 170/316: Restructure and improve output, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests a93bc4a 292/316: Remove obsolete cvs-auto-updated 'X-RCS' line., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests ce2952b 312/316: Revert rev. 6995, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests a78c71f 255/316: Fix documentation, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 41c7498 284/316: Better skip message, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 32b1d6c 260/316: First pass of creating a distribution., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 9679584 296/316: Remove compatibility function `cedet-called-interactively-p'., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests f8e3bbc 311/316: Return fully qualified types if necessary., Edward John Steere, 2017/01/28