From d504f83141a8c5e5848d1a2f2bb8d468c79362fa Mon Sep 17 00:00:00 2001 From: Thomas Levine <_@thomaslevine.com> Date: Wed, 2 Mar 2016 22:02:21 +0000 Subject: [PATCH] skip non-executable directories --- tests/Skipping/setup | 1 + urchin | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/Skipping/setup b/tests/Skipping/setup index 6c12883..5793c0b 100644 --- a/tests/Skipping/setup +++ b/tests/Skipping/setup @@ -1,3 +1,4 @@ export tmp=$(mktemp -d) export testsuite=$tmp/test +mkdir -p $testsuite touch $testsuite/.urchin diff --git a/urchin b/urchin index ca98676..60e589b 100755 --- a/urchin +++ b/urchin @@ -140,7 +140,8 @@ recurse() { validate_strings "${potential_test}" 'Test file names' - if [ -d "${potential_test}" ]; then + if [ -x "${potential_test}" ]; then + if [ -d "${potential_test}" ]; then ( cd -- "${potential_test}" if test -f setup_dir; then . ./setup_dir; fi @@ -174,8 +175,7 @@ recurse() { wait if test -f teardown_dir; then . ./teardown_dir; fi ) - else - if [ -x "${potential_test}" ]; then + elif [ -f "${potential_test}" ]; then cd -- "$(dirname -- "${potential_test}")" # Determine the environment variable to define for test scripts @@ -235,9 +235,11 @@ recurse() { done < "${shell_list}" wait else - # Shell is '' - printf "${potential_test}\t\tskip\t0\n" >> "${urchin_tmp}"/log + echo "${potential_test}: Neither file nor directory!?" > /dev/stderr fi + else + # Shell is '' + printf "${potential_test}\t\tskip\t0\n" >> "${urchin_tmp}"/log fi }