libfort/tests/test.c

54 lines
1.6 KiB
C
Raw Normal View History

2018-01-01 09:26:34 +01:00
#include "tests.h"
#include <stdio.h>
2018-05-06 13:11:03 +02:00
#include "fort.h"
2018-01-01 09:26:34 +01:00
2018-05-06 13:11:03 +02:00
void run_test_suit(const char *test_suit_name, int n_tests, struct test_case test_suit[])
{
fprintf(stderr, " == RUNNING %s ==\n", test_suit_name);
fprintf(stderr, "[==========] Running %d test(s).\n", n_tests);
int i;
for (i = 0; i < n_tests; ++i) {
fprintf(stderr, "[ RUN ] %s\n", test_suit[i].name);
test_suit[i].test();
fprintf(stderr, "[ OK ] %s\n", test_suit[i].name);
}
fprintf(stderr, "[==========] %d test(s) run.\n", n_tests);
fprintf(stderr, "[ PASSED ] %d test(s).\n", n_tests);
}
struct test_case wb_test_suit [] = {
{"test_vector_basic", test_vector_basic},
2018-04-22 20:42:22 +02:00
{"test_vector_stress", test_vector_stress},
2018-03-19 21:07:18 +01:00
{"test_string_buffer", test_string_buffer},
{"test_table_sizes", test_table_sizes},
{"test_table_geometry", test_table_geometry},
2018-05-06 13:11:03 +02:00
};
struct test_case bb_test_suit [] = {
{"test_table_basic", test_table_basic},
2018-04-16 20:01:45 +02:00
#ifdef FT_HAVE_WCHAR
{"test_wcs_table_boundaries", test_wcs_table_boundaries},
2018-04-16 20:01:45 +02:00
#endif
2018-03-20 18:57:50 +01:00
{"test_table_write", test_table_write},
2018-03-19 21:07:18 +01:00
{"test_table_border_style", test_table_border_style},
2018-03-25 10:11:08 +02:00
{"test_table_cell_options", test_table_cell_options},
{"test_table_tbl_options", test_table_tbl_options},
{"test_memory_errors", test_memory_errors},
};
2018-01-01 09:26:34 +01:00
2018-05-06 13:11:03 +02:00
2018-03-31 12:33:37 +02:00
int main(void)
{
2018-05-06 13:11:03 +02:00
int wb_n_tests = sizeof(wb_test_suit) / sizeof(wb_test_suit[0]);
run_test_suit("WHITE BOX TEST SUITE", wb_n_tests, wb_test_suit);
fprintf(stderr, "\n");
int bb_n_tests = sizeof(bb_test_suit) / sizeof(bb_test_suit[0]);
run_test_suit("BLACK BOX TEST SUITE", bb_n_tests, bb_test_suit);
return 0;
2018-01-01 09:26:34 +01:00
}