Commit graph

16 commits

Author SHA1 Message Date
Laurence Warne
74a972cace Skip proced refine tests on Darwin
* test/lisp/proced-tests.el (proced-refine-test)
(proced-refine-with-update-test): Skip if the system is Darwin.
2024-11-22 09:36:31 +01:00
Laurence Warne
926d47ab2c Don't error in Proced tests if %CPU is a NaN
* test/lisp/proced-tests.el (proced--cpu-at-point): New function.
(proced--assert-process-valid-cpu-refinement)
(proced-refine-test, proced-refine-with-update-test): If %CPU for any
process visited is a NaN skip the test.
(proced-update-preserves-pid-at-point-test): Fix typo in comment.
(proced--assert-process-valid-cpu-refinement-explainer): Add process
attributes to the explainer along with tweaking how the process %CPU is
obtained to account for circumstances where it's not numeric (most
notably '-nan').
2024-11-15 16:22:52 +01:00
Michael Albinus
37b1799c9e ; Instrument proced-tests.el further
* test/lisp/proced-tests.el
(proced--assert-process-valid-cpu-refinement): Explain also Lisp errors.
2024-11-04 14:24:21 +01:00
Laurence Warne
98796f95fa Work on proced-tests.el
* test/lisp/proced-tests.el
(proced--assert-process-valid-cpu-refinement-explainer): New function
for explaining refinement test failures in greater detail.
2024-10-30 15:12:13 +01:00
Laurence Warne
7a8ca202c5 Fix flakey proced refine tests (Bug#73441)
* test/lisp/proced-tests.el (proced-refine-test)
(proced-refine-with-update-test): Use the much simpler CPU refinement
for testing 'proced-refine'.  The previous tests made the incorrect
assumption that refining on the PID of process A only filtered the
buffer to contain process A and its children, whereas in actuality
the children of process A's children, their children, and so on will
also be shown.
(proced-update-preserves-pid-at-point-test): Mark as unstable.
2024-10-27 16:50:20 +01:00
Michael Albinus
3f94b979d8 ; Remove proced-tests.el instrumentation (Do not merge with master) 2024-10-26 18:55:46 +02:00
Michael Albinus
75584a3a96 ; * test/lisp/proced-tests.el (proced--within-buffer): Instrument macro.
Do not merge with master
2024-10-23 17:01:08 +02:00
Po Lu
070cb32463 ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
Stefan Kangas
06a12b0ccc ; Fix typos 2023-12-10 13:22:04 +01:00
Stefan Kangas
53162eff8d ; Fix copyright year in proced-tests.el 2023-08-29 21:40:38 +02:00
Laurence Warne
586bdd6f9a Fix unstable Proced refine tests
* test/lisp/proced-tests.el (proced-refine-test)
(proced-refine-with-update-test): Also check if the parent
process id of each process matches the process id refined
on before failing, since the refiner for process id returns
the children of a process in addition to the process itself.
(Bug#64800)
2023-07-26 17:09:23 +03:00
Laurence Warne
e6299d2783 Fix unstable proced test
Fix unstable proced test by omitting the revert parameter in
'proced-update'.  This was caused by the process being refined on
exiting between the initial 'proced' call and the successive
'proced-update' call.  This resulted in proced skipping the refinement
in 'proced-update', causing all processes to be shown again and the
test to fail.

* test/lisp/proced-tests.el (proced-refine-with-update-test): Do not
use revert parameter when calling 'proced-update'.
2023-05-28 13:35:25 +02:00
Mattias Engdegård
2aee38d826 Mark proced-refine-with-update-test :unstable (bug#63550)
* test/lisp/proced-tests.el (proced-refine-with-update-test):
This test seems racy and often fails randomly in parallel
`make check`.
2023-05-17 11:39:25 +02:00
Laurence Warne
f0ac01812f Preserve the window position with proced (bug#60381)
Preserve the window position for windows which display a proced
buffer, but are not the selected window when a proced buffer is
updated.  Previously, the window position would be set to the
start of the buffer when a proced buffer was updated and it was
not displayed in the selected window.

Similarly, preserve the position in proced buffers which are not
displayed in any window by setting
'switch-to-buffer-preserve-window-point' to nil in proced buffers.

* lisp/proced.el (proced-auto-update-timer): Only update a given
proced buffer if it is displayed in a window.
(proced-update): Set the window position if the proced buffer is
displayed in a window.
(proced--position-info, proced--determine-pos): New Functions.
(proced-mode): Set 'switch-to-buffer-preserve-window-point' to
nil in proced buffers.
* test/lisp/proced-tests.el
(proced-update-preserves-pid-at-point-test): New test.
2023-01-14 10:36:15 +02:00
Eli Zaretskii
3b573f7d1f Make proced-tests work on more systems
* test/lisp/proced-tests.el (proced-format-test)
(proced-update-test, proced-revert-test, proced-color-test):
Remove the 'skip-unless' condition, as it is unnecessary.
(proced-refine-test, proced-refine-with-update-test): Use PID, not
Args, as the column to test, as PID is more portable.
2022-12-14 16:53:29 +02:00
Laurence Warne
e22a71443a Add tests for proced
* test/lisp/proced-tests.el: New file.
2022-12-14 16:34:39 +02:00