aboutsummaryrefslogtreecommitdiff
path: root/tests/test-chime-notify.el
Commit message (Collapse)AuthorAgeFilesLines
* fix: play the chime through an external player when one is availableCraig Jennings9 days1-4/+9
| | | | | | | | | | | | Emacs' play-sound-file opens an ALSA device directly, so it fails with "No usable sound device driver found" wherever ALSA's default PCM doesn't resolve. That's every PipeWire system where nothing points pcm.!default at the sound server. It also blocks Emacs until the clip finishes, and on macOS it isn't compiled in at all. chime now hands the file to the first of pw-play, paplay, afplay or aplay found on exec-path, spawned asynchronously. I put aplay last because it speaks raw ALSA and shares play-sound-file's failure mode, so falling back to it from a broken default PCM would buy nothing. With no external player installed, play-sound-file still runs, now taking chime-sound-device as its DEVICE argument. Two new defcustoms: chime-sound-player (auto, emacs, or a command name) and chime-sound-device. Both default to today's behavior for anyone whose sound already works. A player that spawns and then exits non-zero is reported through a process sentinel rather than failing silently. The sentinel doesn't fall back to play-sound-file, which would reintroduce the blocking ALSA call this change avoids. I pinned the notify tests to emacs so they mock one function and never spawn a real player.
* test: add chime-deftest fixture macro and centralize test requiresCraig Jennings2026-06-241-3/+0
| | | | | | | | | | Every test hand-wrote the same scaffolding: call a per-file setup, wrap the body in unwind-protect, call a per-file teardown. That's 419 unwind-protect blocks and 68 near-identical setup/teardown defuns, with no shared fixture because ERT has no native per-test setup. I added a chime-deftest macro in test-bootstrap that creates the test base directory before the body and deletes it afterward, even on failure. I converted the 10 files whose fixture was exactly that base-dir create/delete and whose every test followed the standard shape, dropping their setup/teardown defuns. Files with custom fixtures (modeline state restore, validation reset) keep explicit setup/teardown, since the macro would silently drop their extra logic. I left the 4 tag-bearing integration files alone. I also moved the near-universal testutil-general and testutil-time requires into test-bootstrap, so individual files no longer repeat them. Behavior is unchanged: still 800 tests, full suite green. Converted bodies are copied verbatim, so the change only removes scaffolding, never an assertion.
* refactor!: drop chime-play-sound, use chime-sound-file = nil to disableCraig Jennings2026-05-051-31/+8
| | | | | | | | | | | | | | | | | `chime-play-sound' was redundant with `chime-sound-file' — both had to be truthy for sound to play, and `chime-sound-file' already documented "set to nil to disable sound completely". Two knobs for one decision is a trap. I removed the defcustom and the `(when chime-play-sound ...)' guard in `chime--notify' (it now just checks `chime-sound-file'). Tests, README quick-start, and the troubleshooting checklist all reference the new single-knob form. One redundant test (sound-disabled-via-the-toggle) got dropped because it now duplicates the sound-file-nil case. Breaking change: users with `(setq chime-play-sound nil)' in their config will get a void-variable warning at customize time and lose their disable. Migration: `(setq chime-sound-file nil)'.
* Extract test boilerplate into shared test-bootstrap.elCraig Jennings2026-04-041-14/+1
| | | | | | | | | | All 50 test files that load chime.el repeated the same 8-line initialization block (package-initialize, ert, dash, alert, async, org-agenda, chime load). Replace with a single require of test-bootstrap.el. Also fix test-make-upcoming-item name collision between test-chime-make-tooltip.el and test-chime--deduplicate-events-by-title.el.
* Update copyright years to 2026 across all source filesCraig Jennings2026-02-171-1/+1
| | | | | Updated 41 files: chime.el, chime-debug.el, chime-org-contacts.el, convert-org-contacts-birthdays.el, and all test/utility files.
* changed repositoriesCraig Jennings2025-11-181-0/+259