2020-01-01 17:15:07 +01:00
|
|
|
#include "test.h"
|
|
|
|
#include "translit.h"
|
2020-01-02 16:12:51 +01:00
|
|
|
#include "transcript.h"
|
2020-01-07 13:18:54 +01:00
|
|
|
#include "encoder.h"
|
2020-01-01 17:15:07 +01:00
|
|
|
|
|
|
|
static Suite *create_test_suite()
|
|
|
|
{
|
|
|
|
Suite *suite;
|
|
|
|
TCase *test_case;
|
|
|
|
|
|
|
|
suite = suite_create(NULL);
|
|
|
|
test_case = tcase_create(NULL);
|
|
|
|
|
|
|
|
register_translit_tests(test_case);
|
2020-01-02 16:12:51 +01:00
|
|
|
register_transcript_tests(test_case);
|
2020-01-07 13:18:54 +01:00
|
|
|
register_encoder_tests(test_case);
|
2020-01-01 17:15:07 +01:00
|
|
|
suite_add_tcase(suite, test_case);
|
|
|
|
|
|
|
|
return suite;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
Suite *suite;
|
|
|
|
SRunner *runner;
|
|
|
|
int retval;
|
|
|
|
|
|
|
|
suite = create_test_suite();
|
|
|
|
runner = srunner_create(suite);
|
|
|
|
|
2020-01-01 17:52:21 +01:00
|
|
|
puts("-----------------------------------------");
|
2020-01-01 17:15:07 +01:00
|
|
|
srunner_run_all(runner, CK_NORMAL);
|
|
|
|
retval = srunner_ntests_failed(runner);
|
2020-01-01 17:52:21 +01:00
|
|
|
puts("-----------------------------------------");
|
|
|
|
|
|
|
|
puts(retval == 0 ? "\033[32mpassed\033[0m\n"
|
|
|
|
: "\033[31mfailed\033[0m\n");
|
|
|
|
|
2020-01-01 17:15:07 +01:00
|
|
|
srunner_free(runner);
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|