tests: wrap the valgrind-requiring assertion in a function

* tests/init.cfg (require_valgrind_): New function...
* tests/misc/sort-stale-thread-mem: ...extracted from here.
This commit is contained in:
Jim Meyering committed 2012-08-18 07:39:49 +02:00
1 parent 574b7c7dbe
commit b8104e47ca
2 files changed
+7 -1

No files matched your search

+6
View File
@@ -160,6 +160,12 @@ require_strace_()
fi
}
# Skip the current test if valgrind doesn't work.
require_valgrind_()
{
valgrind --help >/dev/null || skip_ "requires valgrind"
}
require_setfacl_()
{
setfacl -m user::rwx . \
+1 -1
View File
@@ -22,8 +22,8 @@
print_ver_ sort
very_expensive_
require_valgrind_
valgrind --help >/dev/null || skip_ "requires valgrind"
grep '^#define HAVE_PTHREAD_T 1' "$CONFIG_HEADER" > /dev/null ||
skip_ 'requires pthreads'