Add automated test suite for systab

44 tests covering job creation, status, logs, pause/resume,
notifications, time format parsing, error cases, and cleanup.
Tests run against real systemd user timers with automatic cleanup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthias Johnson 2026-02-14 22:50:17 -07:00
parent 32ac2c3d5f
commit d19709dc1f
2 changed files with 320 additions and 7 deletions

View file

@ -31,16 +31,12 @@ Key functions: `parse_time` (time spec → OnCalendar), `_write_unit_files` (sha
## Testing
There are no automated tests. Test manually with systemd user timers:
```bash
./systab -t "every 5 minutes" -c "echo test"
./systab -S
./systab -L
./systab -P <id>
./systab -R <id>
./systab -C
./test.sh
```
Runs 44 tests against real systemd user timers covering job creation, status, logs, pause/resume, notifications, time format parsing, error cases, and cleanup. All test jobs are cleaned up automatically via trap.
## Notes
- ShellCheck can be used for linting: `shellcheck systab`.