testutil: Move printing function declarations to "internal" header
[openssl.git] / test / testutil.h
index d266fd52889ab80917f3dc4d2547d674cb1f31e8..66b9e814ee9669188b7aee92292d3ee82566887d 100644 (file)
  * Simple parameterized tests. Calls test_function(idx) for each 0 <= idx < num.
  */
 # define ADD_ALL_TESTS(test_function, num) \
-  add_all_tests(#test_function, test_function, num)
+    add_all_tests(#test_function, test_function, num, 1)
+/*
+ * A variant of the same without TAP output.
+ */
+# define ADD_ALL_TESTS_NOSUBTEST(test_function, num) \
+    add_all_tests(#test_function, test_function, num, 0)
 
 /*-
  * Test cases that share common setup should use the helper
@@ -131,7 +136,8 @@ void setup_test(void);
 __owur int finish_test(int ret);
 
 void add_test(const char *test_case_name, int (*test_fn) ());
-void add_all_tests(const char *test_case_name, int (*test_fn)(int idx), int num);
+void add_all_tests(const char *test_case_name, int (*test_fn)(int idx), int num,
+                   int subtest);
 __owur int run_tests(const char *test_prog_name);
 
 /*
@@ -176,7 +182,13 @@ DECLARE_COMPARISONS(char, char)
 DECLARE_COMPARISONS(unsigned char, uchar)
 DECLARE_COMPARISONS(long, long)
 DECLARE_COMPARISONS(unsigned long, ulong)
+/*
+ * Because this comparison uses a printf format specifier that's not
+ * universally known (yet), we provide an option to not have it declared.
+ */
+# ifndef TESTUTIL_NO_size_t_COMPARISON
 DECLARE_COMPARISONS(size_t, size_t)
+# endif
 
 /*
  * Pointer comparisons against other pointers and null.
@@ -343,23 +355,9 @@ void test_info_c90(const char *desc, ...) PRINTF_FORMAT(1, 2);
             OPENSSL_assert(!#condition);        \
         }                                       \
     } while (0)
-#endif                          /* HEADER_TESTUTIL_H */
-
-
-/*
- * The basic I/O functions used by the test framework.  These can be
- * overriden when needed. Note that if one is, then all must be.
- */
-void test_open_streams(void);
-void test_close_streams(void);
-/* The following ALL return the number of characters written */
-int test_puts_stdout(const char *str);
-int test_puts_stderr(const char *str);
-int test_vprintf_stdout(const char *fmt, va_list ap);
-int test_vprintf_stderr(const char *fmt, va_list ap);
-/* These return failure or success */
-int test_flush_stdout(void);
-int test_flush_stderr(void);
 
 extern BIO *bio_out;
 extern BIO *bio_err;
+
+int subtest_level(void);
+#endif                          /* HEADER_TESTUTIL_H */