Skip to content
Snippets Groups Projects
Commit 67ea58d5 authored by Rommel M. Martinez's avatar Rommel M. Martinez
Browse files

Updated source registry test script

parent 7c184ec6
No related branches found
No related tags found
No related merge requests found
...@@ -107,8 +107,8 @@ fi ...@@ -107,8 +107,8 @@ fi
#fi #fi
create_asds () { create_asds () {
mkdir -p tmp/{dir1,dir2/{dir3,dir4}} mkdir -p tmp/{conf.d,dir1,dir2/{dir3,dir4}}
for i in `find tmp | sed -e '1d'`; do touch "$i"/test.asd; done for i in `find tmp | sed -e '1d;/conf.d/d'`; do touch "$i"/test.asd; done
} }
clean_up () { clean_up () {
......
...@@ -16,9 +16,25 @@ ...@@ -16,9 +16,25 @@
(defvar *test-directory* (defvar *test-directory*
(pathname->directory (getenv "TEST_DIR"))) (pathname->directory (getenv "TEST_DIR")))
(defvar *test-conf-directory*
(merge-pathnames "conf.d/" *test-directory*))
(defun under-test-directory (path &optional (defaults *test-directory*)) (defun under-test-directory (path &optional (defaults *test-directory*))
(merge-pathnames path defaults)) (merge-pathnames path defaults))
(defun create-conf-files (&optional (path *test-conf-directory*))
(let ((v `(("conf1.conf"
((:directory ,(namestring (under-test-directory "dir1/")))))
("conf2.conf"
((:tree ,(namestring (under-test-directory "dir2/"))))))))
(loop
:for (file contents) :in v :do
(with-open-file (out file
:direction :output
:if-exists :supersede)
(with-standard-io-syntax
(format out "~{~S~}" contents))))))
(defvar *test-config-1* (defvar *test-config-1*
`(:source-registry `(:source-registry
(:directory ,(namestring (under-test-directory "dir1/"))) (:directory ,(namestring (under-test-directory "dir1/")))
...@@ -37,6 +53,7 @@ ...@@ -37,6 +53,7 @@
test-something-3)) test-something-3))
(cl-user::quit-on-error (cl-user::quit-on-error
(create-conf-files)
(assert (equal (process-source-registry (assert (equal (process-source-registry
(getenv "CL_SOURCE_REGISTRY")) (getenv "CL_SOURCE_REGISTRY"))
*test-expect-1*)) *test-expect-1*))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment