commit bba8b776a124717de445214b6377ee8bef754202
parent 65308b8eb2069d1311d734bc7060f491dfa43180
Author: Alexander Burger <abu@software-lab.de>
Date: Mon, 11 Jul 2011 08:07:38 +0200
"lib/test.l" position independent
Diffstat:
5 files changed, 37 insertions(+), 31 deletions(-)
diff --git a/CHANGES b/CHANGES
@@ -1,4 +1,5 @@
* XXsep11 picoLisp-3.0.8
+ "lib/test.l" position independent
'hash' function
Bug in 'dbFetchEX' for db extensions
diff --git a/lib/test.l b/lib/test.l
@@ -1,30 +1,36 @@
-# 27apr11abu
+# 11jul11abu
# (c) Software Lab. Alexander Burger
### Unit Tests ###
-# $(/bin/pwd)/pil lib/test.l -bye +
+# Local usage:
+# ./pil lib/test.l $(/bin/pwd) -bye +
+
+# Global usage:
+# pil @lib/test.l $(/bin/pwd) -bye +
+
+(setq *PWD (opt))
(test T (pool (tmp "db")))
(load
- "test/src/main.l"
- "test/src/apply.l"
- "test/src/flow.l"
- "test/src/sym.l"
- "test/src/subr.l"
- "test/src/big.l"
- "test/src/io.l"
- "test/src/db.l"
- "test/src/net.l"
- "test/src/ext.l"
- "test/src/ht.l" )
-
-(load "test/lib.l")
-(load "test/lib/misc.l")
-
-(load "test/lib/lint.l")
-
-(load "test/lib/math.l")
+ "@test/src/main.l"
+ "@test/src/apply.l"
+ "@test/src/flow.l"
+ "@test/src/sym.l"
+ "@test/src/subr.l"
+ "@test/src/big.l"
+ "@test/src/io.l"
+ "@test/src/db.l"
+ "@test/src/net.l"
+ "@test/src/ext.l"
+ "@test/src/ht.l" )
+
+(load "@test/lib.l")
+(load "@test/lib/misc.l")
+
+(load "@test/lib/lint.l")
+
+(load "@test/lib/math.l")
(msg 'OK)
diff --git a/test/lib/misc.l b/test/lib/misc.l
@@ -1,4 +1,4 @@
-# 14may11abu
+# 11jul11abu
# (c) Software Lab. Alexander Burger
### locale ###
@@ -209,9 +209,9 @@
### chdir ###
(let P (pwd)
- (chdir "test"
- (test (pwd) (pack P "/test")) )
- (test P (pwd)) )
+ (chdir "/tmp"
+ (test "/tmp" (pwd)) )
+ (test P *PWD) )
### dirname basename ###
diff --git a/test/src/io.l b/test/src/io.l
@@ -1,8 +1,8 @@
-# 09mar11abu
+# 11jul11abu
# (c) Software Lab. Alexander Burger
### path ###
-(test (path '@) (pack (pwd) '/))
+(test *PWD (pwd))
(test (char "+") (char (path "+@")))
diff --git a/test/src/main.l b/test/src/main.l
@@ -1,4 +1,4 @@
-# 10jun11abu
+# 11jul11abu
# (c) Software Lab. Alexander Burger
### alarm ###
@@ -76,13 +76,12 @@
### pwd ###
-(test (path '@) (pack (pwd) '/))
+(test *PWD (pwd))
### cd ###
-(cd "test")
-(test (path "@test") (pwd))
-(cd "..")
+(chdir "/tmp"
+ (test "/tmp" (pwd)) )
### info ###