diff --git a/Makefile.am b/Makefile.am index f86f6ed38..5e071d1c2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ ## Process this file with automake to create Makefile.in. -AUTOMAKE_OPTIONS = 1.5 +AUTOMAKE_OPTIONS = 1.12 SUBDIRS = po lib src doc contrib misc diff --git a/contrib/dist/Makefile.am b/contrib/dist/Makefile.am index d521b0c3d..057a9484d 100644 --- a/contrib/dist/Makefile.am +++ b/contrib/dist/Makefile.am @@ -1,8 +1,5 @@ SUBDIRS = gentoo redhat - -AUTOMAKE_OPTIONS = 1.5 - EXTRA_DIST = pkginfo.in prototype.in noinst_DATA = pkginfo prototype diff --git a/doc/HACKING b/doc/HACKING index 0e26aa9fd..32392b9b1 100644 --- a/doc/HACKING +++ b/doc/HACKING @@ -17,7 +17,7 @@ To compile GNU Midnight commander from GIT, the following software is required: Autoconf 2.52 and above (latest is recommended) -Automake 1.5 and above (latest is recommended) +Automake 1.12 and above (latest is recommended) Gettext 0.11.5 and above Glib 2.30 and above diff --git a/doc/INSTALL b/doc/INSTALL index 564862c33..ee3dece7f 100644 --- a/doc/INSTALL +++ b/doc/INSTALL @@ -13,7 +13,7 @@ Build requirements for GNU Midnight Commander - gcc - make - autoconf -- automake +- automake >= 1.12 - libtool - glib2 >= 2.30 - slang2 or ncurses diff --git a/tests/lib/library_independ.c b/tests/lib/library_independ.c index 616d6af35..c23dca336 100644 --- a/tests/lib/library_independ.c +++ b/tests/lib/library_independ.c @@ -43,22 +43,15 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); /* Add new tests here: *************** */ tcase_add_test (tc_core, test_library_independ); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/mc_build_filename.c b/tests/lib/mc_build_filename.c index 0b6b7a4cc..7f8ce6060 100644 --- a/tests/lib/mc_build_filename.c +++ b/tests/lib/mc_build_filename.c @@ -134,11 +134,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -146,13 +144,7 @@ main (void) mctest_add_parameterized_test (tc_core, test_mc_build_filename, test_mc_build_filename_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "mc_build_filename.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/mc_realpath.c b/tests/lib/mc_realpath.c index 31415ac85..30caf5e03 100644 --- a/tests/lib/mc_realpath.c +++ b/tests/lib/mc_realpath.c @@ -109,12 +109,10 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; char *cwd; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); /* writable directory where check creates temporary files */ cwd = g_get_current_dir (); @@ -127,13 +125,7 @@ main (void) mctest_add_parameterized_test (tc_core, realpath_test, data_source); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "mc_realpath.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/mcconfig/config_string.c b/tests/lib/mcconfig/config_string.c index da479de59..9d32e652c 100644 --- a/tests/lib/mcconfig/config_string.c +++ b/tests/lib/mcconfig/config_string.c @@ -238,11 +238,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -251,13 +249,7 @@ main (void) tcase_add_test (tc_core, emulate__learn_save); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "config_string.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/mcconfig/user_configs_path.c b/tests/lib/mcconfig/user_configs_path.c index 75e483e7f..8b879c2fe 100644 --- a/tests/lib/mcconfig/user_configs_path.c +++ b/tests/lib/mcconfig/user_configs_path.c @@ -211,11 +211,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -223,13 +221,7 @@ main (void) mctest_add_parameterized_test (tc_core, test_user_config_paths, test_user_config_paths_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "user_configs_path.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/name_quote.c b/tests/lib/name_quote.c index eb5056d7d..20a217332 100644 --- a/tests/lib/name_quote.c +++ b/tests/lib/name_quote.c @@ -128,11 +128,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -141,13 +139,7 @@ main (void) mctest_add_parameterized_test (tc_core, name_quote_test, data_source2); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "name_quote.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/search/glob_prepare_replace_str.c b/tests/lib/search/glob_prepare_replace_str.c index ed6adaf13..963c23a5c 100644 --- a/tests/lib/search/glob_prepare_replace_str.c +++ b/tests/lib/search/glob_prepare_replace_str.c @@ -94,24 +94,16 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); /* Add new tests here: *************** */ mctest_add_parameterized_test (tc_core, test_glob_prepare_replace_str, test_glob_prepare_replace_str_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "glob_prepare_replace_str.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/search/glob_translate_to_regex.c b/tests/lib/search/glob_translate_to_regex.c index bee8d39fa..9eda4f5ca 100644 --- a/tests/lib/search/glob_translate_to_regex.c +++ b/tests/lib/search/glob_translate_to_regex.c @@ -106,24 +106,16 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); /* Add new tests here: *************** */ mctest_add_parameterized_test (tc_core, test_glob_translate_to_regex, test_glob_translate_to_regex_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "glob_translate_to_regex.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/search/hex_translate_to_regex.c b/tests/lib/search/hex_translate_to_regex.c index c40ee3122..03b9e159f 100644 --- a/tests/lib/search/hex_translate_to_regex.c +++ b/tests/lib/search/hex_translate_to_regex.c @@ -181,24 +181,16 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); /* Add new tests here: *************** */ mctest_add_parameterized_test (tc_core, test_hex_translate_to_regex, test_hex_translate_to_regex_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "hex_translate_to_regex.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/search/regex_process_escape_sequence.c b/tests/lib/search/regex_process_escape_sequence.c index 6511b397d..ab4c87b80 100644 --- a/tests/lib/search/regex_process_escape_sequence.c +++ b/tests/lib/search/regex_process_escape_sequence.c @@ -140,24 +140,16 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); /* Add new tests here: *************** */ mctest_add_parameterized_test (tc_core, test_regex_process_escape_sequence, test_regex_process_escape_sequence_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "regex_process_escape_sequence.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/search/regex_replace_esc_seq.c b/tests/lib/search/regex_replace_esc_seq.c index 2a6090dbc..10e98def9 100644 --- a/tests/lib/search/regex_replace_esc_seq.c +++ b/tests/lib/search/regex_replace_esc_seq.c @@ -210,24 +210,16 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); /* Add new tests here: *************** */ mctest_add_parameterized_test (tc_core, test_regex_replace_esc_seq_prepare, test_regex_replace_esc_seq_prepare_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "regex_replace_esc_seq.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/search/translate_replace_glob_to_regex.c b/tests/lib/search/translate_replace_glob_to_regex.c index 71f841718..7f611cbf4 100644 --- a/tests/lib/search/translate_replace_glob_to_regex.c +++ b/tests/lib/search/translate_replace_glob_to_regex.c @@ -83,24 +83,16 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); /* Add new tests here: *************** */ mctest_add_parameterized_test (tc_core, test_translate_replace_glob_to_regex, test_translate_replace_glob_to_regex_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "translate_replace_glob_to_regex.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/serialize.c b/tests/lib/serialize.c index 6c1ffe432..62d533cc9 100644 --- a/tests/lib/serialize.c +++ b/tests/lib/serialize.c @@ -359,11 +359,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -383,13 +381,7 @@ main (void) tcase_add_test (tc_core, test_deserialize_config); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "serialize.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/strutil/filevercmp.c b/tests/lib/strutil/filevercmp.c index 867858e62..2f2dc1022 100644 --- a/tests/lib/strutil/filevercmp.c +++ b/tests/lib/strutil/filevercmp.c @@ -269,11 +269,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -284,13 +282,7 @@ main (void) tcase_add_loop_test (tc_core, filevercmp_test4, 0, filevercmp_test_ds4_len); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "filevercmp.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/strutil/parse_integer.c b/tests/lib/strutil/parse_integer.c index f3e5ba357..5e469991e 100644 --- a/tests/lib/strutil/parse_integer.c +++ b/tests/lib/strutil/parse_integer.c @@ -143,11 +143,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -155,13 +153,7 @@ main (void) mctest_add_parameterized_test (tc_core, parse_integer_test, parse_integer_test_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "parse_integer.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/strutil/replace__str_replace_all.c b/tests/lib/strutil/replace__str_replace_all.c index 67c8b40dc..8c7c58f38 100644 --- a/tests/lib/strutil/replace__str_replace_all.c +++ b/tests/lib/strutil/replace__str_replace_all.c @@ -170,11 +170,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -182,13 +180,7 @@ main (void) mctest_add_parameterized_test (tc_core, str_replace_all_test, str_replace_all_test_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "replace__str_replace_all.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/strutil/str_verscmp.c b/tests/lib/strutil/str_verscmp.c index 2a1e545aa..9ab4ecfce 100644 --- a/tests/lib/strutil/str_verscmp.c +++ b/tests/lib/strutil/str_verscmp.c @@ -119,11 +119,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -131,13 +129,7 @@ main (void) mctest_add_parameterized_test (tc_core, str_verscmp_test, str_verscmp_test_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "str_verscmp.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/utilunix__my_system-fork_child.c b/tests/lib/utilunix__my_system-fork_child.c index 95081db11..344a5e7e1 100644 --- a/tests/lib/utilunix__my_system-fork_child.c +++ b/tests/lib/utilunix__my_system-fork_child.c @@ -69,11 +69,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -81,13 +79,7 @@ main (void) tcase_add_test (tc_core, fork_child); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "utilinux__my_system-fork_child.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/utilunix__my_system-fork_child_shell.c b/tests/lib/utilunix__my_system-fork_child_shell.c index 6de19581b..7d9674033 100644 --- a/tests/lib/utilunix__my_system-fork_child_shell.c +++ b/tests/lib/utilunix__my_system-fork_child_shell.c @@ -70,11 +70,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -82,13 +80,7 @@ main (void) tcase_add_test (tc_core, fork_child_as_shell); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "utilinux__my_system-fork_child_shell.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/utilunix__my_system-fork_fail.c b/tests/lib/utilunix__my_system-fork_fail.c index 452efb161..3e799b1b8 100644 --- a/tests/lib/utilunix__my_system-fork_fail.c +++ b/tests/lib/utilunix__my_system-fork_fail.c @@ -65,11 +65,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -77,13 +75,7 @@ main (void) tcase_add_test (tc_core, fork_fail); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "utilinux__my_system-fork_fail.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/canonicalize_pathname.c b/tests/lib/vfs/canonicalize_pathname.c index 6364a404b..05f2a4ef7 100644 --- a/tests/lib/vfs/canonicalize_pathname.c +++ b/tests/lib/vfs/canonicalize_pathname.c @@ -187,11 +187,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -199,13 +197,7 @@ main (void) mctest_add_parameterized_test (tc_core, test_canonicalize_path, test_canonicalize_path_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "canonicalize_pathname.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/current_dir.c b/tests/lib/vfs/current_dir.c index 398fc5440..8dfa88bd4 100644 --- a/tests/lib/vfs/current_dir.c +++ b/tests/lib/vfs/current_dir.c @@ -185,12 +185,10 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; char *cwd; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); /* writable directory where check creates temporary files */ cwd = g_get_current_dir (); @@ -203,13 +201,7 @@ main (void) mctest_add_parameterized_test (tc_core, test_cd, test_cd_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "current_dir.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_cmp.c b/tests/lib/vfs/path_cmp.c index 0e19566c7..bf5a47615 100644 --- a/tests/lib/vfs/path_cmp.c +++ b/tests/lib/vfs/path_cmp.c @@ -237,11 +237,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -250,13 +248,7 @@ main (void) mctest_add_parameterized_test (tc_core, test_path_equal_len, test_path_equal_len_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "path_cmp.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_len.c b/tests/lib/vfs/path_len.c index e68176dbc..f47897c54 100644 --- a/tests/lib/vfs/path_len.c +++ b/tests/lib/vfs/path_len.c @@ -126,11 +126,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -138,13 +136,7 @@ main (void) mctest_add_parameterized_test (tc_core, test_path_length, test_path_length_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "path_len.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_manipulations.c b/tests/lib/vfs/path_manipulations.c index 45f31e1f2..9d0462349 100644 --- a/tests/lib/vfs/path_manipulations.c +++ b/tests/lib/vfs/path_manipulations.c @@ -435,11 +435,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -454,13 +452,7 @@ main (void) test_vfs_path_relative_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "path_manipulations.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_recode.c b/tests/lib/vfs/path_recode.c index f53094a3b..e397cebbc 100644 --- a/tests/lib/vfs/path_recode.c +++ b/tests/lib/vfs/path_recode.c @@ -268,11 +268,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -281,13 +279,7 @@ main (void) mctest_add_parameterized_test (tc_core, test_path_to_str_flags, test_path_to_str_flags_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "path_recode.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_serialize.c b/tests/lib/vfs/path_serialize.c index 8ae2c830b..6d2623efc 100644 --- a/tests/lib/vfs/path_serialize.c +++ b/tests/lib/vfs/path_serialize.c @@ -186,11 +186,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -199,13 +197,7 @@ main (void) tcase_add_test (tc_core, test_path_deserialize); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "path_serialize.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/relative_cd.c b/tests/lib/vfs/relative_cd.c index bf5d62319..573daad5e 100644 --- a/tests/lib/vfs/relative_cd.c +++ b/tests/lib/vfs/relative_cd.c @@ -198,12 +198,10 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; char *cwd; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); /* writable directory where check creates temporary files */ cwd = g_get_current_dir (); @@ -217,13 +215,7 @@ main (void) tcase_add_test (tc_core, test_vpath_to_str_filter); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "relative_cd.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/tempdir.c b/tests/lib/vfs/tempdir.c index 8c5f3b359..df27473cf 100644 --- a/tests/lib/vfs/tempdir.c +++ b/tests/lib/vfs/tempdir.c @@ -123,11 +123,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -136,13 +134,7 @@ main (void) tcase_add_test (tc_core, test_mc_mkstemps); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "tempdir.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_adjust_stat.c b/tests/lib/vfs/vfs_adjust_stat.c index e216077f9..8d0aa0cff 100644 --- a/tests/lib/vfs/vfs_adjust_stat.c +++ b/tests/lib/vfs/vfs_adjust_stat.c @@ -191,23 +191,15 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); /* Add new tests here: *************** */ mctest_add_parameterized_test (tc_core, test_vfs_adjust_stat, test_vfs_adjust_stat_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "vfs_adjust_stat.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_get_encoding.c b/tests/lib/vfs/vfs_get_encoding.c index 783ec6e00..8ad00b673 100644 --- a/tests/lib/vfs/vfs_get_encoding.c +++ b/tests/lib/vfs/vfs_get_encoding.c @@ -143,11 +143,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -155,13 +153,7 @@ main (void) mctest_add_parameterized_test (tc_core, test_vfs_get_encoding, test_vfs_get_encoding_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "vfs_get_encoding.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_parse_ls_lga.c b/tests/lib/vfs/vfs_parse_ls_lga.c index b1b203af5..4a5a4e46f 100644 --- a/tests/lib/vfs/vfs_parse_ls_lga.c +++ b/tests/lib/vfs/vfs_parse_ls_lga.c @@ -408,11 +408,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -422,13 +420,7 @@ main (void) tcase_add_test (tc_core, test_vfs_parse_ls_lga_unaligned); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "vfs_parse_ls_lga.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_path_from_str_flags.c b/tests/lib/vfs/vfs_path_from_str_flags.c index 5700c7f03..43c47fce0 100644 --- a/tests/lib/vfs/vfs_path_from_str_flags.c +++ b/tests/lib/vfs/vfs_path_from_str_flags.c @@ -109,11 +109,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -121,13 +119,7 @@ main (void) mctest_add_parameterized_test (tc_core, test_strip_home, test_strip_home_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "vfs_path_from_str_flags.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_path_string_convert.c b/tests/lib/vfs/vfs_path_string_convert.c index 3c32471a5..b748fbecf 100644 --- a/tests/lib/vfs/vfs_path_string_convert.c +++ b/tests/lib/vfs/vfs_path_string_convert.c @@ -314,11 +314,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -331,13 +329,7 @@ main (void) #endif /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "vfs_path_string_convert.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_prefix_to_class.c b/tests/lib/vfs/vfs_prefix_to_class.c index 5c7d79723..7f4a6552f 100644 --- a/tests/lib/vfs/vfs_prefix_to_class.c +++ b/tests/lib/vfs/vfs_prefix_to_class.c @@ -154,11 +154,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -166,13 +164,7 @@ main (void) mctest_add_parameterized_test (tc_core, test_vfs_prefix_to_class, test_vfs_prefix_to_class_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "vfs_prefix_to_class.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_s_get_path.c b/tests/lib/vfs/vfs_s_get_path.c index 0aa0037b2..b9c58f1dc 100644 --- a/tests/lib/vfs/vfs_s_get_path.c +++ b/tests/lib/vfs/vfs_s_get_path.c @@ -152,11 +152,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -164,13 +162,7 @@ main (void) tcase_add_test (tc_core, test_vfs_s_get_path); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "vfs_s_get_path.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_setup_cwd.c b/tests/lib/vfs/vfs_setup_cwd.c index 3d408f028..dff9730af 100644 --- a/tests/lib/vfs/vfs_setup_cwd.c +++ b/tests/lib/vfs/vfs_setup_cwd.c @@ -140,11 +140,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -153,13 +151,7 @@ main (void) test_vfs_setup_cwd_symlink_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "vfs_setup_cwd.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_split.c b/tests/lib/vfs/vfs_split.c index 289dbebf8..086038a5b 100644 --- a/tests/lib/vfs/vfs_split.c +++ b/tests/lib/vfs/vfs_split.c @@ -191,11 +191,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -203,13 +201,7 @@ main (void) mctest_add_parameterized_test (tc_core, test_vfs_split, test_vfs_split_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "vfs_split.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/widget/complete_engine.c b/tests/lib/widget/complete_engine.c index b9923ee76..db31a07a8 100644 --- a/tests/lib/widget/complete_engine.c +++ b/tests/lib/widget/complete_engine.c @@ -221,11 +221,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -234,13 +232,7 @@ main (void) test_complete_engine_fill_completions_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "complete_engine.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/widget/group_init_destroy.c b/tests/lib/widget/group_init_destroy.c index 56fbec41e..4f86f4096 100644 --- a/tests/lib/widget/group_init_destroy.c +++ b/tests/lib/widget/group_init_destroy.c @@ -31,6 +31,8 @@ #include "lib/widget.h" +#include "tests/mctest.h" + /* --------------------------------------------------------------------------------------------- */ static int ref = 0; @@ -134,23 +136,15 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); /* Add new tests here: *************** */ tcase_add_test (tc_core, test_group_init_deinit); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "group_init_deinit.log"); - srunner_run_all (sr, CK_NORMAL); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/widget/hotkey_equal.c b/tests/lib/widget/hotkey_equal.c index d9a9e0cc3..173c1c1ea 100644 --- a/tests/lib/widget/hotkey_equal.c +++ b/tests/lib/widget/hotkey_equal.c @@ -151,11 +151,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -163,13 +161,7 @@ main (void) mctest_add_parameterized_test (tc_core, test_hotkey_equal, test_hotkey_equal_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "hotkey_equal.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/widget/widget_find_by_id.c b/tests/lib/widget/widget_find_by_id.c index ddb528db9..77dd1c15c 100644 --- a/tests/lib/widget/widget_find_by_id.c +++ b/tests/lib/widget/widget_find_by_id.c @@ -31,6 +31,8 @@ #include "lib/widget.h" +#include "tests/mctest.h" + /* --------------------------------------------------------------------------------------------- */ /* *INDENT-OFF* */ @@ -95,23 +97,15 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); /* Add new tests here: *************** */ tcase_add_test (tc_core, test_widget_find_by_id); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "widget_find_by_id.log"); - srunner_run_all (sr, CK_NORMAL); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/x_basename.c b/tests/lib/x_basename.c index c3a85f463..32e68bb72 100644 --- a/tests/lib/x_basename.c +++ b/tests/lib/x_basename.c @@ -112,11 +112,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -124,13 +122,7 @@ main (void) mctest_add_parameterized_test (tc_core, test_x_basename, test_x_basename_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "x_basename.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/mctest.h b/tests/mctest.h index 2e038a2d8..2c7d13ad8 100644 --- a/tests/mctest.h +++ b/tests/mctest.h @@ -88,4 +88,22 @@ /*** inline functions ****************************************************************************/ +static inline int +mctest_run_all (TCase * tc_core) +{ + Suite *s; + SRunner *sr; + int number_failed; + + s = suite_create (TEST_SUITE_NAME); + suite_add_tcase (s, tc_core); + sr = srunner_create (s); + srunner_set_log (sr, "-"); + srunner_run_all (sr, CK_ENV); + number_failed = srunner_ntests_failed (sr); + srunner_free (sr); + + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} + #endif /* MC__TEST */ diff --git a/tests/src/editor/editcmd__edit_complete_word_cmd.c b/tests/src/editor/editcmd__edit_complete_word_cmd.c index e7d6b44b0..584da6e38 100644 --- a/tests/src/editor/editcmd__edit_complete_word_cmd.c +++ b/tests/src/editor/editcmd__edit_complete_word_cmd.c @@ -379,11 +379,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, my_setup, my_teardown); @@ -394,13 +392,7 @@ main (void) #endif /* HAVE_CHARSET */ /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "edit_complete_word_cmd.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/execute__execute_external_editor_or_viewer.c b/tests/src/execute__execute_external_editor_or_viewer.c index a861d29f0..4f3001511 100644 --- a/tests/src/execute__execute_external_editor_or_viewer.c +++ b/tests/src/execute__execute_external_editor_or_viewer.c @@ -185,11 +185,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, my_setup, my_teardown); @@ -197,13 +195,7 @@ main (void) tcase_add_test (tc_core, do_open_external_editor_or_viewer); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "execute__execute_external_editor_or_viewer.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/execute__execute_get_external_cmd_opts_from_config.c b/tests/src/execute__execute_get_external_cmd_opts_from_config.c index 379717d22..7a07b86c0 100644 --- a/tests/src/execute__execute_get_external_cmd_opts_from_config.c +++ b/tests/src/execute__execute_get_external_cmd_opts_from_config.c @@ -187,11 +187,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -200,13 +198,7 @@ main (void) check_subtitute_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "execute__execute_get_external_cmd_opts_from_config.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/execute__execute_with_vfs_arg.c b/tests/src/execute__execute_with_vfs_arg.c index 84f64b8a5..9557d4bfd 100644 --- a/tests/src/execute__execute_with_vfs_arg.c +++ b/tests/src/execute__execute_with_vfs_arg.c @@ -221,11 +221,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -236,13 +234,7 @@ main (void) tcase_add_test (tc_core, the_file_is_remote); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "execute__execute_with_vfs_arg.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/filemanager/cd_to.c b/tests/src/filemanager/cd_to.c index 8db54fda8..070bb2891 100644 --- a/tests/src/filemanager/cd_to.c +++ b/tests/src/filemanager/cd_to.c @@ -158,11 +158,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -170,13 +168,7 @@ main (void) mctest_add_parameterized_test (tc_core, test_empty_mean_home, test_empty_mean_home_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "cd_to.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/filemanager/examine_cd.c b/tests/src/filemanager/examine_cd.c index 31cdb7555..286aafc96 100644 --- a/tests/src/filemanager/examine_cd.c +++ b/tests/src/filemanager/examine_cd.c @@ -128,11 +128,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -140,14 +138,7 @@ main (void) tcase_add_test (tc_core, test_examine_cd); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "examine_cd.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/filemanager/exec_get_export_variables_ext.c b/tests/src/filemanager/exec_get_export_variables_ext.c index 0d3975d00..d63ca7eb5 100644 --- a/tests/src/filemanager/exec_get_export_variables_ext.c +++ b/tests/src/filemanager/exec_get_export_variables_ext.c @@ -113,11 +113,9 @@ END_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -125,13 +123,7 @@ main (void) tcase_add_test (tc_core, sanitize_variables); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "exec_get_export_variables_ext.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/filemanager/filegui_is_wildcarded.c b/tests/src/filemanager/filegui_is_wildcarded.c index b30734ff6..cf972d3fd 100644 --- a/tests/src/filemanager/filegui_is_wildcarded.c +++ b/tests/src/filemanager/filegui_is_wildcarded.c @@ -143,11 +143,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -155,13 +153,7 @@ main (void) mctest_add_parameterized_test (tc_core, test_is_wildcarded, test_is_wildcarded_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "filegui_is_wildcarded.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/filemanager/get_random_hint.c b/tests/src/filemanager/get_random_hint.c index af939827c..8d518dfe5 100644 --- a/tests/src/filemanager/get_random_hint.c +++ b/tests/src/filemanager/get_random_hint.c @@ -163,11 +163,9 @@ END_PARAMETRIZED_TEST int main (void) { - int number_failed; + TCase *tc_core; - Suite *s = suite_create (TEST_SUITE_NAME); - TCase *tc_core = tcase_create ("Core"); - SRunner *sr; + tc_core = tcase_create ("Core"); tcase_add_checked_fixture (tc_core, setup, teardown); @@ -176,13 +174,7 @@ main (void) mctest_add_parameterized_test (tc_core, get_random, get_random_ds); /* *********************************** */ - suite_add_tcase (s, tc_core); - sr = srunner_create (s); - srunner_set_log (sr, "get_random_hint.log"); - srunner_run_all (sr, CK_ENV); - number_failed = srunner_ntests_failed (sr); - srunner_free (sr); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return mctest_run_all (tc_core); } /* --------------------------------------------------------------------------------------------- */