diff options
| author | F. Jason Park | 2023-12-23 15:23:44 -0800 |
|---|---|---|
| committer | F. Jason Park | 2023-12-27 21:32:25 -0800 |
| commit | c83a2d15097e39d2a46d898f7731ca592c59e5a7 (patch) | |
| tree | 9a838dc77d9b5966d834034fe3543f9f0ccae1ef /test | |
| parent | 7576926bea34c45ea9b035b59b8a9d3967311f60 (diff) | |
| download | emacs-c83a2d15097e39d2a46d898f7731ca592c59e5a7.tar.gz emacs-c83a2d15097e39d2a46d898f7731ca592c59e5a7.zip | |
Allow selecting graphical ERC tests manually
* test/lisp/erc/erc-fill-tests.el
(erc-fill-wrap--monospace, erc-fill-wrap--merge,
erc-fill-wrap-tests--merge-action,
erc-fill-wrap-tests--merge-action/indicator-pre,
erc-fill-wrap-tests--merge-action/indicator-post,
erc-fill-line-spacing, erc-fill-wrap-visual-keys--body,
erc-fill-wrap-visual-keys--prompt, erc-fill--left-hand-stamps): Tag as
:erc--graphcial.
* test/lisp/erc/erc-scenarios-internal.el
(erc-scenarios-internal--run-interactive-all): New test to assist ERC
contributors in -jN parallel runs.
* test/lisp/erc/erc-scenarios-scrolltobottom-relaxed.el
(erc-scenarios-scrolltobottom--relaxed): Tag as :erc--graphical.
* test/lisp/erc/erc-scenarios-scrolltobottom.el
(erc-scenarios-scrolltobottom--normal,
erc-scenarios-scrolltobottom--all): Tag as :erc--graphical.
* test/lisp/erc/erc-scenarios-status-sidebar.el
(erc-scenarios-status-sidebar--nickbar): Tag as :erc--graphical.
* test/lisp/erc/erc-tests.el (erc--channel-modes/graphic-p): Tag as
:erc--graphical.
* test/lisp/erc/resources/base/local-modules/first.eld: Timeouts.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common--graphical-p): New variable.
(erc-scenarios-common--make-bindings): Don't enable
`inhibit-interaction' when interactive. Set
`erc-scenarios-common--graphical-p' flag when
`:erc--graphical' tag present and running interactively.
(erc-scenarios-common-with-cleanup): Account for variable
`erc-scenarios-common--graphical-p'.
(erc-scenarios-common-scrolltobottom--normal): Turn off
`erc-scrolltobottom-mode' when test finishes so as not to pollute when
running multiple interactive tests.
; * test/lisp/erc/resources/join/network-id/barnet.eld: Timeouts.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/erc/erc-fill-tests.el | 27 | ||||
| -rw-r--r-- | test/lisp/erc/erc-scenarios-internal.el | 30 | ||||
| -rw-r--r-- | test/lisp/erc/erc-scenarios-scrolltobottom-relaxed.el | 3 | ||||
| -rw-r--r-- | test/lisp/erc/erc-scenarios-scrolltobottom.el | 6 | ||||
| -rw-r--r-- | test/lisp/erc/erc-scenarios-status-sidebar.el | 3 | ||||
| -rw-r--r-- | test/lisp/erc/erc-tests.el | 3 | ||||
| -rw-r--r-- | test/lisp/erc/resources/base/local-modules/first.eld | 6 | ||||
| -rw-r--r-- | test/lisp/erc/resources/erc-scenarios-common.el | 48 | ||||
| -rw-r--r-- | test/lisp/erc/resources/join/network-id/barnet.eld | 2 |
9 files changed, 103 insertions, 25 deletions
diff --git a/test/lisp/erc/erc-fill-tests.el b/test/lisp/erc/erc-fill-tests.el index 8560d421cc2..5e5b1d332ac 100644 --- a/test/lisp/erc/erc-fill-tests.el +++ b/test/lisp/erc/erc-fill-tests.el | |||
| @@ -210,7 +210,8 @@ | |||
| 210 | ;; or similar. | 210 | ;; or similar. |
| 211 | 211 | ||
| 212 | (ert-deftest erc-fill-wrap--monospace () | 212 | (ert-deftest erc-fill-wrap--monospace () |
| 213 | :tags '(:unstable) | 213 | :tags `(:unstable |
| 214 | ,@(and (getenv "ERC_TESTS_GRAPHICAL") '(:erc--graphical))) | ||
| 214 | (unless (>= emacs-major-version 29) | 215 | (unless (>= emacs-major-version 29) |
| 215 | (ert-skip "Emacs version too low, missing `buffer-text-pixel-size'")) | 216 | (ert-skip "Emacs version too low, missing `buffer-text-pixel-size'")) |
| 216 | 217 | ||
| @@ -256,7 +257,8 @@ | |||
| 256 | (erc-fill--wrap-rejigger-region (point-min) erc-insert-marker nil nil)))) | 257 | (erc-fill--wrap-rejigger-region (point-min) erc-insert-marker nil nil)))) |
| 257 | 258 | ||
| 258 | (ert-deftest erc-fill-wrap--merge () | 259 | (ert-deftest erc-fill-wrap--merge () |
| 259 | :tags '(:unstable) | 260 | :tags `(:unstable |
| 261 | ,@(and (getenv "ERC_TESTS_GRAPHICAL") '(:erc--graphical))) | ||
| 260 | (unless (>= emacs-major-version 29) | 262 | (unless (>= emacs-major-version 29) |
| 261 | (ert-skip "Emacs version too low, missing `buffer-text-pixel-size'")) | 263 | (ert-skip "Emacs version too low, missing `buffer-text-pixel-size'")) |
| 262 | 264 | ||
| @@ -341,23 +343,27 @@ | |||
| 341 | (erc-fill-tests--compare compare-file)))) | 343 | (erc-fill-tests--compare compare-file)))) |
| 342 | 344 | ||
| 343 | (ert-deftest erc-fill-wrap--merge-action () | 345 | (ert-deftest erc-fill-wrap--merge-action () |
| 344 | :tags '(:unstable) | 346 | :tags `(:unstable |
| 347 | ,@(and (getenv "ERC_TESTS_GRAPHICAL") '(:erc--graphical))) | ||
| 345 | (erc-fill-wrap-tests--merge-action "merge-wrap-01")) | 348 | (erc-fill-wrap-tests--merge-action "merge-wrap-01")) |
| 346 | 349 | ||
| 347 | (ert-deftest erc-fill-wrap--merge-action/indicator-pre () | 350 | (ert-deftest erc-fill-wrap--merge-action/indicator-pre () |
| 348 | :tags '(:unstable) | 351 | :tags `(:unstable |
| 352 | ,@(and (getenv "ERC_TESTS_GRAPHICAL") '(:erc--graphical))) | ||
| 349 | (let ((erc-fill-wrap-merge-indicator '(pre ?> shadow))) | 353 | (let ((erc-fill-wrap-merge-indicator '(pre ?> shadow))) |
| 350 | (erc-fill-wrap-tests--merge-action "merge-wrap-indicator-pre-01"))) | 354 | (erc-fill-wrap-tests--merge-action "merge-wrap-indicator-pre-01"))) |
| 351 | 355 | ||
| 352 | ;; One crucial thing this test asserts is that the indicator is | 356 | ;; One crucial thing this test asserts is that the indicator is |
| 353 | ;; omitted when the previous line ends in a stamp. | 357 | ;; omitted when the previous line ends in a stamp. |
| 354 | (ert-deftest erc-fill-wrap--merge-action/indicator-post () | 358 | (ert-deftest erc-fill-wrap--merge-action/indicator-post () |
| 355 | :tags '(:unstable) | 359 | :tags `(:unstable |
| 360 | ,@(and (getenv "ERC_TESTS_GRAPHICAL") '(:erc--graphical))) | ||
| 356 | (let ((erc-fill-wrap-merge-indicator '(post ?~ shadow))) | 361 | (let ((erc-fill-wrap-merge-indicator '(post ?~ shadow))) |
| 357 | (erc-fill-wrap-tests--merge-action "merge-wrap-indicator-post-01"))) | 362 | (erc-fill-wrap-tests--merge-action "merge-wrap-indicator-post-01"))) |
| 358 | 363 | ||
| 359 | (ert-deftest erc-fill-line-spacing () | 364 | (ert-deftest erc-fill-line-spacing () |
| 360 | :tags '(:unstable) | 365 | :tags `(:unstable |
| 366 | ,@(and (getenv "ERC_TESTS_GRAPHICAL") '(:erc--graphical))) | ||
| 361 | (unless (>= emacs-major-version 29) | 367 | (unless (>= emacs-major-version 29) |
| 362 | (ert-skip "Emacs version too low, missing `buffer-text-pixel-size'")) | 368 | (ert-skip "Emacs version too low, missing `buffer-text-pixel-size'")) |
| 363 | 369 | ||
| @@ -371,7 +377,8 @@ | |||
| 371 | (erc-fill-tests--compare "spacing-01-mono"))))) | 377 | (erc-fill-tests--compare "spacing-01-mono"))))) |
| 372 | 378 | ||
| 373 | (ert-deftest erc-fill-wrap-visual-keys--body () | 379 | (ert-deftest erc-fill-wrap-visual-keys--body () |
| 374 | :tags '(:unstable) | 380 | :tags `(:unstable |
| 381 | ,@(and (getenv "ERC_TESTS_GRAPHICAL") '(:erc--graphical))) | ||
| 375 | (erc-fill-tests--wrap-populate | 382 | (erc-fill-tests--wrap-populate |
| 376 | 383 | ||
| 377 | (lambda () | 384 | (lambda () |
| @@ -413,7 +420,8 @@ | |||
| 413 | (should-not (looking-at (rx "<alice> "))))))) | 420 | (should-not (looking-at (rx "<alice> "))))))) |
| 414 | 421 | ||
| 415 | (ert-deftest erc-fill-wrap-visual-keys--prompt () | 422 | (ert-deftest erc-fill-wrap-visual-keys--prompt () |
| 416 | :tags '(:unstable) | 423 | :tags `(:unstable |
| 424 | ,@(and (getenv "ERC_TESTS_GRAPHICAL") '(:erc--graphical))) | ||
| 417 | (erc-fill-tests--wrap-populate | 425 | (erc-fill-tests--wrap-populate |
| 418 | 426 | ||
| 419 | (lambda () | 427 | (lambda () |
| @@ -456,7 +464,8 @@ | |||
| 456 | (execute-kbd-macro "\C-a"))))) | 464 | (execute-kbd-macro "\C-a"))))) |
| 457 | 465 | ||
| 458 | (ert-deftest erc-fill--left-hand-stamps () | 466 | (ert-deftest erc-fill--left-hand-stamps () |
| 459 | :tags '(:unstable) | 467 | :tags `(:unstable |
| 468 | ,@(and (getenv "ERC_TESTS_GRAPHICAL") '(:erc--graphical))) | ||
| 460 | (unless (>= emacs-major-version 29) | 469 | (unless (>= emacs-major-version 29) |
| 461 | (ert-skip "Emacs version too low, missing `buffer-text-pixel-size'")) | 470 | (ert-skip "Emacs version too low, missing `buffer-text-pixel-size'")) |
| 462 | 471 | ||
diff --git a/test/lisp/erc/erc-scenarios-internal.el b/test/lisp/erc/erc-scenarios-internal.el index 18eb94e24b0..4ec94cedf0e 100644 --- a/test/lisp/erc/erc-scenarios-internal.el +++ b/test/lisp/erc/erc-scenarios-internal.el | |||
| @@ -28,4 +28,34 @@ | |||
| 28 | load-path))) | 28 | load-path))) |
| 29 | (load "erc-d-tests" nil 'silent))) | 29 | (load "erc-d-tests" nil 'silent))) |
| 30 | 30 | ||
| 31 | ;; Run all tests tagged `:erc--graphical' in an "interactive" | ||
| 32 | ;; subprocess. Time out after 90 seconds. | ||
| 33 | (ert-deftest erc-scenarios-internal--run-graphical-all () | ||
| 34 | :tags '(:expensive-test :unstable) | ||
| 35 | (unless (and (getenv "ERC_TESTS_GRAPHICAL_ALL") | ||
| 36 | (not (getenv "ERC_TESTS_GRAPHICAL")) | ||
| 37 | (not (getenv "CI"))) | ||
| 38 | (ert-skip "Environmental conditions unmet")) | ||
| 39 | |||
| 40 | (let* ((default-directory (expand-file-name "../" (ert-resource-directory))) | ||
| 41 | (libs (directory-files default-directory 'full (rx ".el" eot))) | ||
| 42 | (process-environment (cons "ERC_TESTS_GRAPHICAL=1" | ||
| 43 | process-environment)) | ||
| 44 | (program '(progn (ert (quote (tag :erc--graphical))) | ||
| 45 | (with-current-buffer ert--output-buffer-name | ||
| 46 | (kill-emacs (ert--stats-failed-unexpected | ||
| 47 | ert--results-stats))))) | ||
| 48 | (args `("erc-interactive-all" ,(current-buffer) | ||
| 49 | ,(concat invocation-directory invocation-name) | ||
| 50 | "-Q" "-L" "." "-l" "ert" | ||
| 51 | ,@(let (o) (while libs (push (pop libs) o) (push "-l" o)) o) | ||
| 52 | "-eval" ,(format "%S" program))) | ||
| 53 | (proc (apply #'start-process args))) | ||
| 54 | (set-process-query-on-exit-flag proc nil) | ||
| 55 | |||
| 56 | (erc-d-t-wait-for 90 "interactive tests to complete" | ||
| 57 | (not (process-live-p proc))) | ||
| 58 | |||
| 59 | (should (zerop (process-exit-status proc))))) | ||
| 60 | |||
| 31 | ;;; erc-scenarios-internal.el ends here | 61 | ;;; erc-scenarios-internal.el ends here |
diff --git a/test/lisp/erc/erc-scenarios-scrolltobottom-relaxed.el b/test/lisp/erc/erc-scenarios-scrolltobottom-relaxed.el index 68ea0b1b070..e99a05526f3 100644 --- a/test/lisp/erc/erc-scenarios-scrolltobottom-relaxed.el +++ b/test/lisp/erc/erc-scenarios-scrolltobottom-relaxed.el | |||
| @@ -30,7 +30,8 @@ | |||
| 30 | (require 'erc-goodies) | 30 | (require 'erc-goodies) |
| 31 | 31 | ||
| 32 | (ert-deftest erc-scenarios-scrolltobottom--relaxed () | 32 | (ert-deftest erc-scenarios-scrolltobottom--relaxed () |
| 33 | :tags '(:expensive-test) | 33 | :tags `(:expensive-test |
| 34 | ,@(and (getenv "ERC_TESTS_GRAPHICAL") '(:erc--graphical))) | ||
| 34 | (when (version< emacs-version "29") (ert-skip "Times out")) | 35 | (when (version< emacs-version "29") (ert-skip "Times out")) |
| 35 | 36 | ||
| 36 | (should-not erc-scrolltobottom-all) | 37 | (should-not erc-scrolltobottom-all) |
diff --git a/test/lisp/erc/erc-scenarios-scrolltobottom.el b/test/lisp/erc/erc-scenarios-scrolltobottom.el index 206687ccab5..25b5c09577f 100644 --- a/test/lisp/erc/erc-scenarios-scrolltobottom.el +++ b/test/lisp/erc/erc-scenarios-scrolltobottom.el | |||
| @@ -30,7 +30,8 @@ | |||
| 30 | ;; now to stay in sync with `erc-scenarios-scrolltobottom--relaxed'. | 30 | ;; now to stay in sync with `erc-scenarios-scrolltobottom--relaxed'. |
| 31 | 31 | ||
| 32 | (ert-deftest erc-scenarios-scrolltobottom--normal () | 32 | (ert-deftest erc-scenarios-scrolltobottom--normal () |
| 33 | :tags '(:expensive-test) | 33 | :tags `(:expensive-test ,@(and (getenv "ERC_TESTS_GRAPHICAL") |
| 34 | '(:erc--graphical))) | ||
| 34 | (when (version< emacs-version "29") (ert-skip "Times out")) | 35 | (when (version< emacs-version "29") (ert-skip "Times out")) |
| 35 | 36 | ||
| 36 | (should-not erc-scrolltobottom-all) | 37 | (should-not erc-scrolltobottom-all) |
| @@ -45,7 +46,8 @@ | |||
| 45 | (not (erc-scenarios-common--at-win-end-p w)))))))) | 46 | (not (erc-scenarios-common--at-win-end-p w)))))))) |
| 46 | 47 | ||
| 47 | (ert-deftest erc-scenarios-scrolltobottom--all () | 48 | (ert-deftest erc-scenarios-scrolltobottom--all () |
| 48 | :tags '(:expensive-test) | 49 | :tags `(:expensive-test ,@(and (getenv "ERC_TESTS_GRAPHICAL") |
| 50 | '(:erc--graphical))) | ||
| 49 | (when (version< emacs-version "29") (ert-skip "Times out")) | 51 | (when (version< emacs-version "29") (ert-skip "Times out")) |
| 50 | 52 | ||
| 51 | (should-not erc-scrolltobottom-all) | 53 | (should-not erc-scrolltobottom-all) |
diff --git a/test/lisp/erc/erc-scenarios-status-sidebar.el b/test/lisp/erc/erc-scenarios-status-sidebar.el index b2b6351e333..d447817e307 100644 --- a/test/lisp/erc/erc-scenarios-status-sidebar.el +++ b/test/lisp/erc/erc-scenarios-status-sidebar.el | |||
| @@ -99,7 +99,8 @@ | |||
| 99 | (defvar speedbar-buffer) | 99 | (defvar speedbar-buffer) |
| 100 | 100 | ||
| 101 | (ert-deftest erc-scenarios-status-sidebar--nickbar () | 101 | (ert-deftest erc-scenarios-status-sidebar--nickbar () |
| 102 | :tags '(:unstable :expensive-test) | 102 | :tags `(:expensive-test :unstable ,@(and (getenv "ERC_TESTS_GRAPHICAL") |
| 103 | '(:erc--graphical))) | ||
| 103 | (when noninteractive (ert-skip "Interactive only")) | 104 | (when noninteractive (ert-skip "Interactive only")) |
| 104 | 105 | ||
| 105 | (erc-scenarios-common-with-cleanup | 106 | (erc-scenarios-common-with-cleanup |
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index 1d2090e1027..ffc96eb4f1d 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el | |||
| @@ -886,7 +886,8 @@ | |||
| 886 | (should (equal (erc--channel-modes 0) "klt "))) ; 2 spaces | 886 | (should (equal (erc--channel-modes 0) "klt "))) ; 2 spaces |
| 887 | 887 | ||
| 888 | (ert-deftest erc--channel-modes/graphic-p () | 888 | (ert-deftest erc--channel-modes/graphic-p () |
| 889 | :tags '(:unstable) | 889 | :tags `(:unstable ,@(and (getenv "ERC_TESTS_GRAPHICAL") |
| 890 | '(:erc--graphical))) | ||
| 890 | (unless (display-graphic-p) (ert-skip "See non-/graphic-p variant")) | 891 | (unless (display-graphic-p) (ert-skip "See non-/graphic-p variant")) |
| 891 | 892 | ||
| 892 | (erc-tests--set-fake-server-process "sleep" "1") | 893 | (erc-tests--set-fake-server-process "sleep" "1") |
diff --git a/test/lisp/erc/resources/base/local-modules/first.eld b/test/lisp/erc/resources/base/local-modules/first.eld index f9181a80fb7..4e923270e24 100644 --- a/test/lisp/erc/resources/base/local-modules/first.eld +++ b/test/lisp/erc/resources/base/local-modules/first.eld | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;; -*- mode: lisp-data; -*- | 1 | ;; -*- mode: lisp-data; -*- |
| 2 | ((cap 10 "CAP REQ :sasl")) | 2 | ((cap 10 "CAP REQ :sasl")) |
| 3 | ((nick 1 "NICK tester")) | 3 | ((nick 10 "NICK tester")) |
| 4 | ((user 1 "USER tester 0 * :tester")) | 4 | ((user 10 "USER tester 0 * :tester")) |
| 5 | 5 | ||
| 6 | ((authenticate 5 "AUTHENTICATE PLAIN") | 6 | ((authenticate 5 "AUTHENTICATE PLAIN") |
| 7 | (0.0 ":irc.foonet.org CAP * ACK sasl") | 7 | (0.0 ":irc.foonet.org CAP * ACK sasl") |
| @@ -11,7 +11,7 @@ | |||
| 11 | (0.0 ":irc.foonet.org 900 * * tester :You are now logged in as tester") | 11 | (0.0 ":irc.foonet.org 900 * * tester :You are now logged in as tester") |
| 12 | (0.01 ":irc.foonet.org 903 * :Authentication successful")) | 12 | (0.01 ":irc.foonet.org 903 * :Authentication successful")) |
| 13 | 13 | ||
| 14 | ((cap 3.2 "CAP END") | 14 | ((cap 10 "CAP END") |
| 15 | (0.0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") | 15 | (0.0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") |
| 16 | (0.0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version ergo-v2.8.0") | 16 | (0.0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version ergo-v2.8.0") |
| 17 | (0.2 ":irc.foonet.org 003 tester :This server was created Sun, 20 Nov 2022 23:10:36 UTC") | 17 | (0.2 ":irc.foonet.org 003 tester :This server was created Sun, 20 Nov 2022 23:10:36 UTC") |
diff --git a/test/lisp/erc/resources/erc-scenarios-common.el b/test/lisp/erc/resources/erc-scenarios-common.el index 311d8a82d72..d842454d085 100644 --- a/test/lisp/erc/resources/erc-scenarios-common.el +++ b/test/lisp/erc/resources/erc-scenarios-common.el | |||
| @@ -61,6 +61,25 @@ | |||
| 61 | ;; always associated with the fake network FooNet, while nicks Joe and | 61 | ;; always associated with the fake network FooNet, while nicks Joe and |
| 62 | ;; Mike are always on BarNet. (Networks are sometimes downcased.) | 62 | ;; Mike are always on BarNet. (Networks are sometimes downcased.) |
| 63 | ;; | 63 | ;; |
| 64 | ;; Environment variables: | ||
| 65 | ;; | ||
| 66 | ;; `ERC_TESTS_GRAPHICAL': Internal variable to unskip those few tests | ||
| 67 | ;; capable of running consecutively while interactive on a graphical | ||
| 68 | ;; display. This triggers both the tests and the suite to commence | ||
| 69 | ;; with teardown activities normally skipped to allow for inspection | ||
| 70 | ;; while interactive. This is also handy when needing to quickly | ||
| 71 | ;; run `ert-results-rerun-test-at-point-debugging-errors' on a | ||
| 72 | ;; failing test because you don't have to go around hunting for and | ||
| 73 | ;; killing associated buffers and processes. | ||
| 74 | ;; | ||
| 75 | ;; `ERC_TESTS_GRAPHICAL_ALL': Currently targets a single "meta" test, | ||
| 76 | ;; `erc-scenarios-internal--run-interactive-all', that runs all | ||
| 77 | ;; tests tagged `:erc--graphical' in an interactive subprocess. | ||
| 78 | ;; | ||
| 79 | ;; `ERC_TESTS_SUBPROCESS': Used internally to detect nested tests. | ||
| 80 | ;; | ||
| 81 | ;; `ERC_D_DEBUG': Tells `erc-d' to emit debugging info to stderr. | ||
| 82 | ;; | ||
| 64 | ;; XXX This file should *not* contain any test cases. | 83 | ;; XXX This file should *not* contain any test cases. |
| 65 | 84 | ||
| 66 | ;;; Code: | 85 | ;;; Code: |
| @@ -91,6 +110,7 @@ | |||
| 91 | 110 | ||
| 92 | (defvar erc-scenarios-common-dialog nil) | 111 | (defvar erc-scenarios-common-dialog nil) |
| 93 | (defvar erc-scenarios-common-extra-teardown nil) | 112 | (defvar erc-scenarios-common-extra-teardown nil) |
| 113 | (defvar erc-scenarios-common--graphical-p nil) | ||
| 94 | 114 | ||
| 95 | (defun erc-scenarios-common--add-silence () | 115 | (defun erc-scenarios-common--add-silence () |
| 96 | (advice-add #'erc-login :around #'erc-d-t-silence-around) | 116 | (advice-add #'erc-login :around #'erc-d-t-silence-around) |
| @@ -110,7 +130,11 @@ | |||
| 110 | 130 | ||
| 111 | (eval-and-compile | 131 | (eval-and-compile |
| 112 | (defun erc-scenarios-common--make-bindings (bindings) | 132 | (defun erc-scenarios-common--make-bindings (bindings) |
| 113 | `((erc-d-u-canned-dialog-dir (expand-file-name | 133 | `((erc-scenarios-common--graphical-p |
| 134 | (and (or erc-scenarios-common--graphical-p | ||
| 135 | (memq :erc--graphical (ert-test-tags (ert-running-test)))) | ||
| 136 | (not (and noninteractive (ert-skip "Interactive only"))))) | ||
| 137 | (erc-d-u-canned-dialog-dir (expand-file-name | ||
| 114 | (or erc-scenarios-common-dialog | 138 | (or erc-scenarios-common-dialog |
| 115 | (cadr (assq 'erc-scenarios-common-dialog | 139 | (cadr (assq 'erc-scenarios-common-dialog |
| 116 | ',bindings))) | 140 | ',bindings))) |
| @@ -119,7 +143,7 @@ | |||
| 119 | (quit . ,(erc-quit/part-reason-default)) | 143 | (quit . ,(erc-quit/part-reason-default)) |
| 120 | (erc-version . ,erc-version))) | 144 | (erc-version . ,erc-version))) |
| 121 | (erc-modules (copy-sequence erc-modules)) | 145 | (erc-modules (copy-sequence erc-modules)) |
| 122 | (inhibit-interaction t) | 146 | (inhibit-interaction noninteractive) |
| 123 | (auth-source-do-cache nil) | 147 | (auth-source-do-cache nil) |
| 124 | (timer-list (copy-sequence timer-list)) | 148 | (timer-list (copy-sequence timer-list)) |
| 125 | (timer-idle-list (copy-sequence timer-idle-list)) | 149 | (timer-idle-list (copy-sequence timer-idle-list)) |
| @@ -139,13 +163,19 @@ disabled by BODY. Other defaults common to these test cases are added | |||
| 139 | below and can be overridden, except when wanting the \"real\" default | 163 | below and can be overridden, except when wanting the \"real\" default |
| 140 | value, which must be looked up or captured outside of the calling form. | 164 | value, which must be looked up or captured outside of the calling form. |
| 141 | 165 | ||
| 166 | When running tests tagged as serially runnable while interactive | ||
| 167 | and the flag `erc-scenarios-common--graphical-p' is non-nil, run | ||
| 168 | teardown tasks normally inhibited when interactive. That is, | ||
| 169 | behave almost as if `noninteractive' were also non-nil, and | ||
| 170 | ensure buffers and other resources are destroyed on completion. | ||
| 171 | |||
| 142 | Dialog resource directories are located by expanding the variable | 172 | Dialog resource directories are located by expanding the variable |
| 143 | `erc-scenarios-common-dialog' or its value in BINDINGS." | 173 | `erc-scenarios-common-dialog' or its value in BINDINGS." |
| 144 | (declare (indent 1)) | 174 | (declare (indent 1)) |
| 145 | 175 | ||
| 146 | (let* ((orig-autojoin-mode (make-symbol "orig-autojoin-mode")) | 176 | (let* ((orig-autojoin-mode (make-symbol "orig-autojoin-mode")) |
| 147 | (combined `((,orig-autojoin-mode (bound-and-true-p erc-autojoin-mode)) | 177 | (combined `((,orig-autojoin-mode (bound-and-true-p erc-autojoin-mode)) |
| 148 | ,@(erc-scenarios-common--make-bindings bindings)))) | 178 | ,@(erc-scenarios-common--make-bindings bindings)))) |
| 149 | 179 | ||
| 150 | `(erc-d-t-with-cleanup (,@combined) | 180 | `(erc-d-t-with-cleanup (,@combined) |
| 151 | 181 | ||
| @@ -165,8 +195,9 @@ Dialog resource directories are located by expanding the variable | |||
| 165 | (not (eq erc-autojoin-mode ,orig-autojoin-mode))) | 195 | (not (eq erc-autojoin-mode ,orig-autojoin-mode))) |
| 166 | (erc-autojoin-mode (if ,orig-autojoin-mode +1 -1))) | 196 | (erc-autojoin-mode (if ,orig-autojoin-mode +1 -1))) |
| 167 | 197 | ||
| 168 | (when noninteractive | 198 | (when (or noninteractive erc-scenarios-common--graphical-p) |
| 169 | (erc-scenarios-common--print-trace) | 199 | (when noninteractive |
| 200 | (erc-scenarios-common--print-trace)) | ||
| 170 | (erc-d-t-kill-related-buffers) | 201 | (erc-d-t-kill-related-buffers) |
| 171 | (delete-other-windows))) | 202 | (delete-other-windows))) |
| 172 | 203 | ||
| @@ -179,7 +210,8 @@ Dialog resource directories are located by expanding the variable | |||
| 179 | (erc-d-t-search-for 3 "Starting"))))) | 210 | (erc-d-t-search-for 3 "Starting"))))) |
| 180 | 211 | ||
| 181 | (ert-info ("Activate erc-debug-irc-protocol") | 212 | (ert-info ("Activate erc-debug-irc-protocol") |
| 182 | (unless (and noninteractive (not erc-debug-irc-protocol)) | 213 | (unless (and (or noninteractive erc-scenarios-common--graphical-p) |
| 214 | (not erc-debug-irc-protocol)) | ||
| 183 | (erc-toggle-debug-irc-protocol))) | 215 | (erc-toggle-debug-irc-protocol))) |
| 184 | 216 | ||
| 185 | ,@body))) | 217 | ,@body))) |
| @@ -417,7 +449,9 @@ See Info node `(emacs) Term Mode' for the various commands." | |||
| 417 | (erc-scenarios-common-say "/msg NickServ help identify") | 449 | (erc-scenarios-common-say "/msg NickServ help identify") |
| 418 | ;; New arriving messages trigger a snap when inserted. | 450 | ;; New arriving messages trigger a snap when inserted. |
| 419 | (erc-d-t-wait-for 10 (erc-scenarios-common--at-win-end-p)) | 451 | (erc-d-t-wait-for 10 (erc-scenarios-common--at-win-end-p)) |
| 420 | (funcall expect 10 "IDENTIFY lets you login"))))) | 452 | (funcall expect 10 "IDENTIFY lets you login")) |
| 453 | |||
| 454 | (erc-scrolltobottom-mode -1)))) | ||
| 421 | 455 | ||
| 422 | (cl-defun erc-scenarios-common--base-network-id-bouncer | 456 | (cl-defun erc-scenarios-common--base-network-id-bouncer |
| 423 | ((&key autop foo-id bar-id after | 457 | ((&key autop foo-id bar-id after |
diff --git a/test/lisp/erc/resources/join/network-id/barnet.eld b/test/lisp/erc/resources/join/network-id/barnet.eld index e33dd6be29e..ad6a7c820a9 100644 --- a/test/lisp/erc/resources/join/network-id/barnet.eld +++ b/test/lisp/erc/resources/join/network-id/barnet.eld | |||
| @@ -40,4 +40,4 @@ | |||
| 40 | (0.05 ":mike!~u@6yximxrnkg65a.irc PRIVMSG #chan :joe: And now, dear maid, be you as free to us.") | 40 | (0.05 ":mike!~u@6yximxrnkg65a.irc PRIVMSG #chan :joe: And now, dear maid, be you as free to us.") |
| 41 | (0.00 ":joe!~u@6yximxrnkg65a.irc PRIVMSG #chan :mike: He hath an uncle here in Messina will be very much glad of it.")) | 41 | (0.00 ":joe!~u@6yximxrnkg65a.irc PRIVMSG #chan :mike: He hath an uncle here in Messina will be very much glad of it.")) |
| 42 | 42 | ||
| 43 | ((linger 3.5 LINGER)) | 43 | ((linger 30 LINGER)) |