summaryrefslogtreecommitdiff
path: root/tests/test-lib.sh
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-02-11 20:54:38 +0100
committerJim Meyering <meyering@redhat.com>2008-02-11 21:44:54 +0100
commit6ed90c719e06af86c3515921fab8d07a4c1156bd (patch)
treed1af1864f98423ccd6a60c89e990e1cb1158de91 /tests/test-lib.sh
parent5b954a875681f39d0b51d31475034ef93bd61251 (diff)
downloadcoreutils-6ed90c719e06af86c3515921fab8d07a4c1156bd.tar.xz
tests: Migrate sourced strace file into a function, require_strace_.
* tests/strace: Remove file. * tests/test-lib.sh (require_strace_): New function. * tests/mv/atomic: Use require_strace_, rather than ". strace". * tests/ls/stat-free-symlinks: Likewise. Peter Fales reported that stat-free-symlinks failed without strace.
Diffstat (limited to 'tests/test-lib.sh')
-rw-r--r--tests/test-lib.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test-lib.sh b/tests/test-lib.sh
index b273f1a81..a473dfb31 100644
--- a/tests/test-lib.sh
+++ b/tests/test-lib.sh
@@ -39,6 +39,16 @@ require_ulimit_()
&& skip_test_ "this shell lacks ulimit support"
}
+# Skip the current test if strace is not available or doesn't work.
+require_strace_()
+{
+ strace -V < /dev/null > /dev/null 2>&1 ||
+ skip_test_ 'no strace program'
+
+ strace -qe unlink echo > /dev/null 2>&1 ||
+ skip_test_ 'strace does not work'
+}
+
require_built_()
{
skip_=no