several bug fixes, simplify to just one script file
[lnf] / test / test
index d3a5eac00b8976fc42db94d7c0c2729a46f5cb78..692938a4e26ec6faeeb8713d4fe63e8fded309a0 100755 (executable)
--- a/test/test
+++ b/test/test
@@ -61,7 +61,8 @@ docases() {
     done
 }
 
-source ${0%/*}/../lnf-function
+PATH="$(readlink -f ${0%/*}/..):$PATH"
+
 # might want to undo this if things go wrong
 # set -x
 
@@ -69,12 +70,13 @@ source ${0%/*}/../lnf-function
 set -E;
 trap 'echo "${BASH_COMMAND:+BASH_COMMAND=\"$BASH_COMMAND\" }
 ${FUNCNAME:+FUNCNAME=\"$FUNCNAME\" }${LINENO:+LINENO=\"$LINENO\"  }\$?=$?"' ERR
-cd $(mktemp -d)
+tempdir=$(mktemp -d)
+cd $tempdir
 docases
 # test again, using rm -rf in place of trash-put.
-# assumes that rm is in /bin and trash-put is in /usr/bin
-PATH="${PATH//:\/usr\/bin}"
-PATH="${PATH//\/usr\/bin:}"
+trash-put() { rm -rf -- "$@"; }
+export -f trash-put
 docases
 
+rm -rf $tempdir
 echo tests concluded