test: fix test_require_external_prereq()
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Mon, 28 Nov 2011 22:41:04 +0000 (02:41 +0400)
committerDavid Bremner <bremner@debian.org>
Thu, 1 Dec 2011 01:22:28 +0000 (17:22 -0800)
test_missing_external_prereq_${binary}_ variable indicates that the
binary is missing.  It must be set in test_declare_external_prereq()
outside of the fake $binary() function.

test/test-lib.sh

index 11e66465108bb952d09443adfe0f68dbf29654e8..d7282ff66efa6cc237cfe56d20567a170694ffab 100644 (file)
@@ -554,8 +554,8 @@ test_declare_external_prereq () {
        test "$#" = 2 && name=$2 || name="$binary(1)"
 
        hash $binary 2>/dev/null || eval "
-$binary () {
        test_missing_external_prereq_${binary}_=t
+$binary () {
        echo -n \"\$test_subtest_missing_external_prereqs_\" | grep -e \" $name \" ||
        test_subtest_missing_external_prereqs_=\"$test_subtest_missing_external_prereqs_ $name\"
        false