fix path descending from root

This commit is contained in:
Thomas Levine 2016-02-28 12:14:16 +00:00
parent 0ce5e3dcac
commit 5df65fb6a1

44
urchin
View File

@ -79,11 +79,10 @@ indent() {
recurse() {
set -e
root="$1"
requested_path="$2"
potential_test="$3"
shell_for_sh_tests="$4"
TEST_SHELL="$5"
requested_path="$1"
potential_test="$(fullpath "$2")"
shell_for_sh_tests="$3"
TEST_SHELL="$4"
for ignore in setup_dir teardown_dir setup teardown; do
if test "$potential_test" = $ignore; then
@ -91,17 +90,14 @@ recurse() {
fi
done
pwd
echo $potential_test
fullpath "$potential_test"
echo $requested_path
if ! fullpath "$requested_path" |
grep "^$(fullpath "$potential_test")" > /dev/null; then
if fullpath "$requested_path" |grep Command > /dev/null; then
echo "echo '$(fullpath "$potential_test")' |
grep '^$(fullpath "$requested_path")' > /dev/null"
fi
return
if echo "$requested_path" | grep "^$potential_test" > /dev/null ||
echo "$potential_test" | grep "^$requested_path" > /dev/null; then
echo Considering $potential_test
else
if echo "$potential_test" | grep Command; then
echo $potential_test
fi
return 0
fi
if test $(echo "$potential_test" | wc -l) -ne 1; then
@ -123,8 +119,8 @@ fi
urchin_source setup
set +e
recurse "$root" "$requested_path" \
"${test}" "$shell_for_sh_tests" "$TEST_SHELL"
recurse "$requested_path" "$test" "$shell_for_sh_tests" "$TEST_SHELL"
exit_code=$?
set -e
@ -412,13 +408,11 @@ if basename "$(fullpath "$root")" |
start=$(date +%s)
set +e
# 1 urchin root
# 2 test file or folder to run
# 3 urchin root again (this changes later)
# 4 shell to invoke test scripts with
# 5 TEST_SHELL
recurse "$root" "$(fullpath "$1")" \
"$root" "$shell_for_sh_tests" "$TEST_SHELL"
# 1 test file or folder to run
# 2 urchin root
# 3 shell to invoke test scripts with
# 4 TEST_SHELL
recurse "$(fullpath "$1")" "$root" "$shell_for_sh_tests" "$TEST_SHELL"
exit_code=$?
set -e