[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode 576dd29 123/346: tests: Actually test compilation-m
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode 576dd29 123/346: tests: Actually test compilation-mode error list correctness |
Date: |
Sun, 29 Aug 2021 11:00:15 -0400 (EDT) |
branch: elpa/d-mode
commit 576dd294747136a96b47397531505acd4aa423d6
Author: Vladimir Panteleev <git@thecybershadow.net>
Commit: Vladimir Panteleev <git@thecybershadow.net>
tests: Actually test compilation-mode error list correctness
Previously, the test file (I0069.txt) was usable only for manual testing.
Now, compilation-mode correctness can be tested with "make test".
---
d-mode-test.el | 15 +++++++++++++++
tests/I0069.txt | 3 +++
2 files changed, 18 insertions(+)
diff --git a/d-mode-test.el b/d-mode-test.el
index d61a759..51fe53d 100644
--- a/d-mode-test.el
+++ b/d-mode-test.el
@@ -210,11 +210,26 @@
(kill-test-buffer))
(not error-found)))
+(defun d-test-get-compilation-lines ()
+ "Get list of line numbers of lines recognized as errors by
`compilation-mode'.
+
+Called from the #run snippet of individual test files."
+ (compilation-mode)
+ (let (buffer-read-only)
+ (compilation-parse-errors (point-min) (point-max)))
+ (let (error-list)
+ (while (condition-case nil
+ (progn (compilation-next-error 1) t)
+ (error nil))
+ (setq error-list (cons (line-number-at-pos) error-list)))
+ (reverse error-list)))
+
;; Run the tests
(ert-deftest d-mode-basic ()
(should (equal (do-one-test "tests/I0021.d") t))
(should (equal (do-one-test "tests/I0039.d") t))
(should (equal (do-one-test "tests/I0064.d") t))
+ (should (equal (do-one-test "tests/I0069.txt") t))
)
;;----------------------------------------------------------------------------
diff --git a/tests/I0069.txt b/tests/I0069.txt
index 959feac..9e066f8 100644
--- a/tests/I0069.txt
+++ b/tests/I0069.txt
@@ -1,5 +1,8 @@
-*-compilation-*-
+// #run: (d-test-get-compilation-lines)
+// #out: (6 7 9 10 13)
+
foo.d(1): Error: Test error
foo.d(1,1): Error: Column number test
baz.d(3,4): instantiated from here: Continuation test
- [nongnu] elpa/d-mode 29940d7 226/346: Makefile: Add some utility commands, (continued)
- [nongnu] elpa/d-mode 29940d7 226/346: Makefile: Add some utility commands, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode d14a001 239/346: Fix imenu false positive for static imports, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8606775 240/346: Fix imenu jump position for new-style aliases, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 1908f59 236/346: Speed up imenu a bit, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 627a6f8 273/346: Move c-forward-decl-or-cast-1 into d-mode.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode e9278a9 114/346: Reimplement compilation-mode error message detection for DMD, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode aff84c6 115/346: update support for Emacs 25, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode a564656 116/346: Merge pull request #71 from brdjns/patch-1, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 23a3661 119/346: Merge pull request #72 from nordlow/fix-d-exceptions-regexp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode e5d21be 121/346: README: Update shield images and links to use official project repository, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 576dd29 123/346: tests: Actually test compilation-mode error list correctness,
ELPA Syncer <=
- [nongnu] elpa/d-mode 7817dbc 122/346: d-mode-test: Announce mismatched values of inline tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8ccad32 136/346: Simplify cascaded call indentation setup, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 0b8ed61 152/346: Fix highlighting of const variable declarations, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 593e3f5 155/346: Fix extern(C) functions omitted from imenu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 93a62b3 158/346: Fix imenu for functions returning types containing parens, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode a4f0b2d 161/346: Fix imenu for functions prefixed with a version/else, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8771a86 162/346: Convert d-imenu-generic-expression to rx, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 908d55b 170/346: fix #49 - Occasional incorrect fontification of string literals due, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode dea775a 066/346: Merge pull request #35 from wrzoski/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 01997e0 070/346: Add LDC compiler message pattern to be recognized in compilation mode., ELPA Syncer, 2021/08/29