Attempt to package CL unit testing with Nix
My first foray trying to package Common Lisp with Nix. I'm using @tazjin's buildLisp and other libraries, all of which I'm importing as `tpkgs`, and all of which have been a tremendous boon to my productivity.
This commit is contained in:
parent
55860debe5
commit
d262d30543
7 changed files with 128 additions and 0 deletions
17
common-lisp/anaphora.nix
Normal file
17
common-lisp/anaphora.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ tpkgs ? (import (builtins.fetchGit "https://git.tazj.in/") {}), ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
src = builtins.fetchGit {
|
||||||
|
url = "https://github.com/tokenrove/anaphora.git";
|
||||||
|
rev = "aeace4c68cf55098a67112750b28f8f2dc6d0e30";
|
||||||
|
};
|
||||||
|
in tpkgs.nix.buildLisp.library {
|
||||||
|
name = "anaphora";
|
||||||
|
deps = [];
|
||||||
|
srcs = [
|
||||||
|
"${src}/packages.lisp"
|
||||||
|
"${src}/early.lisp"
|
||||||
|
"${src}/symbolic.lisp"
|
||||||
|
"${src}/anaphora.lisp"
|
||||||
|
];
|
||||||
|
}
|
20
common-lisp/cl-colors.nix
Normal file
20
common-lisp/cl-colors.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{ tpkgs ? (import (builtins.fetchGit "https://git.tazj.in/") {}), ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
src = builtins.fetchGit {
|
||||||
|
url = "https://github.com/tpapp/cl-colors.git";
|
||||||
|
rev = "827410584553f5c717eec6182343b7605f707f75";
|
||||||
|
};
|
||||||
|
in tpkgs.nix.buildLisp.library {
|
||||||
|
name = "cl-colors";
|
||||||
|
deps = with tpkgs.third_party.lisp; [
|
||||||
|
alexandria
|
||||||
|
(import ./let-plus.nix {})
|
||||||
|
];
|
||||||
|
srcs = [
|
||||||
|
"${src}/package.lisp"
|
||||||
|
"${src}/colors.lisp"
|
||||||
|
"${src}/colornames.lisp"
|
||||||
|
"${src}/hexcolors.lisp"
|
||||||
|
];
|
||||||
|
}
|
13
common-lisp/default.nix
Normal file
13
common-lisp/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ tpkgs ? (import (builtins.fetchGit "https://git.tazj.in/") {}), ... }:
|
||||||
|
|
||||||
|
tpkgs.nix.buildLisp.program {
|
||||||
|
name = "unit-testing";
|
||||||
|
|
||||||
|
deps = with tpkgs.third_party.lisp; [
|
||||||
|
(import ./prove.nix {})
|
||||||
|
];
|
||||||
|
|
||||||
|
srcs = [
|
||||||
|
./unit-testing.lisp
|
||||||
|
];
|
||||||
|
}
|
19
common-lisp/let-plus.nix
Normal file
19
common-lisp/let-plus.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ tpkgs ? (import (builtins.fetchGit "https://git.tazj.in/") {}), ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
src = builtins.fetchGit {
|
||||||
|
url = "https://github.com/tpapp/let-plus.git";
|
||||||
|
rev = "7cf18b29ed0fe9c667a9a6a101b08ab9661a59e9";
|
||||||
|
};
|
||||||
|
in tpkgs.nix.buildLisp.library {
|
||||||
|
name = "let-plus";
|
||||||
|
deps = with tpkgs.third_party.lisp; [
|
||||||
|
alexandria
|
||||||
|
(import ./anaphora.nix {})
|
||||||
|
];
|
||||||
|
srcs = [
|
||||||
|
"${src}/package.lisp"
|
||||||
|
"${src}/let-plus.lisp"
|
||||||
|
"${src}/extensions.lisp"
|
||||||
|
];
|
||||||
|
}
|
15
common-lisp/prove-asdf.nix
Normal file
15
common-lisp/prove-asdf.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{ tpkgs ? (import (builtins.fetchGit "https://git.tazj.in/") {}), ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
src = builtins.fetchGit {
|
||||||
|
url = "https://github.com/fukamachi/prove.git";
|
||||||
|
rev = "5d71f02795b89e36f34e8c7d50e69b67ec6ca2de";
|
||||||
|
};
|
||||||
|
in tpkgs.nix.buildLisp.library {
|
||||||
|
name = "prove-asdf";
|
||||||
|
deps = [];
|
||||||
|
srcs = [
|
||||||
|
"${src}/src/output.lisp"
|
||||||
|
"${src}/src/asdf.lisp"
|
||||||
|
];
|
||||||
|
}
|
31
common-lisp/prove.nix
Normal file
31
common-lisp/prove.nix
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{ tpkgs ? (import (builtins.fetchGit "https://git.tazj.in/") {}), ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
src = builtins.fetchGit {
|
||||||
|
url = "https://github.com/fukamachi/prove.git";
|
||||||
|
rev = "5d71f02795b89e36f34e8c7d50e69b67ec6ca2de";
|
||||||
|
};
|
||||||
|
in tpkgs.nix.buildLisp.library {
|
||||||
|
name = "prove";
|
||||||
|
deps = with tpkgs.third_party.lisp; [
|
||||||
|
cl-ppcre
|
||||||
|
cl-ansi-text
|
||||||
|
(import ./cl-colors.nix {})
|
||||||
|
alexandria
|
||||||
|
uiop
|
||||||
|
];
|
||||||
|
srcs = [
|
||||||
|
"${src}/src/asdf.lisp"
|
||||||
|
"${src}/src/suite.lisp"
|
||||||
|
"${src}/src/color.lisp"
|
||||||
|
"${src}/src/output.lisp"
|
||||||
|
"${src}/src/prove.lisp"
|
||||||
|
"${src}/src/report.lisp"
|
||||||
|
"${src}/src/reporter.lisp"
|
||||||
|
"${src}/src/test.lisp"
|
||||||
|
"${src}/src/reporter/dot.lisp"
|
||||||
|
"${src}/src/reporter/fiveam.lisp"
|
||||||
|
"${src}/src/reporter/list.lisp"
|
||||||
|
"${src}/src/reporter/tap.lisp"
|
||||||
|
];
|
||||||
|
}
|
13
common-lisp/unit-testing.lisp
Normal file
13
common-lisp/unit-testing.lisp
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
(in-package #:cl-user)
|
||||||
|
(defpackage #:my-test
|
||||||
|
(:documentation "Unit testing in Common Lisp.")
|
||||||
|
(:use #:cl))
|
||||||
|
(in-package #:my-test)
|
||||||
|
|
||||||
|
(plan 3)
|
||||||
|
|
||||||
|
(ok (not (find 4 '(1 2 3))))
|
||||||
|
(is 4 4)
|
||||||
|
(isnt 1 #\1)
|
||||||
|
|
||||||
|
(finalize)
|
Loading…
Reference in a new issue