1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-10 00:00:39 -08:00
emacs/test/lisp/erc/erc-scenarios-scrolltobottom.el
F. Jason Park c83a2d1509 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.
2023-12-27 21:32:25 -08:00

68 lines
2.5 KiB
EmacsLisp

;;; erc-scenarios-scrolltobottom.el --- erc-scrolltobottom-mode -*- lexical-binding: t -*-
;; Copyright (C) 2023 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
;; GNU Emacs 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 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Code:
(require 'ert-x)
(eval-and-compile
(let ((load-path (cons (ert-resource-directory) load-path)))
(require 'erc-scenarios-common)))
(require 'erc-goodies)
;; These two actually seem to run fine on Emacs 28, but skip them for
;; now to stay in sync with `erc-scenarios-scrolltobottom--relaxed'.
(ert-deftest erc-scenarios-scrolltobottom--normal ()
:tags `(:expensive-test ,@(and (getenv "ERC_TESTS_GRAPHICAL")
'(:erc--graphical)))
(when (version< emacs-version "29") (ert-skip "Times out"))
(should-not erc-scrolltobottom-all)
(erc-scenarios-common-scrolltobottom--normal
(lambda ()
(ert-info ("New insertion doesn't anchor prompt in other window")
(let ((w (next-window)))
;; We're at prompt but not aligned to bottom.
(should (>= (window-point w) erc-input-marker))
(erc-d-t-wait-for 10
(not (erc-scenarios-common--at-win-end-p w))))))))
(ert-deftest erc-scenarios-scrolltobottom--all ()
:tags `(:expensive-test ,@(and (getenv "ERC_TESTS_GRAPHICAL")
'(:erc--graphical)))
(when (version< emacs-version "29") (ert-skip "Times out"))
(should-not erc-scrolltobottom-all)
(let ((erc-scrolltobottom-all t))
(erc-scenarios-common-scrolltobottom--normal
(lambda ()
(ert-info ("New insertion anchors prompt in other window")
(let ((w (next-window)))
;; We're at prompt and aligned to bottom.
(should (>= (window-point w) erc-input-marker))
(erc-d-t-wait-for 10
(erc-scenarios-common--at-win-end-p w))
(erc-d-t-ensure-for 0.5
(erc-scenarios-common--at-win-end-p w))))))))
;;; erc-scenarios-scrolltobottom.el ends here