Compare commits
3 Enmetoj
b60858498c
...
0e0e54bf2a
Author | SHA1 | Date | |
---|---|---|---|
Jaidyn Ann | 0e0e54bf2a | ||
Jaidyn Ann | 172a10fdc5 | ||
Jaidyn Ann | b0d3aa2300 |
12
Makefile
12
Makefile
|
@ -15,6 +15,14 @@ quicklisp:
|
||||||
build:
|
build:
|
||||||
$(LISP) --load eksd.asd \
|
$(LISP) --load eksd.asd \
|
||||||
--eval '(ql:quickload :eksd)' \
|
--eval '(ql:quickload :eksd)' \
|
||||||
--eval '(ql:quickload :eksd.unix)' \
|
--eval '(ql:quickload :eksd/unix)' \
|
||||||
--eval '(asdf:make :eksd.unix)' \
|
--eval '(asdf:make :eksd/unix)' \
|
||||||
|
--eval '(quit)'
|
||||||
|
|
||||||
|
test:
|
||||||
|
$(LISP) --load eksd.asd \
|
||||||
|
--eval '(ql:quickload :eksd)' \
|
||||||
|
--eval '(ql:quickload :eksd/unix)' \
|
||||||
|
--eval '(asdf:test-system :eksd)' \
|
||||||
|
--eval '(asdf:test-system :eksd/unix)' \
|
||||||
--eval '(quit)'
|
--eval '(quit)'
|
||||||
|
|
|
@ -54,9 +54,12 @@ $ xxd castlevania.nes | grep -A4 "18e80"
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
Making a binary requires [an implementation](https://common-lisp.net/implementations) of Common Lisp installed: [Steel Bank Common Lisp](https://sbcl.org/) is our implementation-of-choice. It’s available on most operating systems under the package name `sbcl`.
|
Making a binary requires [an implementation](https://common-lisp.net/implementations) of Common Lisp installed:
|
||||||
|
[Steel Bank Common Lisp](https://sbcl.org/) is our implementation-of-choice. It’s available on
|
||||||
|
most operating systems under the package name `sbcl`.
|
||||||
|
|
||||||
You also need the library-manager [Quicklisp](https://quicklisp.org), which can [be installed](https://www.quicklisp.org/beta/#installation) quite easily, including via our [Makefile](Makefile).
|
You also need the library-manager [Quicklisp](https://quicklisp.org), which can [be installed](https://www.quicklisp.org/beta/#installation)
|
||||||
|
quite easily, including via our [Makefile](Makefile).
|
||||||
|
|
||||||
To install Quicklisp, build a binary, and install it, simply:
|
To install Quicklisp, build a binary, and install it, simply:
|
||||||
|
|
||||||
|
|
46
eksd.asd
46
eksd.asd
|
@ -7,9 +7,11 @@
|
||||||
:homepage "https://hak.xwx.moe/jadedctrl/eksd"
|
:homepage "https://hak.xwx.moe/jadedctrl/eksd"
|
||||||
:description "For reading files into hex— `xxd`-like with text-tables."
|
:description "For reading files into hex— `xxd`-like with text-tables."
|
||||||
:depends-on ()
|
:depends-on ()
|
||||||
:components ((:file "src/eksd")))
|
:components ((:file "src/eksd"))
|
||||||
|
:in-order-to ((test-op (test-op "eksd/tests"))
|
||||||
|
(build-op (build-op "eksd/unix"))))
|
||||||
|
|
||||||
(asdf:defsystem "eksd.unix"
|
(asdf:defsystem "eksd/unix"
|
||||||
:version "0.11"
|
:version "0.11"
|
||||||
:license "GPLv3"
|
:license "GPLv3"
|
||||||
:author "Jaidyn Ann <jadedctrl@posteo.at>"
|
:author "Jaidyn Ann <jadedctrl@posteo.at>"
|
||||||
|
@ -18,6 +20,42 @@
|
||||||
:class asdf:program-system
|
:class asdf:program-system
|
||||||
:build-operation "program-op"
|
:build-operation "program-op"
|
||||||
:build-pathname "eksd"
|
:build-pathname "eksd"
|
||||||
:entry-point "eksd.unix:main"
|
:entry-point "eksd/unix:main"
|
||||||
:depends-on (:cl-strings :eksd :unix-opts)
|
:depends-on (:cl-strings :eksd :unix-opts)
|
||||||
:components ((:file "src/unix")))
|
:components ((:file "src/unix"))
|
||||||
|
:in-order-to ((test-op (test-op "eksd/unix/tests"))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;;; Tests
|
||||||
|
;;; —————————————————————————————————————
|
||||||
|
(asdf:defsystem "eksd/tests"
|
||||||
|
:version "0.11"
|
||||||
|
:license "GPLv3"
|
||||||
|
:author "Jaidyn Ann <jadedctrl@posteo.at>"
|
||||||
|
:homepage "https://hak.xwx.moe/jadedctrl/eksd"
|
||||||
|
:description "Tests for the the eksd package."
|
||||||
|
:depends-on (:eksd :lisp-unit2)
|
||||||
|
:components ((:file "t/eksd")))
|
||||||
|
|
||||||
|
(asdf:defsystem "eksd/unix/tests"
|
||||||
|
:version "0.11"
|
||||||
|
:license "GPLv3"
|
||||||
|
:author "Jaidyn Ann <jadedctrl@posteo.at>"
|
||||||
|
:homepage "https://hak.xwx.moe/jadedctrl/eksd"
|
||||||
|
:description "Tests for the eksd.unix package."
|
||||||
|
:depends-on (:eksd/unix :lisp-unit2)
|
||||||
|
:components ((:file "t/unix")))
|
||||||
|
|
||||||
|
|
||||||
|
;; Following methods borrowed from lisp-unit2’s documentation:
|
||||||
|
;; https://github.com/AccelerationNet/lisp-unit2/blob/master/README.md#asdf
|
||||||
|
(defmethod asdf:perform ((o asdf:test-op) (c (eql (asdf:find-system :eksd/tests))))
|
||||||
|
(eval (read-from-string
|
||||||
|
"(lisp-unit2:with-summary ()
|
||||||
|
(lisp-unit2:run-tests :package :eksd/tests))")))
|
||||||
|
|
||||||
|
(defmethod asdf:perform ((o asdf:test-op) (c (eql (asdf:find-system :eksd/unix/tests))))
|
||||||
|
(eval (read-from-string
|
||||||
|
"(lisp-unit2:with-summary ()
|
||||||
|
(lisp-unit2:run-tests :package :eksd/unix/tests))")))
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
;; You should have received a copy of the GNU General Public License
|
;; You should have received a copy of the GNU General Public License
|
||||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
(defpackage :eksd.unix
|
(defpackage :eksd/unix
|
||||||
(:use :cl :eksd)
|
(:use :cl :eksd)
|
||||||
(:export :main
|
(:export :main
|
||||||
*text-table*))
|
*text-table*))
|
||||||
|
|
||||||
(in-package :eksd.unix)
|
(in-package :eksd/unix)
|
||||||
|
|
||||||
|
|
||||||
;;; —————————————————————————————————————
|
;;; —————————————————————————————————————
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
;;;; eksd.tests: Tests for eksd package.
|
||||||
|
|
||||||
|
;; Copyright © 2024 Jaidyn Ann <jadedctrl@posteo.at>
|
||||||
|
;;
|
||||||
|
;; This program 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.
|
||||||
|
;;
|
||||||
|
;; This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
(defpackage :eksd/tests
|
||||||
|
(:use :cl :lisp-unit2)
|
||||||
|
(:export :char-hex.space))
|
||||||
|
|
||||||
|
(in-package :eksd/tests)
|
||||||
|
|
||||||
|
(define-test char-hex.space
|
||||||
|
(:tags '(char-hex))
|
||||||
|
(assert-equal (eksd::char-hex #\space) "20"))
|
|
@ -0,0 +1,27 @@
|
||||||
|
;;;; eksd.unix.tests: Tests for eksd’s UNIX frontend package.
|
||||||
|
|
||||||
|
;; Copyright © 2024 Jaidyn Ann <jadedctrl@posteo.at>
|
||||||
|
;;
|
||||||
|
;; This program 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.
|
||||||
|
;;
|
||||||
|
;; This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
(defpackage :eksd/unix/tests
|
||||||
|
(:use :cl :lisp-unit2)
|
||||||
|
(:export :de-tail))
|
||||||
|
|
||||||
|
(in-package :eksd/unix/tests)
|
||||||
|
|
||||||
|
(define-test de-tail
|
||||||
|
(:tags '(de-tail))
|
||||||
|
(assert-equal (eksd/unix::de-tail '(1 2 3))
|
||||||
|
'(1 2)))
|
Ŝarĝante…
Reference in New Issue