]> eyrie.org Git - kerberos/krb5-strength.git/blobdiff - tests/util/messages-krb5-t.c
Update to rra-c-util 5.7 and C TAP Harness 4.1
[kerberos/krb5-strength.git] / tests / util / messages-krb5-t.c
index 8015c4e62943f952667f0923f0d8525a99a9a873..8113198473d38d27536a019578bf24b1b9815e5a 100644 (file)
@@ -2,10 +2,10 @@
  * Test suite for Kerberos error handling routines.
  *
  * The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
  *
  * Written by Russ Allbery <eagle@eyrie.org>
- * Copyright 2010, 2011, 2013
+ * Copyright 2010, 2011, 2013, 2014
  *     The Board of Trustees of the Leland Stanford Junior University
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  */
 
 #include <config.h>
-#include <portable/krb5.h>
+#ifdef HAVE_KRB5
+# include <portable/krb5.h>
+#endif
 #include <portable/system.h>
 
 #include <tests/tap/basic.h>
 #include <tests/tap/process.h>
 #include <util/macros.h>
-#include <util/messages-krb5.h>
+#ifdef HAVE_KRB5
+# include <util/messages-krb5.h>
+#endif
 #include <util/messages.h>
 #include <util/xmalloc.h>
 
 
+/* Skip the whole test if not built with Kerberos support. */
+#ifndef HAVE_KRB5
+int
+main(void)
+{
+    skip_all("not built with Kerberos support");
+    return 0;
+}
+#else
+
 /*
  * Test functions.
  */
@@ -120,3 +134,5 @@ main(void)
     krb5_free_context(ctx);
     return 0;
 }
+
+#endif /* HAVE_KRB5 */