* 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
__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);
/*
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.
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 */