[Top][All Lists]

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

[elpa] externals/auctex 891bba7 38/69: Add ERT test for error parsing

From: Tassilo Horn
Subject: [elpa] externals/auctex 891bba7 38/69: Add ERT test for error parsing
Date: Sat, 26 Mar 2016 21:36:35 +0000

branch: externals/auctex
commit 891bba7c125e7fff5e0c345e5aab1a28a809902e
Author: Mosè Giordano <address@hidden>
Commit: Mosè Giordano <address@hidden>

    Add ERT test for error parsing
    * tests/tex/compilation-log.txt: Add minimal example of compilation log
      that failed to be parsed correctly with the old parsing function.
    * tests/tex/error-parsing.el: New ERT test.
 tests/tex/compilation-log.txt |    8 ++++++
 tests/tex/error-parsing.el    |   55 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/tests/tex/compilation-log.txt b/tests/tex/compilation-log.txt
new file mode 100644
index 0000000..f28dbf1
--- /dev/null
+++ b/tests/tex/compilation-log.txt
@@ -0,0 +1,8 @@
+[Loading MPS to PDF converter (version 2006.09.02).]
+Package foo Warning: This is a warning!
diff --git a/tests/tex/error-parsing.el b/tests/tex/error-parsing.el
new file mode 100644
index 0000000..aa01629
--- /dev/null
+++ b/tests/tex/error-parsing.el
@@ -0,0 +1,55 @@
+;;; error-parsing.el --- tests for error parsing
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+;; This file is part of AUCTeX.
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; General Public License for more details.
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+;;; Code:
+(require 'ert)
+(require 'tex-buf)
+(defun AUCTeX-set-ert-path (&rest sym-val)
+  "Set first element of SYM-VAL to the next one, and so on.
+The value is the path to the test file, make sure it is expanded
+in the right directory even when the ERT test is run from the
+command line and from another directory."
+  (while sym-val
+    (set (pop sym-val)
+        (expand-file-name (pop sym-val)
+                          (when load-file-name
+                            (file-name-directory load-file-name))))))
+ 'TeX-test-compilation-log
+ "compilation-log.txt")
+(ert-deftest TeX-error-parsing ()
+  "Test error parsing functions."
+  (should (equal
+          (with-temp-buffer
+            (setq TeX-debug-warnings t)
+             (insert-file-contents TeX-test-compilation-log)
+             (TeX-parse-all-errors)
+            TeX-error-list)
+          '((warning "./test.tex" nil "Package foo Warning: This is a warning!"
+                     0 "Package foo Warning: This is a warning!\n"
+                     nil nil nil 170)))))
+;;; error-parsing.el ends here

reply via email to

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