Code review. Split tests up
[openssl.git] / test / uitest.c
index 84fe71b22d5fca7ef1d66dfe7eb299d33469efe7..0a7420d4d1ae0d8806af59c2ab128f858973c58b 100644 (file)
@@ -9,10 +9,27 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <openssl/opensslconf.h>
 #include <openssl/err.h>
-#include <openssl/ui.h>
+
+/*
+ * We know that on VMS, the [.apps] object files are compiled with uppercased
+ * symbols.  We must therefore follow suit, or there will be linking errors.
+ * Additionally, the VMS build does stdio via a socketpair.
+ */
+#ifdef __VMS
+# pragma names save
+# pragma names uppercase, truncated
+
+# include "../apps/vms_term_sock.h"
+#endif
+
 #include "../apps/apps.h"
 
+#ifdef __VMS
+# pragma names restore
+#endif
+
 #include "testutil.h"
 #include "test_main_custom.h"
 
@@ -20,6 +37,9 @@
 char *default_config_file = NULL;
 BIO *bio_err = NULL;
 
+#ifndef OPENSSL_NO_UI
+# include <openssl/ui.h>
+
 /* Old style PEM password callback */
 static int test_pem_password_cb(char *buf, int size, int rwflag, void *userdata)
 {
@@ -99,14 +119,18 @@ static int test_new_ui()
     return ok;
 }
 
+#endif
+
 int test_main(int argc, char *argv[])
 {
     int ret;
 
     bio_err = dup_bio_err(FORMAT_TEXT);
 
+#ifndef OPENSSL_NO_UI
     ADD_TEST(test_old);
     ADD_TEST(test_new_ui);
+#endif
 
     ret = run_tests(argv[0]);