From 67ea58d502fbaec306aafb562bf007601fef5b42 Mon Sep 17 00:00:00 2001
From: "Rommel M. Martinez" <ebzzry@gmail.com>
Date: Wed, 27 Jan 2010 23:49:17 +0800
Subject: [PATCH] Updated source registry test script

---
 test/run-tests.sh           |  4 ++--
 test/test-source-registry.s | 17 +++++++++++++++++
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/test/run-tests.sh b/test/run-tests.sh
index 9649c290..be064e9d 100755
--- a/test/run-tests.sh
+++ b/test/run-tests.sh
@@ -107,8 +107,8 @@ fi
 #fi
 
 create_asds () {
-    mkdir -p tmp/{dir1,dir2/{dir3,dir4}}
-    for i in `find tmp | sed -e '1d'`; do touch "$i"/test.asd; done
+    mkdir -p tmp/{conf.d,dir1,dir2/{dir3,dir4}}
+    for i in `find tmp | sed -e '1d;/conf.d/d'`; do touch "$i"/test.asd; done
 }
 
 clean_up () {
diff --git a/test/test-source-registry.s b/test/test-source-registry.s
index b730857a..c4e9d33c 100644
--- a/test/test-source-registry.s
+++ b/test/test-source-registry.s
@@ -16,9 +16,25 @@
 (defvar *test-directory*
   (pathname->directory (getenv "TEST_DIR")))
 
+(defvar *test-conf-directory*
+  (merge-pathnames "conf.d/" *test-directory*))
+
 (defun under-test-directory (path &optional (defaults *test-directory*))
   (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*
   `(:source-registry
     (:directory ,(namestring (under-test-directory "dir1/")))
@@ -37,6 +53,7 @@
     test-something-3))
 
 (cl-user::quit-on-error
+ (create-conf-files)
  (assert (equal (process-source-registry
                  (getenv "CL_SOURCE_REGISTRY"))
                 *test-expect-1*))
-- 
GitLab