7 Commits

Author SHA1 Message Date
Ingo Karkat
2937a8b316 Merge branch 'fix/stderr' 2023-01-21 19:51:40 +01:00
Ingo Karkat
e1c1c328a2 Robustness: Check for broken symlinks to custom actions and complain
Instead of potentially falling back to the built-in action that a custom action was intended to override, but (e.g. due to file system reorganizations) now results in a broken link. The extension functionality that is then skipped may result in undesired results, but this may not be immedately obvious to the user (if the extension is not particularly verbose), so some data corruption could occur if this remains undetected.
To avoid duplicating (or somehow extracting) all the built-in actions, simply detect _any_ broken symlink; i.e. offer a superset of the required functionality. So this would also complain about a broken symlink to a non-executable custom (auxiliary) file (rarely used) if that is mistakenly passed as a custom action (unlikely).

Fixes #359
2021-09-16 22:15:00 +02:00
Ingo Karkat
99e5e57a75 Refactoring: Extract make_action into actions-test-lib.sh.
This reduces the duplication in the individual test files.
2012-04-27 12:42:10 +02:00
Ingo Karkat
3b90d09b27 Add testing of todo_completion.
Before adding any more features to todo_completion, I feel like I need test coverage, so this is a first stab at testing the completion results, via a new test function test_todo_completion.
Some basic tests showcase the capabilities.

Note: test-lib.sh now uses arrays, therefore all tests must use /bin/bash, not /bin/sh to avoid errors when sourcing test-lib. For consistency with todo.sh, we should have used Bash everywhere, anyway. Also note that t2000-multiline.sh needs some more quoting to avoid "Bash: ambiguous redirect" errors.
2012-02-23 09:14:41 +01:00
Ingo Karkat
a82fd58363 Skipping 'nonexecutable action' test on Cygwin.
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 instead of failing.
2011-01-20 15:34:46 +01:00
Ingo Karkat
819a8285cc Factored out generation of custom action scripts.
- Reduced duplication via common make_action() function.
- ENH: Adding proper shebang line to the custom action scripts.
- Changed output of custom action to better differentiate from todo.sh output.
2011-01-20 15:07:47 +01:00
Ingo Karkat
f72c1034ee Added tests for custom actions (TODO_ACTIONS_DIR).
t0002-actions.sh for locating the .todo.actions.d directory.
t8000-actions.sh for the contract between todo.sh and custom actions.
2010-06-29 10:43:53 +02:00