From 517cc5cfe45b9be84da181e8ac50a6a65444252b Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Tue, 7 Apr 2015 11:52:58 +0300 Subject: [PATCH] Fixes in tests Signed-off-by: Slava Zanko --- tests/lib/Makefile.am | 2 ++ tests/lib/library_independ.c | 4 +-- tests/lib/mc_build_filename.c | 4 +-- tests/lib/mcconfig/Makefile.am | 1 + tests/lib/mcconfig/config_string.c | 6 ++--- tests/lib/mcconfig/user_configs_path.c | 5 ++-- tests/lib/name_quote.c | 4 +-- tests/lib/search/Makefile.am | 1 + tests/lib/search/glob_prepare_replace_str.c | 5 ++-- tests/lib/search/glob_translate_to_regex.c | 5 ++-- tests/lib/search/regex_get_compile_flags.c | 5 ++-- .../search/regex_process_escape_sequence.c | 5 ++-- tests/lib/search/regex_replace_esc_seq.c | 5 ++-- .../search/translate_replace_glob_to_regex.c | 5 ++-- tests/lib/serialize.c | 4 +-- tests/lib/strutil/Makefile.am | 1 + tests/lib/strutil/parse_integer.c | 4 +-- tests/lib/strutil/replace__str_replace_all.c | 4 +-- tests/lib/utilunix__my_system-fork_child.c | 6 ++--- .../utilunix__my_system-fork_child_shell.c | 6 ++--- tests/lib/utilunix__my_system-fork_fail.c | 6 ++--- tests/lib/vfs/Makefile.am | 1 + tests/lib/vfs/canonicalize_pathname.c | 4 +-- tests/lib/vfs/current_dir.c | 4 +-- tests/lib/vfs/path_cmp.c | 4 +-- tests/lib/vfs/path_len.c | 4 +-- tests/lib/vfs/path_manipulations.c | 4 +-- tests/lib/vfs/path_recode.c | 7 +++--- tests/lib/vfs/path_serialize.c | 4 +-- tests/lib/vfs/relative_cd.c | 4 +-- tests/lib/vfs/tempdir.c | 4 +-- tests/lib/vfs/vfs_get_encoding.c | 4 +-- tests/lib/vfs/vfs_parse_ls_lga.c | 4 +-- tests/lib/vfs/vfs_path_from_str_flags.c | 4 +-- tests/lib/vfs/vfs_path_string_convert.c | 4 +-- tests/lib/vfs/vfs_prefix_to_class.c | 4 +-- tests/lib/vfs/vfs_s_get_path.c | 4 +-- tests/lib/vfs/vfs_setup_cwd.c | 4 +-- tests/lib/vfs/vfs_split.c | 4 +-- tests/lib/widget/Makefile.am | 1 + tests/lib/widget/complete_engine.c | 4 +-- tests/lib/x_basename.c | 6 ++--- tests/mctest.h | 25 +++++++++++++++---- tests/src/Makefile.am | 2 ++ tests/src/editor/Makefile.am | 2 ++ .../editor/editcmd__edit_complete_word_cmd.c | 4 +-- tests/src/execute__common.c | 8 +++--- ...ecute__execute_external_editor_or_viewer.c | 4 +-- ...xecute_get_external_cmd_opts_from_config.c | 4 +-- tests/src/execute__execute_with_vfs_arg.c | 4 +-- tests/src/filemanager/Makefile.am | 2 ++ tests/src/filemanager/cmd__get_random_hint.c | 5 ++-- tests/src/filemanager/do_cd_command.c | 4 +-- tests/src/filemanager/examine_cd.c | 4 +-- .../exec_get_export_variables_ext.c | 6 ++--- tests/src/filemanager/filegui_is_wildcarded.c | 4 +-- 56 files changed, 140 insertions(+), 109 deletions(-) diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am index f1ca1443e..d48fbd717 100644 --- a/tests/lib/Makefile.am +++ b/tests/lib/Makefile.am @@ -1,3 +1,5 @@ +PACKAGE_STRING = "/lib" + SUBDIRS = . mcconfig search strutil vfs widget AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) @CHECK_CFLAGS@ diff --git a/tests/lib/library_independ.c b/tests/lib/library_independ.c index 78ac5b699..e38fd6c80 100644 --- a/tests/lib/library_independ.c +++ b/tests/lib/library_independ.c @@ -55,10 +55,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/mc_build_filename.c b/tests/lib/mc_build_filename.c index 2e4e9d87b..eaeba9878 100644 --- a/tests/lib/mc_build_filename.c +++ b/tests/lib/mc_build_filename.c @@ -148,10 +148,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "mc_build_filename.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/mcconfig/Makefile.am b/tests/lib/mcconfig/Makefile.am index 522902e91..08a6052c5 100644 --- a/tests/lib/mcconfig/Makefile.am +++ b/tests/lib/mcconfig/Makefile.am @@ -1,3 +1,4 @@ +PACKAGE_STRING = "/lib/mcconfig" AM_CPPFLAGS = \ -DWORKDIR=\"$(abs_builddir)\" \ diff --git a/tests/lib/mcconfig/config_string.c b/tests/lib/mcconfig/config_string.c index a88854064..cda666f0b 100644 --- a/tests/lib/mcconfig/config_string.c +++ b/tests/lib/mcconfig/config_string.c @@ -253,11 +253,11 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); - /* srunner_set_fork_status (sr, CK_NOFORK); */ - srunner_run_all (sr, CK_NORMAL); + 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) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/mcconfig/user_configs_path.c b/tests/lib/mcconfig/user_configs_path.c index e68d236be..3dbdb73be 100644 --- a/tests/lib/mcconfig/user_configs_path.c +++ b/tests/lib/mcconfig/user_configs_path.c @@ -229,11 +229,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "user_configs_path.log"); - /* srunner_set_fork_status (sr, CK_NOFORK); */ - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/name_quote.c b/tests/lib/name_quote.c index 8a0ce5a8e..0d8185342 100644 --- a/tests/lib/name_quote.c +++ b/tests/lib/name_quote.c @@ -144,10 +144,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "name_quote.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/search/Makefile.am b/tests/lib/search/Makefile.am index 85bc8e215..4001aec33 100644 --- a/tests/lib/search/Makefile.am +++ b/tests/lib/search/Makefile.am @@ -1,3 +1,4 @@ +PACKAGE_STRING = "/lib/search" AM_CPPFLAGS = \ $(GLIB_CFLAGS) \ diff --git a/tests/lib/search/glob_prepare_replace_str.c b/tests/lib/search/glob_prepare_replace_str.c index b991653ae..dd5624e17 100644 --- a/tests/lib/search/glob_prepare_replace_str.c +++ b/tests/lib/search/glob_prepare_replace_str.c @@ -107,10 +107,11 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); - srunner_run_all (sr, CK_NORMAL); + 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) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/search/glob_translate_to_regex.c b/tests/lib/search/glob_translate_to_regex.c index d794d437c..8e8bde229 100644 --- a/tests/lib/search/glob_translate_to_regex.c +++ b/tests/lib/search/glob_translate_to_regex.c @@ -119,10 +119,11 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); - srunner_run_all (sr, CK_NORMAL); + 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) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/search/regex_get_compile_flags.c b/tests/lib/search/regex_get_compile_flags.c index 94257d958..90ed9cbe6 100644 --- a/tests/lib/search/regex_get_compile_flags.c +++ b/tests/lib/search/regex_get_compile_flags.c @@ -148,10 +148,11 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); - srunner_run_all (sr, CK_NORMAL); + srunner_set_log (sr, "regex_get_compile_flags.log"); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/search/regex_process_escape_sequence.c b/tests/lib/search/regex_process_escape_sequence.c index 71b54d242..db9f9d731 100644 --- a/tests/lib/search/regex_process_escape_sequence.c +++ b/tests/lib/search/regex_process_escape_sequence.c @@ -153,10 +153,11 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); - srunner_run_all (sr, CK_NORMAL); + 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) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/search/regex_replace_esc_seq.c b/tests/lib/search/regex_replace_esc_seq.c index 4767e00e8..178f03df3 100644 --- a/tests/lib/search/regex_replace_esc_seq.c +++ b/tests/lib/search/regex_replace_esc_seq.c @@ -223,10 +223,11 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); - srunner_run_all (sr, CK_NORMAL); + 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) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/search/translate_replace_glob_to_regex.c b/tests/lib/search/translate_replace_glob_to_regex.c index df3c64aa1..4beac29f0 100644 --- a/tests/lib/search/translate_replace_glob_to_regex.c +++ b/tests/lib/search/translate_replace_glob_to_regex.c @@ -96,10 +96,11 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); - srunner_run_all (sr, CK_NORMAL); + 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) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/serialize.c b/tests/lib/serialize.c index 25b1b7ee4..e134cfad1 100644 --- a/tests/lib/serialize.c +++ b/tests/lib/serialize.c @@ -384,10 +384,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "serialize.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/strutil/Makefile.am b/tests/lib/strutil/Makefile.am index 609dba0f6..c3ce5405a 100644 --- a/tests/lib/strutil/Makefile.am +++ b/tests/lib/strutil/Makefile.am @@ -1,3 +1,4 @@ +PACKAGE_STRING = "/lib/strutil" AM_CPPFLAGS = \ $(GLIB_CFLAGS) \ diff --git a/tests/lib/strutil/parse_integer.c b/tests/lib/strutil/parse_integer.c index 0b7a2a9ff..f38de42e3 100644 --- a/tests/lib/strutil/parse_integer.c +++ b/tests/lib/strutil/parse_integer.c @@ -159,10 +159,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "parse_integer.log"); - srunner_run_all (sr, CK_NOFORK); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/strutil/replace__str_replace_all.c b/tests/lib/strutil/replace__str_replace_all.c index 6a33fca7a..f1135d299 100644 --- a/tests/lib/strutil/replace__str_replace_all.c +++ b/tests/lib/strutil/replace__str_replace_all.c @@ -185,10 +185,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "replace__str_replace_all.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/utilunix__my_system-fork_child.c b/tests/lib/utilunix__my_system-fork_child.c index 34371a1ed..ec8dfd440 100644 --- a/tests/lib/utilunix__my_system-fork_child.c +++ b/tests/lib/utilunix__my_system-fork_child.c @@ -83,11 +83,11 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); - srunner_set_log (sr, "utilinux__my_system.log"); - srunner_run_all (sr, CK_NOFORK); + 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) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/utilunix__my_system-fork_child_shell.c b/tests/lib/utilunix__my_system-fork_child_shell.c index 71d2d1735..d41701add 100644 --- a/tests/lib/utilunix__my_system-fork_child_shell.c +++ b/tests/lib/utilunix__my_system-fork_child_shell.c @@ -84,11 +84,11 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); - srunner_set_log (sr, "utilinux__my_system.log"); - srunner_run_all (sr, CK_NOFORK); + 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) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/utilunix__my_system-fork_fail.c b/tests/lib/utilunix__my_system-fork_fail.c index 717fef23e..efa0c8b56 100644 --- a/tests/lib/utilunix__my_system-fork_fail.c +++ b/tests/lib/utilunix__my_system-fork_fail.c @@ -79,11 +79,11 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); - srunner_set_log (sr, "utilinux__my_system.log"); - srunner_run_all (sr, CK_NOFORK); + 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) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/Makefile.am b/tests/lib/vfs/Makefile.am index 8b7b844e3..c6e133ce5 100644 --- a/tests/lib/vfs/Makefile.am +++ b/tests/lib/vfs/Makefile.am @@ -1,3 +1,4 @@ +PACKAGE_STRING = "/lib/vfs" AM_CPPFLAGS = \ -DTEST_SHARE_DIR=\"$(abs_srcdir)\" \ diff --git a/tests/lib/vfs/canonicalize_pathname.c b/tests/lib/vfs/canonicalize_pathname.c index 58bbe90c9..423f625e9 100644 --- a/tests/lib/vfs/canonicalize_pathname.c +++ b/tests/lib/vfs/canonicalize_pathname.c @@ -207,10 +207,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "canonicalize_pathname.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/current_dir.c b/tests/lib/vfs/current_dir.c index a6f3a5396..ec87c2928 100644 --- a/tests/lib/vfs/current_dir.c +++ b/tests/lib/vfs/current_dir.c @@ -210,10 +210,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "current_dir.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_cmp.c b/tests/lib/vfs/path_cmp.c index 7710b99d3..05e52d18b 100644 --- a/tests/lib/vfs/path_cmp.c +++ b/tests/lib/vfs/path_cmp.c @@ -253,10 +253,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "path_cmp.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_len.c b/tests/lib/vfs/path_len.c index 63644d12c..0239b31dd 100644 --- a/tests/lib/vfs/path_len.c +++ b/tests/lib/vfs/path_len.c @@ -141,10 +141,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "path_len.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_manipulations.c b/tests/lib/vfs/path_manipulations.c index 5d170b4dd..f3a7bf6f7 100644 --- a/tests/lib/vfs/path_manipulations.c +++ b/tests/lib/vfs/path_manipulations.c @@ -469,10 +469,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "path_manipulations.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_recode.c b/tests/lib/vfs/path_recode.c index 89c641ca1..18ed635ab 100644 --- a/tests/lib/vfs/path_recode.c +++ b/tests/lib/vfs/path_recode.c @@ -82,7 +82,7 @@ test_init_vfs (const char *encoding) /* --------------------------------------------------------------------------------------------- */ static void -test_deinit_vfs () +test_deinit_vfs (void) { free_codepages_list (); str_uninit_strings (); @@ -291,12 +291,11 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); - srunner_print (sr, CK_VERBOSE); srunner_set_log (sr, "path_recode.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_serialize.c b/tests/lib/vfs/path_serialize.c index d530d6ea1..336b3ed54 100644 --- a/tests/lib/vfs/path_serialize.c +++ b/tests/lib/vfs/path_serialize.c @@ -210,10 +210,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "path_serialize.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/relative_cd.c b/tests/lib/vfs/relative_cd.c index e71b4db47..ace464ea9 100644 --- a/tests/lib/vfs/relative_cd.c +++ b/tests/lib/vfs/relative_cd.c @@ -217,10 +217,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "relative_cd.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/tempdir.c b/tests/lib/vfs/tempdir.c index 5d0329f03..5493e7e0b 100644 --- a/tests/lib/vfs/tempdir.c +++ b/tests/lib/vfs/tempdir.c @@ -143,10 +143,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "tempdir.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_get_encoding.c b/tests/lib/vfs/vfs_get_encoding.c index 43a01c17e..6ee403cc5 100644 --- a/tests/lib/vfs/vfs_get_encoding.c +++ b/tests/lib/vfs/vfs_get_encoding.c @@ -158,10 +158,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "vfs_get_encoding.log"); - srunner_run_all (sr, CK_NOFORK); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_parse_ls_lga.c b/tests/lib/vfs/vfs_parse_ls_lga.c index a81c10b1d..69302e622 100644 --- a/tests/lib/vfs/vfs_parse_ls_lga.c +++ b/tests/lib/vfs/vfs_parse_ls_lga.c @@ -381,10 +381,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "vfs_parse_ls_lga.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_path_from_str_flags.c b/tests/lib/vfs/vfs_path_from_str_flags.c index 8e2a1b897..a6a24ba99 100644 --- a/tests/lib/vfs/vfs_path_from_str_flags.c +++ b/tests/lib/vfs/vfs_path_from_str_flags.c @@ -126,10 +126,10 @@ main (void) 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_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_path_string_convert.c b/tests/lib/vfs/vfs_path_string_convert.c index 388aeb912..409913c51 100644 --- a/tests/lib/vfs/vfs_path_string_convert.c +++ b/tests/lib/vfs/vfs_path_string_convert.c @@ -344,10 +344,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "vfs_path_string_convert.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_prefix_to_class.c b/tests/lib/vfs/vfs_prefix_to_class.c index 5d922b2af..f45f531cb 100644 --- a/tests/lib/vfs/vfs_prefix_to_class.c +++ b/tests/lib/vfs/vfs_prefix_to_class.c @@ -179,10 +179,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "vfs_prefix_to_class.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_s_get_path.c b/tests/lib/vfs/vfs_s_get_path.c index 20886a57c..1aa625c58 100644 --- a/tests/lib/vfs/vfs_s_get_path.c +++ b/tests/lib/vfs/vfs_s_get_path.c @@ -177,10 +177,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "vfs_s_get_path.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_setup_cwd.c b/tests/lib/vfs/vfs_setup_cwd.c index 9646b0d3f..64d0c7a20 100644 --- a/tests/lib/vfs/vfs_setup_cwd.c +++ b/tests/lib/vfs/vfs_setup_cwd.c @@ -156,10 +156,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "vfs_setup_cwd.log"); - srunner_run_all (sr, CK_NOFORK); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_split.c b/tests/lib/vfs/vfs_split.c index 1c1109670..1d6091e9b 100644 --- a/tests/lib/vfs/vfs_split.c +++ b/tests/lib/vfs/vfs_split.c @@ -217,10 +217,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "vfs_split.log"); - srunner_run_all (sr, CK_NOFORK); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/widget/Makefile.am b/tests/lib/widget/Makefile.am index 37a91efab..259cde10b 100644 --- a/tests/lib/widget/Makefile.am +++ b/tests/lib/widget/Makefile.am @@ -1,3 +1,4 @@ +PACKAGE_STRING = "/lib/widget" AM_CPPFLAGS = \ $(GLIB_CFLAGS) \ diff --git a/tests/lib/widget/complete_engine.c b/tests/lib/widget/complete_engine.c index 32be4f0e6..27b04241c 100644 --- a/tests/lib/widget/complete_engine.c +++ b/tests/lib/widget/complete_engine.c @@ -237,10 +237,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "complete_engine.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/x_basename.c b/tests/lib/x_basename.c index 5521e60b5..578b30c47 100644 --- a/tests/lib/x_basename.c +++ b/tests/lib/x_basename.c @@ -1,5 +1,5 @@ /* - lib/vfs - x_basename() function testing + lib - x_basename() function testing Copyright (C) 2011-2015 Free Software Foundation, Inc. @@ -127,10 +127,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "x_basename.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/mctest.h b/tests/mctest.h index 4e28bdd15..2e038a2d8 100644 --- a/tests/mctest.h +++ b/tests/mctest.h @@ -2,6 +2,7 @@ #define MC__TEST #include +#include #include #include "lib/global.h" @@ -25,33 +26,47 @@ } #define mctest_assert_ptr_eq(actual_pointer, etalon_pointer) { \ - fail_unless ( actual_pointer == etalon_pointer, \ + ck_assert_msg ( actual_pointer == etalon_pointer, \ "%s(%p) pointer should be equal to %s(%p)\n", \ #actual_pointer, actual_pointer, #etalon_pointer , etalon_pointer \ );\ } #define mctest_assert_ptr_ne(actual_pointer, etalon_pointer) { \ - fail_unless ( actual_pointer != etalon_pointer, \ + ck_assert_msg ( actual_pointer != etalon_pointer, \ "%s(%p) pointer should not be equal to %s(%p)\n", \ #actual_pointer, actual_pointer, #etalon_pointer , etalon_pointer \ );\ } #define mctest_assert_null(actual_pointer) { \ - fail_unless( \ + ck_assert_msg( \ (void *) actual_pointer == NULL, \ "%s(%p) variable should be NULL", #actual_pointer, actual_pointer \ ); \ } #define mctest_assert_not_null(actual_pointer) { \ - fail_if( \ - (void *) actual_pointer == NULL, \ + ck_assert_msg( \ + (void *) actual_pointer != NULL, \ "%s(nil) variable should not be NULL", #actual_pointer \ ); \ } +#define mctest_assert_true(actual_pointer) { \ + ck_assert_msg( \ + (int) actual_pointer != 0, \ + "%s variable should be TRUE", #actual_pointer \ + ); \ +} + +#define mctest_assert_false(actual_pointer) { \ + ck_assert_msg( \ + (int) actual_pointer == 0, \ + "%s variable should be TRUE", #actual_pointer \ + ); \ +} + /** * Define header for a parameterized test. * Declare 'data' variable for access to the parameters in current iteration diff --git a/tests/src/Makefile.am b/tests/src/Makefile.am index 0d31c3b85..74eecf612 100644 --- a/tests/src/Makefile.am +++ b/tests/src/Makefile.am @@ -1,3 +1,5 @@ +PACKAGE_STRING = "/src" + SUBDIRS = . filemanager if USE_INTERNAL_EDIT diff --git a/tests/src/editor/Makefile.am b/tests/src/editor/Makefile.am index c0ee705c2..93e9f9265 100644 --- a/tests/src/editor/Makefile.am +++ b/tests/src/editor/Makefile.am @@ -1,3 +1,5 @@ +PACKAGE_STRING = "/src/editor" + AM_CPPFLAGS = \ -DTEST_SHARE_DIR=\"$(abs_srcdir)\" \ $(GLIB_CFLAGS) \ diff --git a/tests/src/editor/editcmd__edit_complete_word_cmd.c b/tests/src/editor/editcmd__edit_complete_word_cmd.c index 9f008b23c..aedba22f4 100644 --- a/tests/src/editor/editcmd__edit_complete_word_cmd.c +++ b/tests/src/editor/editcmd__edit_complete_word_cmd.c @@ -384,10 +384,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "edit_complete_word_cmd.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/execute__common.c b/tests/src/execute__common.c index 464568db1..10c78a760 100644 --- a/tests/src/execute__common.c +++ b/tests/src/execute__common.c @@ -48,13 +48,13 @@ vfs_file_is_local (const vfs_path_t * vpath) } static void -vfs_file_is_local__init () +vfs_file_is_local__init (void) { vfs_file_is_local__vpath__captured = g_ptr_array_new (); } static void -vfs_file_is_local__deinit () +vfs_file_is_local__deinit (void) { g_ptr_array_foreach (vfs_file_is_local__vpath__captured, (GFunc) vfs_path_free, NULL); g_ptr_array_free (vfs_file_is_local__vpath__captured, TRUE); @@ -81,14 +81,14 @@ do_execute (const char *lc_shell, const char *command, int flags) } static void -do_execute__init () +do_execute__init (void) { do_execute__command__captured = NULL; do_execute__lc_shell__captured = NULL; } static void -do_execute__deinit () +do_execute__deinit (void) { g_free (do_execute__lc_shell__captured); g_free (do_execute__command__captured); diff --git a/tests/src/execute__execute_external_editor_or_viewer.c b/tests/src/execute__execute_external_editor_or_viewer.c index e68df27aa..ccb0882d7 100644 --- a/tests/src/execute__execute_external_editor_or_viewer.c +++ b/tests/src/execute__execute_external_editor_or_viewer.c @@ -200,10 +200,10 @@ main (void) 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_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ 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 4ebe85909..26cd161a3 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 @@ -203,10 +203,10 @@ main (void) 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_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/execute__execute_with_vfs_arg.c b/tests/src/execute__execute_with_vfs_arg.c index 20c3456d8..c1f702930 100644 --- a/tests/src/execute__execute_with_vfs_arg.c +++ b/tests/src/execute__execute_with_vfs_arg.c @@ -239,10 +239,10 @@ main (void) 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_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/filemanager/Makefile.am b/tests/src/filemanager/Makefile.am index 822ba8b10..e4dfd9b8b 100644 --- a/tests/src/filemanager/Makefile.am +++ b/tests/src/filemanager/Makefile.am @@ -1,3 +1,5 @@ +PACKAGE_STRING = "/src/filemanager" + AM_CPPFLAGS = \ $(GLIB_CFLAGS) \ -I$(top_srcdir) \ diff --git a/tests/src/filemanager/cmd__get_random_hint.c b/tests/src/filemanager/cmd__get_random_hint.c index fc923ec8c..8840e637a 100644 --- a/tests/src/filemanager/cmd__get_random_hint.c +++ b/tests/src/filemanager/cmd__get_random_hint.c @@ -45,7 +45,6 @@ guess_message_value (void) } /* --------------------------------------------------------------------------------------------- */ -int rand (void); /* @ThenReturnValue */ static gboolean rand__return_value = 0; @@ -180,10 +179,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "cmd__get_random_hint.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/filemanager/do_cd_command.c b/tests/src/filemanager/do_cd_command.c index fa626de19..94b5fe063 100644 --- a/tests/src/filemanager/do_cd_command.c +++ b/tests/src/filemanager/do_cd_command.c @@ -170,10 +170,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "do_cd_command.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/filemanager/examine_cd.c b/tests/src/filemanager/examine_cd.c index 12f158acd..bbb5c70cf 100644 --- a/tests/src/filemanager/examine_cd.c +++ b/tests/src/filemanager/examine_cd.c @@ -180,11 +180,11 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "examine_cd.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/filemanager/exec_get_export_variables_ext.c b/tests/src/filemanager/exec_get_export_variables_ext.c index 1b3326397..d41006fd5 100644 --- a/tests/src/filemanager/exec_get_export_variables_ext.c +++ b/tests/src/filemanager/exec_get_export_variables_ext.c @@ -127,11 +127,11 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); - srunner_set_log (sr, "do_panel_cd.log"); - srunner_run_all (sr, CK_NORMAL); + 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) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/tests/src/filemanager/filegui_is_wildcarded.c b/tests/src/filemanager/filegui_is_wildcarded.c index 5059ae233..dfc3ba8e3 100644 --- a/tests/src/filemanager/filegui_is_wildcarded.c +++ b/tests/src/filemanager/filegui_is_wildcarded.c @@ -158,10 +158,10 @@ main (void) suite_add_tcase (s, tc_core); sr = srunner_create (s); srunner_set_log (sr, "filegui_is_wildcarded.log"); - srunner_run_all (sr, CK_NORMAL); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed (sr); srunner_free (sr); - return (number_failed == 0) ? 0 : 1; + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } /* --------------------------------------------------------------------------------------------- */