From 7661178135c78a554a634f4879e533a202b564f9 Mon Sep 17 00:00:00 2001 From: zappo Date: Tue, 16 Mar 2010 03:04:42 +0000 Subject: [PATCH] Improve compilation error checking * test/manual/cedet/cedet-integ-test.el (cit-compile-and-wait): Pull out error checking. Add support for stripping erroneous events. (cit-check-compilation-for-error): New, from above. --- test/manual/cedet/cedet-integ-test.el | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/test/manual/cedet/cedet-integ-test.el b/test/manual/cedet/cedet-integ-test.el index e62ae74ef0b..66e5cacf14b 100644 --- a/test/manual/cedet/cedet-integ-test.el +++ b/test/manual/cedet/cedet-integ-test.el @@ -1,6 +1,6 @@ ;;; cedet-integ-test.el --- CEDET full integration tests. -;; Copyright (C) 2008, 2009 Eric M. Ludlam +;; Copyright (C) 2008, 2009, 2010 Eric M. Ludlam ;; Author: Eric M. Ludlam @@ -328,26 +328,36 @@ such as 'clean'." (compile (concat ede-make-command (or ARGS ""))) (cit-wait-for-compilation) + (cit-check-compilation-for-error) (kill-buffer bufftokill) )) (defun cit-wait-for-compilation () "Wait for a compilation to finish." - (while compilation-in-progress (accept-process-output) - (sit-for 1)) + ;; If sit for indicates that input is waiting, then + ;; read and discard whatever it is that is going on. + (when (not (sit-for 1)) + (read-event nil nil .1) + )) + ) +(defun cit-check-compilation-for-error (&optional inverse) + "Error if the compilation buffer has errors in it. +If optional INVERSE is non-nil, then throw an error if the +compilation succeeded." (save-excursion (set-buffer "*compilation*") (goto-char (point-max)) - (when (re-search-backward " Error " nil t) - (error "Compilation failed!")) - - ) - ) + (if (re-search-backward "Compilation exited abnormally " nil t) + (when (not inverse) + (error "Compilation failed!")) + (when inverse + (error "Compilation succeeded erroneously!")) + ))) (defun cit-run-target (command) "Run the program (or whatever) that is associated w/ the current target. -- 2.39.2