]> eyrie.org Git - kerberos/krb5-strength.git/commitdiff
Skip the Heimdal plugin test if not built with Heimdal
authorRuss Allbery <rra@stanford.edu>
Thu, 10 Dec 2009 06:45:38 +0000 (22:45 -0800)
committerRuss Allbery <rra@stanford.edu>
Thu, 10 Dec 2009 06:45:38 +0000 (22:45 -0800)
tests/heimdal/plugin-t
tests/heimdal/plugin.c

index b2da8a89523be2f41ca4175bfcdfa2e57c6760ca..b6ae4462b376087ce9784238eb91939ec59f088e 100755 (executable)
@@ -45,6 +45,13 @@ if [ -z "$krb5conf" ] ; then
     skip_all 'no krb5.conf found, put one in tests/data/krb5.conf'
 fi
 
+# Check whether we can run the test at all.
+"$BUILD/heimdal/plugin" 'test@EXAMPLE.COM' 'test' >/dev/null 2>&1
+if [ $? = 42 ] ; then
+    rm -f krb5.conf
+    skip_all 'not built against Heimdal libraries'
+fi
+
 # Okay, we should be good to run the test suite.
 plan 28
 
index 92cd1f477f6ee9373d17bc8a3b303f06caff363d..88fdfd5c7db19e8f1f1370120ba0ab46b364cfdb 100644 (file)
@@ -69,6 +69,14 @@ main(int argc, char *argv[])
     int result;
     char error[BUFSIZ] = "";
 
+    /*
+     * If we're not building with Heimdal, we can't run this test.  Exit with
+     * a special status to communicate this to the test wrapper.
+     */
+#ifndef HAVE_KRB5_REALM
+    exit(42);
+#endif
+
     /* Build the path of the plugin. */
     if (argc != 3) {
         fprintf(stderr, "Wrong number of arguments\n");