-
Notifications
You must be signed in to change notification settings - Fork 2
/
.sbclrc
47 lines (36 loc) · 1.63 KB
/
.sbclrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
;; -*- mode: lisp -*-
;;; The following lines added by ql:add-to-init-file:
#-quicklisp
(let ((quicklisp-init (merge-pathnames ".quicklisp/setup.lisp"
(user-homedir-pathname))))
(when (probe-file quicklisp-init)
(load quicklisp-init)))
(defun reset-asdf-registry ()
(asdf:clear-configuration))
(defun add-system-to-registry (name)
(setf (gethash name asdf/source-registry:*source-registry*)
(truename (make-pathname :name name :type "asd"))))
(ql:quickload :alexandria)
(sb-ext:add-package-local-nickname :alex :alexandria-2)
(sb-ext:add-package-local-nickname :alex1 :alexandria-1)
(defpackage :exercism-utils
(:use :cl)
(:export :run-these-tests))
(in-package :exercism-utils)
(defun run-these-tests (&key (use-example-p t))
"Runs the tests for the exercise in the currect directory. Assumes current
directory name is the SLUG of the exercise."
(let* ((slug (first (last (pathname-directory (truename "."))))))
(load (format nil "~A-test.lisp" slug) :verbose t)
(when use-example-p
(let ((example-file (find-if #'probe-file '(".meta/example.lisp" "example.lisp"))))
(if example-file (load example-file :verbose t)
(error 'file-does-not-exist
:pathname "example.lisp"
:message "Expected file to be in in './meta' or './'"))))
(let* ((package (find-package (format nil "~:@(~A-test~)" slug)))
(run-tests (find-symbol "RUN-TESTS" package)))
(funcall run-tests))))
(in-package :cl-user)
(defun cwd () (make-pathname :directory (pathname-directory (truename "."))))
(defun dir () (directory "*.*"))