Fix API correctness, add tests, license and docs#1
Merged
Conversation
- package.lisp: export only the real API; drop the slot-name symbols that were never defined as callable functions - sysinfo.lisp: implement the previously-exported sysinfo-list and sysinfo-alist; add uptime-duration (now using the local-time-duration dependency); replace the generic error with a typed sysinfo-error condition carrying the syscall return code - grovel.lisp: declare loads as :ulong to match the C struct and the reads in decode-loads - cl-sysinfo.asd: add a FiveAM-based cl-sysinfo/test system wired up via test-op - test/sysinfo-test.lisp: verify sane sysinfo values and that the plist, alist and list representations agree - README.md: document Linux-only support, the mem_unit scaling, and the full API - LICENSE: add the LLGPL preamble
- sysinfo.lisp: derived accessors (sysinfo-alist, sysinfo-list, uptime-duration) now take an optional pre-fetched plist, so callers can pass a single consistent snapshot (and avoid an extra syscall) - test/sysinfo-test.lisp: representations-agree now derives all three views from one fetch, removing the cross-syscall flakiness; uptime-duration test asserts exact second equality; add a test for the sysinfo-error report - sysinfo.lisp: sysinfo-error now captures C errno (via sb-alien on SBCL, NIL elsewhere) and renders strerror() text in its report; export sysinfo-error-errno - sysinfo-list docstring no longer claims a fully flat list - README: document the optional info arg and sysinfo-error-errno - add .github/workflows/ci.yml running the suite on SBCL and CCL via Roswell
- .gitignore for fasls, ASDF/Roswell caches and editor cruft - CHANGELOG.md (Keep a Changelog format) - .github/dependabot.yml to keep GitHub Actions versions current - richer .asd metadata (long-description, maintainer, homepage, bug-tracker, source-control) for Quicklisp/Ultralisp - README: CI badge, changelog link, and a note about scripts/run-tests.sh - scripts/run-tests.sh helper for running the suite locally via Roswell
The 40ants/setup-lisp action requires a LISP env var and qlot semantics; it failed with 'Env variable LISP was not set.'. Replace it with a direct Roswell install + ros use + scripts/run-tests.sh, mirroring the locally-verified test invocation.
Silences the Node 20 deprecation warning.
c362e9e to
c31fd8d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Review-driven cleanup of the
cl-sysinfobindings. All changes were verified by loading the system and running the test suite with SBCL (15/15 checks pass).Bug fixes
sysinfo-listandsysinfo-alistwere exported but never defined — they now exist, derived fromsysinfoso they stay in sync.uptime,totalram, …) were exported as if they were callable functions; they weren't.package.lispnow exports only the real API.loadstype fixed.grovel.lispdeclaredloadsas:long, but the C struct isunsigned long loads[3]anddecode-loadsreads:ulong. Now declared:ulong.local-time-durationwas declared but never referenced; addeduptime-durationwhich returns the uptime as alocal-time-duration:duration.Improvements
(error "...")replaced with asysinfo-errorcondition (subclass oferror) exposing the syscall return code viasysinfo-error-code.cl-sysinfo/testsystem (FiveAM), wired in viaasdf:test-system. Checks sane field values and that the plist / alist / list representations agree.mem_unitbyte scaling, and the full API in a field table.LICENSEfile with the LLGPL preamble.Verification
🤖 Generated with Claude Code