Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TESTSFIX: t8010-listaddons breaks on Cygwin #388

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions tests/actions-test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,19 @@ echo "custom action $1 in folder $1"
EOF
chmod +x ".todo.actions.d/$1/$1"
}

invalidate_action()
{
local customActionFilespec="${1:?}"; shift
local testName="${1:?}"; shift

chmod -x "$customActionFilespec"
# On Cygwin, clearing the executable flag may have no effect, as the Windows
# ACL may still grant execution rights. In this case, we skip the test, and
# remove the (still valid) custom action so that it doesn't break following
# tests.
if [ -x "$customActionFilespec" ]; then
SKIP_TESTS="${SKIP_TESTS}${SKIP_TESTS+ }${testName}"
rm -- "$customActionFilespec"
fi
}
15 changes: 2 additions & 13 deletions tests/t8010-listaddons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ ls
quux
EOF

chmod -x .todo.actions.d/foo
# On Cygwin, clearing the executable flag may have no effect, as the Windows ACL
# may still grant execution rights. In this case, we skip the test.
if [ -x .todo.actions.d/foo ]; then
SKIP_TESTS="${SKIP_TESTS}${SKIP_TESTS+ }t8010.4"
fi
invalidate_action .todo.actions.d/foo t8010.4
test_todo_session 'nonexecutable action' <<EOF
>>> todo.sh listaddons
bar
Expand Down Expand Up @@ -66,13 +61,7 @@ norris
quux
EOF

# nthorne: shamelessly stolen from above..
chmod -x .todo.actions.d/norris/norris
# On Cygwin, clearing the executable flag may have no effect, as the Windows ACL
# may still grant execution rights. In this case, we skip the test.
if [ -x .todo.actions.d/norris/norris ]; then
SKIP_TESTS="${SKIP_TESTS}${SKIP_TESTS+ }t8010.8"
fi
invalidate_action .todo.actions.d/norris/norris t8010.8
test_todo_session 'nonexecutable action in subfolder' <<EOF
>>> todo.sh listaddons
bar
Expand Down