diff options
Diffstat (limited to '')
59 files changed, 17164 insertions, 0 deletions
diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am new file mode 100644 index 0000000..ec76346 --- /dev/null +++ b/tests/lib/Makefile.am @@ -0,0 +1,64 @@ +PACKAGE_STRING = "/lib" + +SUBDIRS = . mcconfig search strutil vfs widget + +AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) @CHECK_CFLAGS@ + +AM_LDFLAGS = @TESTS_LDFLAGS@ + +LIBS = @CHECK_LIBS@ \ + $(top_builddir)/lib/libmc.la + +if ENABLE_MCLIB +LIBS += $(GLIB_LIBS) +endif + +EXTRA_DIST = utilunix__my_system-common.c + +TESTS = \ + library_independ \ + mc_build_filename \ + name_quote \ + serialize \ + utilunix__mc_pstream_get_string \ + utilunix__my_system_fork_fail \ + utilunix__my_system_fork_child_shell \ + utilunix__my_system_fork_child \ + x_basename + +if CHARSET +TESTS += mc_realpath +endif + +check_PROGRAMS = $(TESTS) + +library_independ_SOURCES = \ + library_independ.c + +mc_build_filename_SOURCES = \ + mc_build_filename.c + +mc_realpath_SOURCES = \ + mc_realpath.c + +name_quote_SOURCES = \ + name_quote.c + +serialize_SOURCES = \ + serialize.c + +utilunix__mc_pstream_get_string_SOURCES = \ + utilunix__mc_pstream_get_string.c + +utilunix__my_system_fork_fail_SOURCES = \ + utilunix__my_system-fork_fail.c + +utilunix__my_system_fork_child_shell_SOURCES = \ + utilunix__my_system-fork_child_shell.c + +utilunix__my_system_fork_child_SOURCES = \ + utilunix__my_system-fork_child.c + +x_basename_SOURCES = \ + x_basename.c + diff --git a/tests/lib/Makefile.in b/tests/lib/Makefile.in new file mode 100644 index 0000000..ee6beb0 --- /dev/null +++ b/tests/lib/Makefile.in @@ -0,0 +1,1447 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@ENABLE_MCLIB_TRUE@am__append_1 = $(GLIB_LIBS) +TESTS = library_independ$(EXEEXT) mc_build_filename$(EXEEXT) \ + name_quote$(EXEEXT) serialize$(EXEEXT) \ + utilunix__mc_pstream_get_string$(EXEEXT) \ + utilunix__my_system_fork_fail$(EXEEXT) \ + utilunix__my_system_fork_child_shell$(EXEEXT) \ + utilunix__my_system_fork_child$(EXEEXT) x_basename$(EXEEXT) \ + $(am__EXEEXT_1) +@CHARSET_TRUE@am__append_2 = mc_realpath +check_PROGRAMS = $(am__EXEEXT_2) +subdir = tests/lib +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/m4.include/gnulib/mode_t.m4 \ + $(top_srcdir)/m4.include/gnulib/stat-size.m4 \ + $(top_srcdir)/m4.include/gnulib/fstypename.m4 \ + $(top_srcdir)/m4.include/gnulib/fsusage.m4 \ + $(top_srcdir)/m4.include/gnulib/mountlist.m4 \ + $(top_srcdir)/m4.include/gnulib/windows-stat-inodes.m4 \ + $(top_srcdir)/m4.include/gnulib/sys_types_h.m4 \ + $(top_srcdir)/m4.include/ax_path_lib_pcre.m4 \ + $(top_srcdir)/m4.include/dx_doxygen.m4 \ + $(top_srcdir)/m4.include/ax_require_defined.m4 \ + $(top_srcdir)/m4.include/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4.include/ax_append_flag.m4 \ + $(top_srcdir)/m4.include/ax_append_compile_flags.m4 \ + $(top_srcdir)/m4.include/mc-cflags.m4 \ + $(top_srcdir)/m4.include/ax_gcc_func_attribute.m4 \ + $(top_srcdir)/m4.include/mc-check-search-type.m4 \ + $(top_srcdir)/m4.include/mc-get-fs-info.m4 \ + $(top_srcdir)/m4.include/mc-with-x.m4 \ + $(top_srcdir)/m4.include/mc-use-termcap.m4 \ + $(top_srcdir)/m4.include/mc-with-screen.m4 \ + $(top_srcdir)/m4.include/mc-with-screen-ncurses.m4 \ + $(top_srcdir)/m4.include/mc-with-screen-slang.m4 \ + $(top_srcdir)/m4.include/mc-with-internal-edit.m4 \ + $(top_srcdir)/m4.include/mc-subshell.m4 \ + $(top_srcdir)/m4.include/mc-background.m4 \ + $(top_srcdir)/m4.include/mc-ext2fs-attr.m4 \ + $(top_srcdir)/m4.include/mc-glib.m4 \ + $(top_srcdir)/m4.include/mc-vfs.m4 \ + $(top_srcdir)/m4.include/vfs/rpc.m4 \ + $(top_srcdir)/m4.include/vfs/socket.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-extfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-sfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-ftp.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-sftp.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-fish.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-undelfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-tarfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-cpiofs.m4 \ + $(top_srcdir)/m4.include/mc-version.m4 \ + $(top_srcdir)/m4.include/mc-tests.m4 \ + $(top_srcdir)/m4.include/mc-i18n.m4 \ + $(top_srcdir)/m4.include/mc-assert.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +@CHARSET_TRUE@am__EXEEXT_1 = mc_realpath$(EXEEXT) +am__EXEEXT_2 = library_independ$(EXEEXT) mc_build_filename$(EXEEXT) \ + name_quote$(EXEEXT) serialize$(EXEEXT) \ + utilunix__mc_pstream_get_string$(EXEEXT) \ + utilunix__my_system_fork_fail$(EXEEXT) \ + utilunix__my_system_fork_child_shell$(EXEEXT) \ + utilunix__my_system_fork_child$(EXEEXT) x_basename$(EXEEXT) \ + $(am__EXEEXT_1) +am_library_independ_OBJECTS = library_independ.$(OBJEXT) +library_independ_OBJECTS = $(am_library_independ_OBJECTS) +library_independ_LDADD = $(LDADD) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am_mc_build_filename_OBJECTS = mc_build_filename.$(OBJEXT) +mc_build_filename_OBJECTS = $(am_mc_build_filename_OBJECTS) +mc_build_filename_LDADD = $(LDADD) +am_mc_realpath_OBJECTS = mc_realpath.$(OBJEXT) +mc_realpath_OBJECTS = $(am_mc_realpath_OBJECTS) +mc_realpath_LDADD = $(LDADD) +am_name_quote_OBJECTS = name_quote.$(OBJEXT) +name_quote_OBJECTS = $(am_name_quote_OBJECTS) +name_quote_LDADD = $(LDADD) +am_serialize_OBJECTS = serialize.$(OBJEXT) +serialize_OBJECTS = $(am_serialize_OBJECTS) +serialize_LDADD = $(LDADD) +am_utilunix__mc_pstream_get_string_OBJECTS = \ + utilunix__mc_pstream_get_string.$(OBJEXT) +utilunix__mc_pstream_get_string_OBJECTS = \ + $(am_utilunix__mc_pstream_get_string_OBJECTS) +utilunix__mc_pstream_get_string_LDADD = $(LDADD) +am_utilunix__my_system_fork_child_OBJECTS = \ + utilunix__my_system-fork_child.$(OBJEXT) +utilunix__my_system_fork_child_OBJECTS = \ + $(am_utilunix__my_system_fork_child_OBJECTS) +utilunix__my_system_fork_child_LDADD = $(LDADD) +am_utilunix__my_system_fork_child_shell_OBJECTS = \ + utilunix__my_system-fork_child_shell.$(OBJEXT) +utilunix__my_system_fork_child_shell_OBJECTS = \ + $(am_utilunix__my_system_fork_child_shell_OBJECTS) +utilunix__my_system_fork_child_shell_LDADD = $(LDADD) +am_utilunix__my_system_fork_fail_OBJECTS = \ + utilunix__my_system-fork_fail.$(OBJEXT) +utilunix__my_system_fork_fail_OBJECTS = \ + $(am_utilunix__my_system_fork_fail_OBJECTS) +utilunix__my_system_fork_fail_LDADD = $(LDADD) +am_x_basename_OBJECTS = x_basename.$(OBJEXT) +x_basename_OBJECTS = $(am_x_basename_OBJECTS) +x_basename_LDADD = $(LDADD) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/library_independ.Po \ + ./$(DEPDIR)/mc_build_filename.Po ./$(DEPDIR)/mc_realpath.Po \ + ./$(DEPDIR)/name_quote.Po ./$(DEPDIR)/serialize.Po \ + ./$(DEPDIR)/utilunix__mc_pstream_get_string.Po \ + ./$(DEPDIR)/utilunix__my_system-fork_child.Po \ + ./$(DEPDIR)/utilunix__my_system-fork_child_shell.Po \ + ./$(DEPDIR)/utilunix__my_system-fork_fail.Po \ + ./$(DEPDIR)/x_basename.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(library_independ_SOURCES) $(mc_build_filename_SOURCES) \ + $(mc_realpath_SOURCES) $(name_quote_SOURCES) \ + $(serialize_SOURCES) \ + $(utilunix__mc_pstream_get_string_SOURCES) \ + $(utilunix__my_system_fork_child_SOURCES) \ + $(utilunix__my_system_fork_child_shell_SOURCES) \ + $(utilunix__my_system_fork_fail_SOURCES) $(x_basename_SOURCES) +DIST_SOURCES = $(library_independ_SOURCES) \ + $(mc_build_filename_SOURCES) $(mc_realpath_SOURCES) \ + $(name_quote_SOURCES) $(serialize_SOURCES) \ + $(utilunix__mc_pstream_get_string_SOURCES) \ + $(utilunix__my_system_fork_child_SOURCES) \ + $(utilunix__my_system_fork_child_shell_SOURCES) \ + $(utilunix__my_system_fork_fail_SOURCES) $(x_basename_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + check recheck distdir distdir-am +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red='[0;31m'; \ + grn='[0;32m'; \ + lgn='[1;32m'; \ + blu='[1;34m'; \ + mgn='[0;35m'; \ + brg='[1m'; \ + std='[m'; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_CFLAGS = @CHECK_CFLAGS@ +CHECK_LIBS = @CHECK_LIBS@ +COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ +COM_ERR_LIBS = @COM_ERR_LIBS@ +CP1251 = @CP1251@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOC_LINGUAS = @DOC_LINGUAS@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +E2P_CFLAGS = @E2P_CFLAGS@ +E2P_LIBS = @E2P_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ +EXT2FS_LIBS = @EXT2FS_LIBS@ +EXTHELPERSDIR = @EXTHELPERSDIR@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +HAVE_FILECMD = @HAVE_FILECMD@ +HAVE_ZIPINFO = @HAVE_ZIPINFO@ +HAVE_nroff = @HAVE_nroff@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBMC_RELEASE = @LIBMC_RELEASE@ +LIBMC_VERSION = @LIBMC_VERSION@ +LIBOBJS = @LIBOBJS@ +LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la $(am__append_1) +LIBSSH_CFLAGS = @LIBSSH_CFLAGS@ +LIBSSH_LIBS = @LIBSSH_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANDOC = @MANDOC@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_DATE = @MAN_DATE@ +MAN_FLAGS = @MAN_FLAGS@ +MAN_VERSION = @MAN_VERSION@ +MCLIBS = @MCLIBS@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = "/lib" +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRE_CPPFLAGS = @PCRE_CPPFLAGS@ +PCRE_LIBS = @PCRE_LIBS@ +PERL = @PERL@ +PERL_FOR_BUILD = @PERL_FOR_BUILD@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +RANLIB = @RANLIB@ +RUBY = @RUBY@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SLANG_CFLAGS = @SLANG_CFLAGS@ +SLANG_LIBS = @SLANG_LIBS@ +STRIP = @STRIP@ +TESTS_LDFLAGS = @TESTS_LDFLAGS@ +UNZIP = @UNZIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +X11_WWW = @X11_WWW@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZIP = @ZIP@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = . mcconfig search strutil vfs widget +AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) @CHECK_CFLAGS@ +AM_LDFLAGS = @TESTS_LDFLAGS@ +EXTRA_DIST = utilunix__my_system-common.c +library_independ_SOURCES = \ + library_independ.c + +mc_build_filename_SOURCES = \ + mc_build_filename.c + +mc_realpath_SOURCES = \ + mc_realpath.c + +name_quote_SOURCES = \ + name_quote.c + +serialize_SOURCES = \ + serialize.c + +utilunix__mc_pstream_get_string_SOURCES = \ + utilunix__mc_pstream_get_string.c + +utilunix__my_system_fork_fail_SOURCES = \ + utilunix__my_system-fork_fail.c + +utilunix__my_system_fork_child_shell_SOURCES = \ + utilunix__my_system-fork_child_shell.c + +utilunix__my_system_fork_child_SOURCES = \ + utilunix__my_system-fork_child.c + +x_basename_SOURCES = \ + x_basename.c + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/lib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/lib/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +library_independ$(EXEEXT): $(library_independ_OBJECTS) $(library_independ_DEPENDENCIES) $(EXTRA_library_independ_DEPENDENCIES) + @rm -f library_independ$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(library_independ_OBJECTS) $(library_independ_LDADD) $(LIBS) + +mc_build_filename$(EXEEXT): $(mc_build_filename_OBJECTS) $(mc_build_filename_DEPENDENCIES) $(EXTRA_mc_build_filename_DEPENDENCIES) + @rm -f mc_build_filename$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mc_build_filename_OBJECTS) $(mc_build_filename_LDADD) $(LIBS) + +mc_realpath$(EXEEXT): $(mc_realpath_OBJECTS) $(mc_realpath_DEPENDENCIES) $(EXTRA_mc_realpath_DEPENDENCIES) + @rm -f mc_realpath$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mc_realpath_OBJECTS) $(mc_realpath_LDADD) $(LIBS) + +name_quote$(EXEEXT): $(name_quote_OBJECTS) $(name_quote_DEPENDENCIES) $(EXTRA_name_quote_DEPENDENCIES) + @rm -f name_quote$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(name_quote_OBJECTS) $(name_quote_LDADD) $(LIBS) + +serialize$(EXEEXT): $(serialize_OBJECTS) $(serialize_DEPENDENCIES) $(EXTRA_serialize_DEPENDENCIES) + @rm -f serialize$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(serialize_OBJECTS) $(serialize_LDADD) $(LIBS) + +utilunix__mc_pstream_get_string$(EXEEXT): $(utilunix__mc_pstream_get_string_OBJECTS) $(utilunix__mc_pstream_get_string_DEPENDENCIES) $(EXTRA_utilunix__mc_pstream_get_string_DEPENDENCIES) + @rm -f utilunix__mc_pstream_get_string$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utilunix__mc_pstream_get_string_OBJECTS) $(utilunix__mc_pstream_get_string_LDADD) $(LIBS) + +utilunix__my_system_fork_child$(EXEEXT): $(utilunix__my_system_fork_child_OBJECTS) $(utilunix__my_system_fork_child_DEPENDENCIES) $(EXTRA_utilunix__my_system_fork_child_DEPENDENCIES) + @rm -f utilunix__my_system_fork_child$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utilunix__my_system_fork_child_OBJECTS) $(utilunix__my_system_fork_child_LDADD) $(LIBS) + +utilunix__my_system_fork_child_shell$(EXEEXT): $(utilunix__my_system_fork_child_shell_OBJECTS) $(utilunix__my_system_fork_child_shell_DEPENDENCIES) $(EXTRA_utilunix__my_system_fork_child_shell_DEPENDENCIES) + @rm -f utilunix__my_system_fork_child_shell$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utilunix__my_system_fork_child_shell_OBJECTS) $(utilunix__my_system_fork_child_shell_LDADD) $(LIBS) + +utilunix__my_system_fork_fail$(EXEEXT): $(utilunix__my_system_fork_fail_OBJECTS) $(utilunix__my_system_fork_fail_DEPENDENCIES) $(EXTRA_utilunix__my_system_fork_fail_DEPENDENCIES) + @rm -f utilunix__my_system_fork_fail$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utilunix__my_system_fork_fail_OBJECTS) $(utilunix__my_system_fork_fail_LDADD) $(LIBS) + +x_basename$(EXEEXT): $(x_basename_OBJECTS) $(x_basename_DEPENDENCIES) $(EXTRA_x_basename_DEPENDENCIES) + @rm -f x_basename$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(x_basename_OBJECTS) $(x_basename_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/library_independ.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mc_build_filename.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mc_realpath.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_quote.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serialize.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utilunix__mc_pstream_get_string.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utilunix__my_system-fork_child.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utilunix__my_system-fork_child_shell.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utilunix__my_system-fork_fail.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x_basename.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: $(check_PROGRAMS) + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +library_independ.log: library_independ$(EXEEXT) + @p='library_independ$(EXEEXT)'; \ + b='library_independ'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +mc_build_filename.log: mc_build_filename$(EXEEXT) + @p='mc_build_filename$(EXEEXT)'; \ + b='mc_build_filename'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +name_quote.log: name_quote$(EXEEXT) + @p='name_quote$(EXEEXT)'; \ + b='name_quote'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +serialize.log: serialize$(EXEEXT) + @p='serialize$(EXEEXT)'; \ + b='serialize'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +utilunix__mc_pstream_get_string.log: utilunix__mc_pstream_get_string$(EXEEXT) + @p='utilunix__mc_pstream_get_string$(EXEEXT)'; \ + b='utilunix__mc_pstream_get_string'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +utilunix__my_system_fork_fail.log: utilunix__my_system_fork_fail$(EXEEXT) + @p='utilunix__my_system_fork_fail$(EXEEXT)'; \ + b='utilunix__my_system_fork_fail'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +utilunix__my_system_fork_child_shell.log: utilunix__my_system_fork_child_shell$(EXEEXT) + @p='utilunix__my_system_fork_child_shell$(EXEEXT)'; \ + b='utilunix__my_system_fork_child_shell'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +utilunix__my_system_fork_child.log: utilunix__my_system_fork_child$(EXEEXT) + @p='utilunix__my_system_fork_child$(EXEEXT)'; \ + b='utilunix__my_system_fork_child'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +x_basename.log: x_basename$(EXEEXT) + @p='x_basename$(EXEEXT)'; \ + b='x_basename'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +mc_realpath.log: mc_realpath$(EXEEXT) + @p='mc_realpath$(EXEEXT)'; \ + b='mc_realpath'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + mostlyclean-am + +distclean: distclean-recursive + -rm -f ./$(DEPDIR)/library_independ.Po + -rm -f ./$(DEPDIR)/mc_build_filename.Po + -rm -f ./$(DEPDIR)/mc_realpath.Po + -rm -f ./$(DEPDIR)/name_quote.Po + -rm -f ./$(DEPDIR)/serialize.Po + -rm -f ./$(DEPDIR)/utilunix__mc_pstream_get_string.Po + -rm -f ./$(DEPDIR)/utilunix__my_system-fork_child.Po + -rm -f ./$(DEPDIR)/utilunix__my_system-fork_child_shell.Po + -rm -f ./$(DEPDIR)/utilunix__my_system-fork_fail.Po + -rm -f ./$(DEPDIR)/x_basename.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f ./$(DEPDIR)/library_independ.Po + -rm -f ./$(DEPDIR)/mc_build_filename.Po + -rm -f ./$(DEPDIR)/mc_realpath.Po + -rm -f ./$(DEPDIR)/name_quote.Po + -rm -f ./$(DEPDIR)/serialize.Po + -rm -f ./$(DEPDIR)/utilunix__mc_pstream_get_string.Po + -rm -f ./$(DEPDIR)/utilunix__my_system-fork_child.Po + -rm -f ./$(DEPDIR)/utilunix__my_system-fork_child_shell.Po + -rm -f ./$(DEPDIR)/utilunix__my_system-fork_fail.Po + -rm -f ./$(DEPDIR)/x_basename.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) check-am install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--depfiles check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/lib/library_independ.c b/tests/lib/library_independ.c new file mode 100644 index 0000000..bf5276e --- /dev/null +++ b/tests/lib/library_independ.c @@ -0,0 +1,57 @@ +/* + libmc - check if library is independ to $(topsrc)/src directory + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "lib/library_independ" + +#include "tests/mctest.h" + +/* --------------------------------------------------------------------------------------------- */ + +/* *INDENT-OFF* */ +START_TEST (test_library_independ) +/* *INDENT-ON* */ +{ +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + /* Add new tests here: *************** */ + tcase_add_test (tc_core, test_library_independ); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/mc_build_filename.c b/tests/lib/mc_build_filename.c new file mode 100644 index 0000000..a690d30 --- /dev/null +++ b/tests/lib/mc_build_filename.c @@ -0,0 +1,150 @@ +/* + lib - mc_build_filename() function testing + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/util" + +#include "tests/mctest.h" + +#include <stdio.h> + +#include "lib/strutil.h" +#include "lib/util.h" + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +static char * +run_mc_build_filename (int iteration) +{ + switch (iteration) + { + case 0: + return mc_build_filename ("test", "path", (char *) NULL); + case 1: + return mc_build_filename ("/test", "path/", (char *) NULL); + case 2: + return mc_build_filename ("/test", "pa/th", (char *) NULL); + case 3: + return mc_build_filename ("/test", "#vfsprefix:", "path ", (char *) NULL); + case 4: + return mc_build_filename ("/test", "vfsprefix://", "path ", (char *) NULL); + case 5: + return mc_build_filename ("/test", "vfs/../prefix:///", "p\\///ath", (char *) NULL); + case 6: + return mc_build_filename ("/test", "path", "..", "/test", "path/", (char *) NULL); + case 7: + return mc_build_filename ("", "path", (char *) NULL); + case 8: + return mc_build_filename ("", "/path", (char *) NULL); + case 9: + return mc_build_filename ("path", "", (char *) NULL); + case 10: + return mc_build_filename ("/path", "", (char *) NULL); + case 11: + return mc_build_filename ("pa", "", "th", (char *) NULL); + case 12: + return mc_build_filename ("/pa", "", "/th", (char *) NULL); + default: + return NULL; + } +} + +/* @DataSource("test_mc_build_filename_ds") */ +/* *INDENT-OFF* */ +static const struct test_mc_build_filename_ds +{ + const char *expected_result; +} test_mc_build_filename_ds[] = +{ + {"test/path"}, + {"/test/path"}, + {"/test/pa/th"}, + {"/test/#vfsprefix:/path "}, + {"/test/vfsprefix://path "}, + {"/test/prefix://p\\/ath"}, + {"/test/test/path"}, + {"path"}, + {"path"}, + {"path"}, + {"/path"}, + {"pa/th"}, + {"/pa/th"}, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_mc_build_filename_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_mc_build_filename, test_mc_build_filename_ds) +/* *INDENT-ON* */ +{ + /* given */ + char *actual_result; + + /* when */ + actual_result = run_mc_build_filename (_i); + + /* then */ + mctest_assert_str_eq (actual_result, data->expected_result); + + g_free (actual_result); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_mc_build_filename, test_mc_build_filename_ds); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/mc_realpath.c b/tests/lib/mc_realpath.c new file mode 100644 index 0000000..9ed1742 --- /dev/null +++ b/tests/lib/mc_realpath.c @@ -0,0 +1,131 @@ +/* + lib - realpath + + Copyright (C) 2017-2022 + Free Software Foundation, Inc. + + Written by: + Andrew Borodin <aborodin@vmail.ru>, 2017 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/util" + +#include "tests/mctest.h" + +#include "lib/strutil.h" +#include "lib/vfs/vfs.h" /* VFS_ENCODING_PREFIX, vfs_init(), vfs_shut() */ +#include "src/vfs/local/local.c" + +#include "lib/util.h" /* mc_realpath() */ + +/* --------------------------------------------------------------------------------------------- */ + +static char resolved_path[PATH_MAX]; + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); +} + +/* @After */ +static void +teardown (void) +{ + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("data_source") */ +/* *INDENT-OFF* */ +static const struct data_source +{ + const char *input_string; + const char *expected_string; +} data_source[] = +{ + /* absolute paths */ + { "/", "/"}, + { "/" VFS_ENCODING_PREFIX "UTF-8/", "/" }, + { "/usr/bin", "/usr/bin" }, + { "/" VFS_ENCODING_PREFIX "UTF-8/usr/bin", "/usr/bin" }, + + /* relative paths are relative to / */ + { VFS_ENCODING_PREFIX "UTF-8/", "/" }, + { "usr/bin", "/usr/bin" }, + { VFS_ENCODING_PREFIX "UTF-8/usr/bin", "/usr/bin" } +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "data_source") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (realpath_test, data_source) +/* *INDENT-ON* */ +{ + int ret; + + /* realpath(3) produces a canonicalized absolute pathname using curent directory. + * Change the current directory to produce correct pathname. */ + ret = chdir ("/"); + + /* when */ + if (mc_realpath (data->input_string, resolved_path) == NULL) + resolved_path[0] = '\0'; + + /* then */ + mctest_assert_str_eq (resolved_path, data->expected_string); + + (void) ret; +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + char *cwd; + + tc_core = tcase_create ("Core"); + + /* writable directory where check creates temporary files */ + cwd = g_get_current_dir (); + g_setenv ("TEMP", cwd, TRUE); + g_free (cwd); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, realpath_test, data_source); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/mcconfig/Makefile.am b/tests/lib/mcconfig/Makefile.am new file mode 100644 index 0000000..930d3f2 --- /dev/null +++ b/tests/lib/mcconfig/Makefile.am @@ -0,0 +1,28 @@ +PACKAGE_STRING = "/lib/mcconfig" + +AM_CPPFLAGS = \ + -DWORKDIR=\"$(abs_builddir)\" \ + $(GLIB_CFLAGS) \ + -I$(top_srcdir) \ + @CHECK_CFLAGS@ + +AM_LDFLAGS = @TESTS_LDFLAGS@ + +LIBS = @CHECK_LIBS@ \ + $(top_builddir)/lib/libmc.la + +if ENABLE_MCLIB +LIBS += $(GLIB_LIBS) +endif + +TESTS = \ + config_string \ + user_configs_path + +check_PROGRAMS = $(TESTS) + +config_string_SOURCES = \ + config_string.c + +user_configs_path_SOURCES = \ + user_configs_path.c diff --git a/tests/lib/mcconfig/Makefile.in b/tests/lib/mcconfig/Makefile.in new file mode 100644 index 0000000..eb83d4d --- /dev/null +++ b/tests/lib/mcconfig/Makefile.in @@ -0,0 +1,1135 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@ENABLE_MCLIB_TRUE@am__append_1 = $(GLIB_LIBS) +TESTS = config_string$(EXEEXT) user_configs_path$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = tests/lib/mcconfig +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/m4.include/gnulib/mode_t.m4 \ + $(top_srcdir)/m4.include/gnulib/stat-size.m4 \ + $(top_srcdir)/m4.include/gnulib/fstypename.m4 \ + $(top_srcdir)/m4.include/gnulib/fsusage.m4 \ + $(top_srcdir)/m4.include/gnulib/mountlist.m4 \ + $(top_srcdir)/m4.include/gnulib/windows-stat-inodes.m4 \ + $(top_srcdir)/m4.include/gnulib/sys_types_h.m4 \ + $(top_srcdir)/m4.include/ax_path_lib_pcre.m4 \ + $(top_srcdir)/m4.include/dx_doxygen.m4 \ + $(top_srcdir)/m4.include/ax_require_defined.m4 \ + $(top_srcdir)/m4.include/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4.include/ax_append_flag.m4 \ + $(top_srcdir)/m4.include/ax_append_compile_flags.m4 \ + $(top_srcdir)/m4.include/mc-cflags.m4 \ + $(top_srcdir)/m4.include/ax_gcc_func_attribute.m4 \ + $(top_srcdir)/m4.include/mc-check-search-type.m4 \ + $(top_srcdir)/m4.include/mc-get-fs-info.m4 \ + $(top_srcdir)/m4.include/mc-with-x.m4 \ + $(top_srcdir)/m4.include/mc-use-termcap.m4 \ + $(top_srcdir)/m4.include/mc-with-screen.m4 \ + $(top_srcdir)/m4.include/mc-with-screen-ncurses.m4 \ + $(top_srcdir)/m4.include/mc-with-screen-slang.m4 \ + $(top_srcdir)/m4.include/mc-with-internal-edit.m4 \ + $(top_srcdir)/m4.include/mc-subshell.m4 \ + $(top_srcdir)/m4.include/mc-background.m4 \ + $(top_srcdir)/m4.include/mc-ext2fs-attr.m4 \ + $(top_srcdir)/m4.include/mc-glib.m4 \ + $(top_srcdir)/m4.include/mc-vfs.m4 \ + $(top_srcdir)/m4.include/vfs/rpc.m4 \ + $(top_srcdir)/m4.include/vfs/socket.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-extfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-sfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-ftp.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-sftp.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-fish.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-undelfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-tarfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-cpiofs.m4 \ + $(top_srcdir)/m4.include/mc-version.m4 \ + $(top_srcdir)/m4.include/mc-tests.m4 \ + $(top_srcdir)/m4.include/mc-i18n.m4 \ + $(top_srcdir)/m4.include/mc-assert.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__EXEEXT_1 = config_string$(EXEEXT) user_configs_path$(EXEEXT) +am_config_string_OBJECTS = config_string.$(OBJEXT) +config_string_OBJECTS = $(am_config_string_OBJECTS) +config_string_LDADD = $(LDADD) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am_user_configs_path_OBJECTS = user_configs_path.$(OBJEXT) +user_configs_path_OBJECTS = $(am_user_configs_path_OBJECTS) +user_configs_path_LDADD = $(LDADD) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/config_string.Po \ + ./$(DEPDIR)/user_configs_path.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(config_string_SOURCES) $(user_configs_path_SOURCES) +DIST_SOURCES = $(config_string_SOURCES) $(user_configs_path_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red='[0;31m'; \ + grn='[0;32m'; \ + lgn='[1;32m'; \ + blu='[1;34m'; \ + mgn='[0;35m'; \ + brg='[1m'; \ + std='[m'; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_CFLAGS = @CHECK_CFLAGS@ +CHECK_LIBS = @CHECK_LIBS@ +COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ +COM_ERR_LIBS = @COM_ERR_LIBS@ +CP1251 = @CP1251@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOC_LINGUAS = @DOC_LINGUAS@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +E2P_CFLAGS = @E2P_CFLAGS@ +E2P_LIBS = @E2P_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ +EXT2FS_LIBS = @EXT2FS_LIBS@ +EXTHELPERSDIR = @EXTHELPERSDIR@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +HAVE_FILECMD = @HAVE_FILECMD@ +HAVE_ZIPINFO = @HAVE_ZIPINFO@ +HAVE_nroff = @HAVE_nroff@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBMC_RELEASE = @LIBMC_RELEASE@ +LIBMC_VERSION = @LIBMC_VERSION@ +LIBOBJS = @LIBOBJS@ +LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la $(am__append_1) +LIBSSH_CFLAGS = @LIBSSH_CFLAGS@ +LIBSSH_LIBS = @LIBSSH_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANDOC = @MANDOC@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_DATE = @MAN_DATE@ +MAN_FLAGS = @MAN_FLAGS@ +MAN_VERSION = @MAN_VERSION@ +MCLIBS = @MCLIBS@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = "/lib/mcconfig" +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRE_CPPFLAGS = @PCRE_CPPFLAGS@ +PCRE_LIBS = @PCRE_LIBS@ +PERL = @PERL@ +PERL_FOR_BUILD = @PERL_FOR_BUILD@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +RANLIB = @RANLIB@ +RUBY = @RUBY@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SLANG_CFLAGS = @SLANG_CFLAGS@ +SLANG_LIBS = @SLANG_LIBS@ +STRIP = @STRIP@ +TESTS_LDFLAGS = @TESTS_LDFLAGS@ +UNZIP = @UNZIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +X11_WWW = @X11_WWW@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZIP = @ZIP@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = \ + -DWORKDIR=\"$(abs_builddir)\" \ + $(GLIB_CFLAGS) \ + -I$(top_srcdir) \ + @CHECK_CFLAGS@ + +AM_LDFLAGS = @TESTS_LDFLAGS@ +config_string_SOURCES = \ + config_string.c + +user_configs_path_SOURCES = \ + user_configs_path.c + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/lib/mcconfig/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/lib/mcconfig/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +config_string$(EXEEXT): $(config_string_OBJECTS) $(config_string_DEPENDENCIES) $(EXTRA_config_string_DEPENDENCIES) + @rm -f config_string$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(config_string_OBJECTS) $(config_string_LDADD) $(LIBS) + +user_configs_path$(EXEEXT): $(user_configs_path_OBJECTS) $(user_configs_path_DEPENDENCIES) $(EXTRA_user_configs_path_DEPENDENCIES) + @rm -f user_configs_path$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(user_configs_path_OBJECTS) $(user_configs_path_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config_string.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/user_configs_path.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: $(check_PROGRAMS) + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +config_string.log: config_string$(EXEEXT) + @p='config_string$(EXEEXT)'; \ + b='config_string'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +user_configs_path.log: user_configs_path$(EXEEXT) + @p='user_configs_path$(EXEEXT)'; \ + b='user_configs_path'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/config_string.Po + -rm -f ./$(DEPDIR)/user_configs_path.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/config_string.Po + -rm -f ./$(DEPDIR)/user_configs_path.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/lib/mcconfig/config_string.c b/tests/lib/mcconfig/config_string.c new file mode 100644 index 0000000..ea30180 --- /dev/null +++ b/tests/lib/mcconfig/config_string.c @@ -0,0 +1,255 @@ +/* + libmc - check mcconfig submodule. read and write config files + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "lib/mcconfig" + +#include "tests/mctest.h" + +#include "lib/mcconfig.h" +#include "lib/strutil.h" +#include "lib/strescape.h" +#include "lib/vfs/vfs.h" +#include "src/vfs/local/local.c" + +static mc_config_t *mc_config; +static char *ini_filename; + +/* --------------------------------------------------------------------------------------------- */ + +static void +config_object__init (void) +{ + ini_filename = g_build_filename (WORKDIR, "config_string.ini", (char *) NULL); + unlink (ini_filename); + + mc_config = mc_config_init (ini_filename, FALSE); +} + +/* --------------------------------------------------------------------------------------------- */ + +static void +config_object__reopen (void) +{ + GError *error = NULL; + + if (!mc_config_save_file (mc_config, &error)) + { + ck_abort_msg ("Unable to save config file: %s", error->message); + g_error_free (error); + } + + mc_config_deinit (mc_config); + mc_config = mc_config_init (ini_filename, FALSE); +} + +/* --------------------------------------------------------------------------------------------- */ + +static void +config_object__deinit (void) +{ + mc_config_deinit (mc_config); + g_free (ini_filename); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings ("KOI8-R"); + vfs_init (); + vfs_init_localfs (); + + config_object__init (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ + config_object__deinit (); + + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_create_ini_file_ds") */ +/* *INDENT-OFF* */ +static const struct test_create_ini_file_ds +{ + const char *input_group; + const char *input_param; + const char *input_default_value; + const char *expected_value; + const char *expected_raw_value; +} test_create_ini_file_ds[] = +{ + { /* 0. */ + "group-not-exists", + "param-not_exists", + NULL, + NULL, + NULL + }, + { /* 1. */ + "test-group1", + "test-param1", + "not-exists", + " some value ", + " some value " + }, + { /* 2. */ + "test-group1", + "test-param2", + "not-exists", + " \tkoi8-r: ôÅÓÔÏ×ÏÅ ÚÎÁÞÅÎÉÅ ", + " \tkoi8-r: \320\242\320\265\321\201\321\202\320\276\320\262\320\276\320\265 \320\267\320\275\320\260\321\207\320\265\320\275\320\270\320\265 " + }, + { /* 3. */ + "test-group1", + "test-param3", + "not-exists", + " \tsome value2\n\nf\b\005fff ", + " \tsome value2\n\nf\b\005fff " + }, + { /* 4. */ + "test-group2", + "test-param1", + "not-exists", + " some value ", + " some value " + }, + { /* 5. */ + "test-group2", + "test-param2", + "not-exists", + "not-exists", + "not-exists" + }, + { /* 6. */ + "test-group2", + "test-param3", + "not-exists", + " \tsome value2\n\nf\b\005fff ", + " \tsome value2\n\nf\b\005fff " + }, + +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_create_ini_file_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_create_ini_file_paths, test_create_ini_file_ds) +/* *INDENT-ON* */ +{ + /* given */ + char *actual_value, *actual_raw_value; + + mc_config_set_string (mc_config, "test-group1", "test-param1", " some value "); + mc_config_set_string (mc_config, "test-group1", "test-param2", " \tkoi8-r: ôÅÓÔÏ×ÏÅ ÚÎÁÞÅÎÉÅ "); + mc_config_set_string (mc_config, "test-group1", "test-param3", " \tsome value2\n\nf\b\005fff "); + mc_config_set_string_raw (mc_config, "test-group2", "test-param1", " some value "); + mc_config_set_string_raw (mc_config, "test-group2", "test-param2", + " koi8-r: ôÅÓÔÏ×ÏÅ ÚÎÁÞÅÎÉÅ"); + mc_config_set_string_raw (mc_config, "test-group2", "test-param3", + " \tsome value2\n\nf\b\005fff "); + + config_object__reopen (); + + /* when */ + actual_value = + mc_config_get_string (mc_config, data->input_group, data->input_param, + data->input_default_value); + actual_raw_value = + mc_config_get_string_raw (mc_config, data->input_group, data->input_param, + data->input_default_value); + + /* then */ + mctest_assert_str_eq (actual_value, data->expected_value); + mctest_assert_str_eq (actual_raw_value, data->expected_raw_value); + + g_free (actual_value); + g_free (actual_raw_value); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @Test(group='Integration') */ +/* *INDENT-OFF* */ +START_TEST (emulate__learn_save) +/* *INDENT-ON* */ +{ + /* given */ + char *actual_value; + + { + char *esc_str; + + esc_str = strutils_escape ("T;E\\X;T-FOR-\\T;E;S\\TI;N'G", -1, ";", TRUE); + mc_config_set_string_raw (mc_config, "test-group1", "test-param1", esc_str); + g_free (esc_str); + } + + config_object__reopen (); + + /* when */ + actual_value = mc_config_get_string_raw (mc_config, "test-group1", "test-param1", "not-exists"); + + /* then */ + mctest_assert_str_eq (actual_value, "T\\;E\\X\\;T-FOR-\\T\\;E\\;S\\TI\\;N'G"); + g_free (actual_value); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_create_ini_file_paths, test_create_ini_file_ds); + tcase_add_test (tc_core, emulate__learn_save); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/mcconfig/user_configs_path.c b/tests/lib/mcconfig/user_configs_path.c new file mode 100644 index 0000000..d86981a --- /dev/null +++ b/tests/lib/mcconfig/user_configs_path.c @@ -0,0 +1,223 @@ +/* + libmc - check mcconfig submodule. Get full paths to user's config files. + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "lib/mcconfig" + +#include "tests/mctest.h" + +#include "lib/strutil.h" +#include "lib/strescape.h" +#include "lib/vfs/vfs.h" +#include "lib/fileloc.h" + +#include "lib/mcconfig.h" +#include "src/vfs/local/local.c" + +#define HOME_DIR "/home/testuser" + +#define CONF_MAIN HOME_DIR PATH_SEP_STR ".config" +#define CONF_DATA HOME_DIR PATH_SEP_STR ".local" PATH_SEP_STR "share" +#define CONF_CACHE HOME_DIR PATH_SEP_STR ".cache" + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + g_setenv ("HOME", HOME_DIR, TRUE); + g_setenv ("XDG_CONFIG_HOME", CONF_MAIN, TRUE); + g_setenv ("XDG_DATA_HOME", CONF_DATA, TRUE); + g_setenv ("XDG_CACHE_HOME", CONF_CACHE, TRUE); + str_init_strings ("UTF-8"); + vfs_init (); + vfs_init_localfs (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_user_config_paths_ds") */ +/* *INDENT-OFF* */ +static const struct test_user_config_paths_ds +{ + const char *input_base_dir; + const char *input_file_name; +} test_user_config_paths_ds[] = +{ + { /* 0. */ + CONF_MAIN, + MC_CONFIG_FILE + }, + { /* 1. */ + CONF_MAIN, + MC_FHL_INI_FILE + }, + { /* 2. */ + CONF_MAIN, + MC_HOTLIST_FILE + }, + { /* 3. */ + CONF_MAIN, + GLOBAL_KEYMAP_FILE + }, + { /* 4. */ + CONF_MAIN, + MC_USERMENU_FILE + }, + { /* 5. */ + CONF_DATA, + EDIT_SYNTAX_FILE + }, + { /* 6. */ + CONF_MAIN, + EDIT_HOME_MENU + }, + { /* 7. */ + CONF_MAIN, + MC_PANELS_FILE + }, + { /* 8. */ + CONF_MAIN, + MC_EXT_FILE + }, + { /* 9. */ + CONF_DATA, + MC_SKINS_DIR + }, + { /* 10. */ + CONF_DATA, + FISH_PREFIX + }, + { /* 11. */ + CONF_DATA, + MC_ASHRC_FILE + }, + { /* 12. */ + CONF_DATA, + MC_BASHRC_FILE + }, + { /* 13. */ + CONF_DATA, + MC_INPUTRC_FILE + }, + { /* 14. */ + CONF_DATA, + MC_ZSHRC_FILE + }, + { /* 15. */ + CONF_DATA, + MC_EXTFS_DIR + }, + { /* 16. */ + CONF_DATA, + MC_HISTORY_FILE + }, + { /* 17. */ + CONF_DATA, + MC_FILEPOS_FILE + }, + { /* 18. */ + CONF_DATA, + EDIT_HOME_CLIP_FILE + }, + { /* 19. */ + CONF_DATA, + MC_MACRO_FILE + }, + { /* 20. */ + CONF_CACHE, + "mc.log" + }, + { /* 21. */ + CONF_CACHE, + MC_TREESTORE_FILE + }, + { /* 22. */ + CONF_CACHE, + EDIT_HOME_TEMP_FILE + }, + { /* 23. */ + CONF_CACHE, + EDIT_HOME_BLOCK_FILE + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_user_config_paths_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_user_config_paths, test_user_config_paths_ds) +/* *INDENT-ON* */ +{ + /* given */ + char *actual_result; + + /* when */ + actual_result = mc_config_get_full_path (data->input_file_name); + + /* then */ + { + char *expected_file_path; + + expected_file_path = + g_build_filename (data->input_base_dir, MC_USERCONF_DIR, data->input_file_name, + (char *) NULL); + mctest_assert_str_eq (actual_result, expected_file_path); + g_free (expected_file_path); + } + g_free (actual_result); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_user_config_paths, test_user_config_paths_ds); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/name_quote.c b/tests/lib/name_quote.c new file mode 100644 index 0000000..9cb4e41 --- /dev/null +++ b/tests/lib/name_quote.c @@ -0,0 +1,145 @@ +/* + lib - Quote file names + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/util" + +#include "tests/mctest.h" + +#include "lib/util.h" + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ +} + +/* @After */ +static void +teardown (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("data_source1") */ +/* *INDENT-OFF* */ +static const struct data_source1 +{ + gboolean input_quote_percent; + const char *input_string; + + const char *expected_string; +} data_source1[] = +{ + { TRUE, "%%", "%%%%"}, + { FALSE, "%%", "%%"}, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "data_source1") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (quote_percent_test, data_source1) +/* *INDENT-ON* */ +{ + /* given */ + char *actual_string; + + /* when */ + actual_string = name_quote (data->input_string, data->input_quote_percent); + + /* then */ + mctest_assert_str_eq (actual_string, data->expected_string); + + g_free (actual_string); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("data_source2") */ +/* *INDENT-OFF* */ +static const struct data_source2 +{ + const char *input_string; + + const char *expected_string; +} data_source2[] = +{ + {"-", "./-"}, + {"blabla-", "blabla-"}, + {"\r\n\t", "\\\r\\\n\\\t"}, + {"'\\\";?|[]{}<>`!$&*()", "\\'\\\\\\\"\\;\\?\\|\\[\\]\\{\\}\\<\\>\\`\\!\\$\\&\\*\\(\\)"}, + {"a b c ", "a\\ b\\ c\\ "}, + {"#", "\\#"}, + {"blabla#", "blabla#"}, + {"~", "\\~"}, + {"blabla~", "blabla~"}, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "data_source2") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (name_quote_test, data_source2) +/* *INDENT-ON* */ +{ + /* given */ + char *actual_string; + + /* when */ + actual_string = name_quote (data->input_string, FALSE); + + /* then */ + mctest_assert_str_eq (actual_string, data->expected_string); + + g_free (actual_string); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, quote_percent_test, data_source1); + mctest_add_parameterized_test (tc_core, name_quote_test, data_source2); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/search/Makefile.am b/tests/lib/search/Makefile.am new file mode 100644 index 0000000..d01c0dc --- /dev/null +++ b/tests/lib/search/Makefile.am @@ -0,0 +1,43 @@ +PACKAGE_STRING = "/lib/search" + +AM_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/lib/search \ + @CHECK_CFLAGS@ \ + @PCRE_CPPFLAGS@ + +LIBS = @CHECK_LIBS@ \ + $(top_builddir)/lib/libmc.la @PCRE_LIBS@ + +if ENABLE_MCLIB +LIBS += $(GLIB_LIBS) +endif + +TESTS = \ + glob_prepare_replace_str \ + glob_translate_to_regex \ + hex_translate_to_regex \ + regex_replace_esc_seq \ + regex_process_escape_sequence \ + translate_replace_glob_to_regex + +check_PROGRAMS = $(TESTS) + +glob_prepare_replace_str_SOURCES = \ + glob_prepare_replace_str.c + +regex_replace_esc_seq_SOURCES = \ + regex_replace_esc_seq.c + +regex_process_escape_sequence_SOURCES = \ + regex_process_escape_sequence.c + +translate_replace_glob_to_regex_SOURCES = \ + translate_replace_glob_to_regex.c + +glob_translate_to_regex_SOURCES = \ + glob_translate_to_regex.c + +hex_translate_to_regex_SOURCES = \ + hex_translate_to_regex.c diff --git a/tests/lib/search/Makefile.in b/tests/lib/search/Makefile.in new file mode 100644 index 0000000..77c8ffe --- /dev/null +++ b/tests/lib/search/Makefile.in @@ -0,0 +1,1246 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@ENABLE_MCLIB_TRUE@am__append_1 = $(GLIB_LIBS) +TESTS = glob_prepare_replace_str$(EXEEXT) \ + glob_translate_to_regex$(EXEEXT) \ + hex_translate_to_regex$(EXEEXT) regex_replace_esc_seq$(EXEEXT) \ + regex_process_escape_sequence$(EXEEXT) \ + translate_replace_glob_to_regex$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = tests/lib/search +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/m4.include/gnulib/mode_t.m4 \ + $(top_srcdir)/m4.include/gnulib/stat-size.m4 \ + $(top_srcdir)/m4.include/gnulib/fstypename.m4 \ + $(top_srcdir)/m4.include/gnulib/fsusage.m4 \ + $(top_srcdir)/m4.include/gnulib/mountlist.m4 \ + $(top_srcdir)/m4.include/gnulib/windows-stat-inodes.m4 \ + $(top_srcdir)/m4.include/gnulib/sys_types_h.m4 \ + $(top_srcdir)/m4.include/ax_path_lib_pcre.m4 \ + $(top_srcdir)/m4.include/dx_doxygen.m4 \ + $(top_srcdir)/m4.include/ax_require_defined.m4 \ + $(top_srcdir)/m4.include/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4.include/ax_append_flag.m4 \ + $(top_srcdir)/m4.include/ax_append_compile_flags.m4 \ + $(top_srcdir)/m4.include/mc-cflags.m4 \ + $(top_srcdir)/m4.include/ax_gcc_func_attribute.m4 \ + $(top_srcdir)/m4.include/mc-check-search-type.m4 \ + $(top_srcdir)/m4.include/mc-get-fs-info.m4 \ + $(top_srcdir)/m4.include/mc-with-x.m4 \ + $(top_srcdir)/m4.include/mc-use-termcap.m4 \ + $(top_srcdir)/m4.include/mc-with-screen.m4 \ + $(top_srcdir)/m4.include/mc-with-screen-ncurses.m4 \ + $(top_srcdir)/m4.include/mc-with-screen-slang.m4 \ + $(top_srcdir)/m4.include/mc-with-internal-edit.m4 \ + $(top_srcdir)/m4.include/mc-subshell.m4 \ + $(top_srcdir)/m4.include/mc-background.m4 \ + $(top_srcdir)/m4.include/mc-ext2fs-attr.m4 \ + $(top_srcdir)/m4.include/mc-glib.m4 \ + $(top_srcdir)/m4.include/mc-vfs.m4 \ + $(top_srcdir)/m4.include/vfs/rpc.m4 \ + $(top_srcdir)/m4.include/vfs/socket.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-extfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-sfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-ftp.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-sftp.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-fish.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-undelfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-tarfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-cpiofs.m4 \ + $(top_srcdir)/m4.include/mc-version.m4 \ + $(top_srcdir)/m4.include/mc-tests.m4 \ + $(top_srcdir)/m4.include/mc-i18n.m4 \ + $(top_srcdir)/m4.include/mc-assert.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__EXEEXT_1 = glob_prepare_replace_str$(EXEEXT) \ + glob_translate_to_regex$(EXEEXT) \ + hex_translate_to_regex$(EXEEXT) regex_replace_esc_seq$(EXEEXT) \ + regex_process_escape_sequence$(EXEEXT) \ + translate_replace_glob_to_regex$(EXEEXT) +am_glob_prepare_replace_str_OBJECTS = \ + glob_prepare_replace_str.$(OBJEXT) +glob_prepare_replace_str_OBJECTS = \ + $(am_glob_prepare_replace_str_OBJECTS) +glob_prepare_replace_str_LDADD = $(LDADD) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am_glob_translate_to_regex_OBJECTS = \ + glob_translate_to_regex.$(OBJEXT) +glob_translate_to_regex_OBJECTS = \ + $(am_glob_translate_to_regex_OBJECTS) +glob_translate_to_regex_LDADD = $(LDADD) +am_hex_translate_to_regex_OBJECTS = hex_translate_to_regex.$(OBJEXT) +hex_translate_to_regex_OBJECTS = $(am_hex_translate_to_regex_OBJECTS) +hex_translate_to_regex_LDADD = $(LDADD) +am_regex_process_escape_sequence_OBJECTS = \ + regex_process_escape_sequence.$(OBJEXT) +regex_process_escape_sequence_OBJECTS = \ + $(am_regex_process_escape_sequence_OBJECTS) +regex_process_escape_sequence_LDADD = $(LDADD) +am_regex_replace_esc_seq_OBJECTS = regex_replace_esc_seq.$(OBJEXT) +regex_replace_esc_seq_OBJECTS = $(am_regex_replace_esc_seq_OBJECTS) +regex_replace_esc_seq_LDADD = $(LDADD) +am_translate_replace_glob_to_regex_OBJECTS = \ + translate_replace_glob_to_regex.$(OBJEXT) +translate_replace_glob_to_regex_OBJECTS = \ + $(am_translate_replace_glob_to_regex_OBJECTS) +translate_replace_glob_to_regex_LDADD = $(LDADD) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/glob_prepare_replace_str.Po \ + ./$(DEPDIR)/glob_translate_to_regex.Po \ + ./$(DEPDIR)/hex_translate_to_regex.Po \ + ./$(DEPDIR)/regex_process_escape_sequence.Po \ + ./$(DEPDIR)/regex_replace_esc_seq.Po \ + ./$(DEPDIR)/translate_replace_glob_to_regex.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(glob_prepare_replace_str_SOURCES) \ + $(glob_translate_to_regex_SOURCES) \ + $(hex_translate_to_regex_SOURCES) \ + $(regex_process_escape_sequence_SOURCES) \ + $(regex_replace_esc_seq_SOURCES) \ + $(translate_replace_glob_to_regex_SOURCES) +DIST_SOURCES = $(glob_prepare_replace_str_SOURCES) \ + $(glob_translate_to_regex_SOURCES) \ + $(hex_translate_to_regex_SOURCES) \ + $(regex_process_escape_sequence_SOURCES) \ + $(regex_replace_esc_seq_SOURCES) \ + $(translate_replace_glob_to_regex_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red='[0;31m'; \ + grn='[0;32m'; \ + lgn='[1;32m'; \ + blu='[1;34m'; \ + mgn='[0;35m'; \ + brg='[1m'; \ + std='[m'; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_CFLAGS = @CHECK_CFLAGS@ +CHECK_LIBS = @CHECK_LIBS@ +COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ +COM_ERR_LIBS = @COM_ERR_LIBS@ +CP1251 = @CP1251@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOC_LINGUAS = @DOC_LINGUAS@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +E2P_CFLAGS = @E2P_CFLAGS@ +E2P_LIBS = @E2P_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ +EXT2FS_LIBS = @EXT2FS_LIBS@ +EXTHELPERSDIR = @EXTHELPERSDIR@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +HAVE_FILECMD = @HAVE_FILECMD@ +HAVE_ZIPINFO = @HAVE_ZIPINFO@ +HAVE_nroff = @HAVE_nroff@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBMC_RELEASE = @LIBMC_RELEASE@ +LIBMC_VERSION = @LIBMC_VERSION@ +LIBOBJS = @LIBOBJS@ +LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la @PCRE_LIBS@ \ + $(am__append_1) +LIBSSH_CFLAGS = @LIBSSH_CFLAGS@ +LIBSSH_LIBS = @LIBSSH_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANDOC = @MANDOC@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_DATE = @MAN_DATE@ +MAN_FLAGS = @MAN_FLAGS@ +MAN_VERSION = @MAN_VERSION@ +MCLIBS = @MCLIBS@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = "/lib/search" +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRE_CPPFLAGS = @PCRE_CPPFLAGS@ +PCRE_LIBS = @PCRE_LIBS@ +PERL = @PERL@ +PERL_FOR_BUILD = @PERL_FOR_BUILD@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +RANLIB = @RANLIB@ +RUBY = @RUBY@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SLANG_CFLAGS = @SLANG_CFLAGS@ +SLANG_LIBS = @SLANG_LIBS@ +STRIP = @STRIP@ +TESTS_LDFLAGS = @TESTS_LDFLAGS@ +UNZIP = @UNZIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +X11_WWW = @X11_WWW@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZIP = @ZIP@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/lib/search \ + @CHECK_CFLAGS@ \ + @PCRE_CPPFLAGS@ + +glob_prepare_replace_str_SOURCES = \ + glob_prepare_replace_str.c + +regex_replace_esc_seq_SOURCES = \ + regex_replace_esc_seq.c + +regex_process_escape_sequence_SOURCES = \ + regex_process_escape_sequence.c + +translate_replace_glob_to_regex_SOURCES = \ + translate_replace_glob_to_regex.c + +glob_translate_to_regex_SOURCES = \ + glob_translate_to_regex.c + +hex_translate_to_regex_SOURCES = \ + hex_translate_to_regex.c + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/lib/search/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/lib/search/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +glob_prepare_replace_str$(EXEEXT): $(glob_prepare_replace_str_OBJECTS) $(glob_prepare_replace_str_DEPENDENCIES) $(EXTRA_glob_prepare_replace_str_DEPENDENCIES) + @rm -f glob_prepare_replace_str$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(glob_prepare_replace_str_OBJECTS) $(glob_prepare_replace_str_LDADD) $(LIBS) + +glob_translate_to_regex$(EXEEXT): $(glob_translate_to_regex_OBJECTS) $(glob_translate_to_regex_DEPENDENCIES) $(EXTRA_glob_translate_to_regex_DEPENDENCIES) + @rm -f glob_translate_to_regex$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(glob_translate_to_regex_OBJECTS) $(glob_translate_to_regex_LDADD) $(LIBS) + +hex_translate_to_regex$(EXEEXT): $(hex_translate_to_regex_OBJECTS) $(hex_translate_to_regex_DEPENDENCIES) $(EXTRA_hex_translate_to_regex_DEPENDENCIES) + @rm -f hex_translate_to_regex$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(hex_translate_to_regex_OBJECTS) $(hex_translate_to_regex_LDADD) $(LIBS) + +regex_process_escape_sequence$(EXEEXT): $(regex_process_escape_sequence_OBJECTS) $(regex_process_escape_sequence_DEPENDENCIES) $(EXTRA_regex_process_escape_sequence_DEPENDENCIES) + @rm -f regex_process_escape_sequence$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(regex_process_escape_sequence_OBJECTS) $(regex_process_escape_sequence_LDADD) $(LIBS) + +regex_replace_esc_seq$(EXEEXT): $(regex_replace_esc_seq_OBJECTS) $(regex_replace_esc_seq_DEPENDENCIES) $(EXTRA_regex_replace_esc_seq_DEPENDENCIES) + @rm -f regex_replace_esc_seq$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(regex_replace_esc_seq_OBJECTS) $(regex_replace_esc_seq_LDADD) $(LIBS) + +translate_replace_glob_to_regex$(EXEEXT): $(translate_replace_glob_to_regex_OBJECTS) $(translate_replace_glob_to_regex_DEPENDENCIES) $(EXTRA_translate_replace_glob_to_regex_DEPENDENCIES) + @rm -f translate_replace_glob_to_regex$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(translate_replace_glob_to_regex_OBJECTS) $(translate_replace_glob_to_regex_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glob_prepare_replace_str.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glob_translate_to_regex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hex_translate_to_regex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex_process_escape_sequence.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex_replace_esc_seq.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/translate_replace_glob_to_regex.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: $(check_PROGRAMS) + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +glob_prepare_replace_str.log: glob_prepare_replace_str$(EXEEXT) + @p='glob_prepare_replace_str$(EXEEXT)'; \ + b='glob_prepare_replace_str'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +glob_translate_to_regex.log: glob_translate_to_regex$(EXEEXT) + @p='glob_translate_to_regex$(EXEEXT)'; \ + b='glob_translate_to_regex'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +hex_translate_to_regex.log: hex_translate_to_regex$(EXEEXT) + @p='hex_translate_to_regex$(EXEEXT)'; \ + b='hex_translate_to_regex'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +regex_replace_esc_seq.log: regex_replace_esc_seq$(EXEEXT) + @p='regex_replace_esc_seq$(EXEEXT)'; \ + b='regex_replace_esc_seq'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +regex_process_escape_sequence.log: regex_process_escape_sequence$(EXEEXT) + @p='regex_process_escape_sequence$(EXEEXT)'; \ + b='regex_process_escape_sequence'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +translate_replace_glob_to_regex.log: translate_replace_glob_to_regex$(EXEEXT) + @p='translate_replace_glob_to_regex$(EXEEXT)'; \ + b='translate_replace_glob_to_regex'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/glob_prepare_replace_str.Po + -rm -f ./$(DEPDIR)/glob_translate_to_regex.Po + -rm -f ./$(DEPDIR)/hex_translate_to_regex.Po + -rm -f ./$(DEPDIR)/regex_process_escape_sequence.Po + -rm -f ./$(DEPDIR)/regex_replace_esc_seq.Po + -rm -f ./$(DEPDIR)/translate_replace_glob_to_regex.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/glob_prepare_replace_str.Po + -rm -f ./$(DEPDIR)/glob_translate_to_regex.Po + -rm -f ./$(DEPDIR)/hex_translate_to_regex.Po + -rm -f ./$(DEPDIR)/regex_process_escape_sequence.Po + -rm -f ./$(DEPDIR)/regex_replace_esc_seq.Po + -rm -f ./$(DEPDIR)/translate_replace_glob_to_regex.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/lib/search/glob_prepare_replace_str.c b/tests/lib/search/glob_prepare_replace_str.c new file mode 100644 index 0000000..26ccce5 --- /dev/null +++ b/tests/lib/search/glob_prepare_replace_str.c @@ -0,0 +1,109 @@ +/* + libmc - checks for processing esc sequences in replace string + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Andrew Borodin <aborodin@vmail.ru>, 2014 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "lib/search/glob" + +#include "tests/mctest.h" + +#include "glob.c" /* for testing static functions */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_glob_prepare_replace_str_ds") */ +/* *INDENT-OFF* */ +static const struct test_glob_prepare_replace_str_ds +{ + const char *input_value; + const char *glob_str; + const char *replace_str; + const char *expected_result; +} test_glob_prepare_replace_str_ds[] = +{ + { /* 0. */ + "qqwwee", + "*ww*", + "\\1AA\\2", + "qqAAee" + }, + { /* 1. */ + "qqwwee", + "*qq*", + "\\1SS\\2", + "SSwwee" + }, + { /* 2. */ + "qqwwee", + "*ee*", + "\\1RR\\2", + "qqwwRR" + } +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_glob_prepare_replace_str_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_glob_prepare_replace_str, test_glob_prepare_replace_str_ds) +/* *INDENT-ON* */ +{ + /* given */ + mc_search_t *s; + char *dest_str; + + s = mc_search_new (data->glob_str, NULL); + s->is_case_sensitive = TRUE; + s->search_type = MC_SEARCH_T_GLOB; + + /* when */ + mc_search_run (s, data->input_value, 0, strlen (data->input_value), NULL); + dest_str = mc_search_prepare_replace_str2 (s, (char *) data->replace_str); + + /* then */ + mctest_assert_str_eq (dest_str, data->expected_result); + + g_free (dest_str); + mc_search_free (s); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + 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); + /* *********************************** */ + + 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 new file mode 100644 index 0000000..9d44834 --- /dev/null +++ b/tests/lib/search/glob_translate_to_regex.c @@ -0,0 +1,121 @@ +/* + libmc - checks for processing esc sequences in replace string + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Andrew Borodin <aborodin@vmail.ru>, 2011 + Slava Zanko <slavazanko@gmail.com>, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "lib/search/glob" + +#include "tests/mctest.h" + +#include "glob.c" /* for testing static functions */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_glob_translate_to_regex_ds") */ +/* *INDENT-OFF* */ +static const struct test_glob_translate_to_regex_ds +{ + const char *input_value; + const char *expected_result; +} test_glob_translate_to_regex_ds[] = +{ + { + "test*", + "test(.*)" + }, + { + "t?es*t", + "t(.)es(.*)t" + }, + { + "te{st}", + "te(st)" + }, + { + "te{st|ts}", + "te(st|ts)" + }, + { + "te{st,ts}", + "te(st|ts)" + }, + { + "te[st]", + "te[st]" + }, + { + "t,e.st", + "t,e\\.st" + }, + { + "^t,e.+st+$", + "\\^t,e\\.\\+st\\+\\$" + }, + { + "te!@#$%^&*()_+|\";:'{}:><?\\?\\*.,/[]|\\/st", + "te!@#\\$%\\^&(.*)\\(\\)_\\+|\";:'():><(.)\\?\\*\\.,/[]|\\/st" + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_glob_translate_to_regex_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_glob_translate_to_regex, test_glob_translate_to_regex_ds) +/* *INDENT-ON* */ +{ + /* given */ + GString *tmp = g_string_new (data->input_value); + GString *dest_str; + + /* when */ + dest_str = mc_search__glob_translate_to_regex (tmp); + + /* then */ + g_string_free (tmp, TRUE); + + mctest_assert_str_eq (dest_str->str, data->expected_result); + g_string_free (dest_str, TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + 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); + /* *********************************** */ + + 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 new file mode 100644 index 0000000..86ed23a --- /dev/null +++ b/tests/lib/search/hex_translate_to_regex.c @@ -0,0 +1,194 @@ +/* + libmc - checks for hex pattern parsing + + Copyright (C) 2017-2022 + Free Software Foundation, Inc. + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "lib/search/hex" + +#include "tests/mctest.h" + +#include "hex.c" /* for testing static functions */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_hex_translate_to_regex_ds") */ +/* *INDENT-OFF* */ +static const struct test_hex_translate_to_regex_ds +{ + const char *input_value; + const char *expected_result; + mc_search_hex_parse_error_t expected_error; +} test_hex_translate_to_regex_ds[] = +{ + { + /* Simplest case */ + "12 34", + "\\x12\\x34", + MC_SEARCH_HEX_E_OK + }, + { + /* Prefixes (0x, 0X) */ + "0x12 0X34", + "\\x12\\x34", + MC_SEARCH_HEX_E_OK + }, + { + /* Prefix "0" doesn't signify octal! Numbers are always interpreted in hex. */ + "012", + "\\x12", + MC_SEARCH_HEX_E_OK + }, + { + /* Extra whitespace */ + " 12 34 ", + "\\x12\\x34", + MC_SEARCH_HEX_E_OK + }, + { + /* Min/max values */ + "0 ff", + "\\x00\\xFF", + MC_SEARCH_HEX_E_OK + }, + { + /* Error: Number out of range */ + "100", + NULL, + MC_SEARCH_HEX_E_NUM_OUT_OF_RANGE + }, + { + /* Error: Number out of range (negative) */ + "-1", + NULL, + MC_SEARCH_HEX_E_NUM_OUT_OF_RANGE + }, + { + /* Error: Invalid characters */ + "1 z 2", + NULL, + MC_SEARCH_HEX_E_INVALID_CHARACTER + }, + /* + * Quotes. + */ + { + " \"abc\" ", + "abc", + MC_SEARCH_HEX_E_OK + }, + { + /* Preserve upper/lower case */ + "\"aBc\"", + "aBc", + MC_SEARCH_HEX_E_OK + }, + { + " 12\"abc\"34 ", + "\\x12abc\\x34", + MC_SEARCH_HEX_E_OK + }, + { + "\"a\"\"b\"", + "ab", + MC_SEARCH_HEX_E_OK + }, + /* Empty quotes */ + { + "\"\"", + "", + MC_SEARCH_HEX_E_OK + }, + { + "12 \"\"", + "\\x12", + MC_SEARCH_HEX_E_OK + }, + /* Error: Unmatched quotes */ + { + "\"a", + NULL, + MC_SEARCH_HEX_E_UNMATCHED_QUOTES + }, + { + "\"", + NULL, + MC_SEARCH_HEX_E_UNMATCHED_QUOTES + }, + /* Escaped quotes */ + { + "\"a\\\"b\"", + "a\"b", + MC_SEARCH_HEX_E_OK + }, + { + "\"a\\\\b\"", + "a\\b", + MC_SEARCH_HEX_E_OK + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_hex_translate_to_regex_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_hex_translate_to_regex, test_hex_translate_to_regex_ds) +/* *INDENT-ON* */ +{ + GString *tmp, *dest_str; + mc_search_hex_parse_error_t error = MC_SEARCH_HEX_E_OK; + + /* given */ + tmp = g_string_new (data->input_value); + + /* when */ + dest_str = mc_search__hex_translate_to_regex (tmp, &error, NULL); + + g_string_free (tmp, TRUE); + + /* then */ + if (dest_str != NULL) + { + mctest_assert_str_eq (dest_str->str, data->expected_result); + g_string_free (dest_str, TRUE); + } + else + ck_assert_int_eq (error, data->expected_error); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + 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); + /* *********************************** */ + + 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 new file mode 100644 index 0000000..20a38b4 --- /dev/null +++ b/tests/lib/search/regex_process_escape_sequence.c @@ -0,0 +1,155 @@ +/* + libmc - checks for processing esc sequences in replace string + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "lib/search/regex" + +#include "tests/mctest.h" + +#include "regex.c" /* for testing static functions */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_regex_process_escape_sequence_ds") */ +/* *INDENT-OFF* */ +static const struct test_regex_process_escape_sequence_ds +{ + const char *input_from; + const replace_transform_type_t input_initial_flags; + const gboolean input_use_utf; + const char *expected_string; +} test_regex_process_escape_sequence_ds[] = +{ + { /* 0. */ + "{101}", + REPLACE_T_NO_TRANSFORM, + FALSE, + "A" + }, + { /* 1. */ + "x42", + REPLACE_T_NO_TRANSFORM, + FALSE, + "B" + }, + { /* 2. */ + "x{444}", + REPLACE_T_NO_TRANSFORM, + FALSE, + "D" + }, + { /* 3. */ + "x{444}", + REPLACE_T_NO_TRANSFORM, + TRUE, + "Ñ„" + }, + { /* 4. */ + "n", + REPLACE_T_NO_TRANSFORM, + FALSE, + "\n" + }, + { /* 5. */ + "t", + REPLACE_T_NO_TRANSFORM, + FALSE, + "\t" + }, + { /* 6. */ + "v", + REPLACE_T_NO_TRANSFORM, + FALSE, + "\v" + }, + { /* 7. */ + "b", + REPLACE_T_NO_TRANSFORM, + FALSE, + "\b" + }, + { /* 8. */ + "r", + REPLACE_T_NO_TRANSFORM, + FALSE, + "\r" + }, + { /* 9. */ + "f", + REPLACE_T_NO_TRANSFORM, + FALSE, + "\f" + }, + { /* 10. */ + "a", + REPLACE_T_NO_TRANSFORM, + FALSE, + "\a" + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_regex_process_escape_sequence_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_regex_process_escape_sequence, test_regex_process_escape_sequence_ds) +/* *INDENT-ON* */ +{ + /* given */ + GString *actual_string; + replace_transform_type_t replace_flags = REPLACE_T_NO_TRANSFORM; + + replace_flags = data->input_initial_flags; + actual_string = g_string_new (""); + + /* when */ + mc_search_regex__process_escape_sequence (actual_string, data->input_from, -1, &replace_flags, + data->input_use_utf); + + /* then */ + mctest_assert_str_eq (actual_string->str, data->expected_string); + + g_string_free (actual_string, TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + 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); + /* *********************************** */ + + 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 new file mode 100644 index 0000000..1a3b22d --- /dev/null +++ b/tests/lib/search/regex_replace_esc_seq.c @@ -0,0 +1,226 @@ +/* + libmc - checks for processing esc sequences in replace string + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "lib/search/regex" + +#include "tests/mctest.h" + +#include "regex.c" /* for testing static functions */ + +/* --------------------------------------------------------------------------------------------- */ +#define test_helper_check_valid_data( a, b, c, d, e, f ) \ +{ \ + ck_assert_msg (a == b, "ret_value != %s", (b) ? "TRUE": "FALSE"); \ + ck_assert_msg (c == d, "skip_len(%d) != %d", c, d); \ + if (f != 0) \ + ck_assert_msg (e == f, "ret(%d) != %d", e, f); \ +} + +#define test_helper_handle_esc_seq( pos, r, skip, flag ) \ +{ \ + skip_len = 0;\ + test_helper_check_valid_data(\ + mc_search_regex__replace_handle_esc_seq( replace_str, pos, &skip_len, &ret ), r,\ + skip_len, skip,\ + ret, flag\ + ); \ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_regex_replace_esc_seq_prepare_ds") */ +/* *INDENT-OFF* */ +static const struct test_regex_replace_esc_seq_prepare_ds +{ + const char *input_string; + const size_t input_pos; + + const gboolean expected_result; + const gsize expected_skipped_len; + const int expected_flags; +} test_regex_replace_esc_seq_prepare_ds[] = +{ + { /* 0. \\{123} */ + "bla-bla\\{123}bla-bla\\xabc234 bla-bla\\x{456abcd}bla-bla\\xtre\\n\\t\\v\\b\\r\\f\\a", + 7, + FALSE, + 6, + REPLACE_PREPARE_T_ESCAPE_SEQ + }, + { /* 1. \\xab */ + "bla-bla\\{123}bla-bla\\xabc234 bla-bla\\x{456abcd}bla-bla\\xtre\\n\\t\\v\\b\\r\\f\\a", + 20, + FALSE, + 4, + REPLACE_PREPARE_T_ESCAPE_SEQ + }, + { /* 2. \\x{456abcd} */ + "bla-bla\\{123}bla-bla\\xabc234 bla-bla\\x{456abcd}bla-bla\\xtre\\n\\t\\v\\b\\r\\f\\a", + 36, + FALSE, + 11, + REPLACE_PREPARE_T_ESCAPE_SEQ + }, + { /* 3. \\xtre */ + "bla-bla\\{123}bla-bla\\xabc234 bla-bla\\x{456abcd}bla-bla\\xtre\\n\\t\\v\\b\\r\\f\\a", + 54, + FALSE, + 2, + REPLACE_PREPARE_T_NOTHING_SPECIAL + }, + { /* 4. \\n */ + "bla-bla\\{123}bla-bla\\xabc234 bla-bla\\x{456abcd}bla-bla\\xtre\\n\\t\\v\\b\\r\\f\\a", + 59, + FALSE, + 2, + REPLACE_PREPARE_T_ESCAPE_SEQ + }, + { /* 5. \\t */ + "bla-bla\\{123}bla-bla\\xabc234 bla-bla\\x{456abcd}bla-bla\\xtre\\n\\t\\v\\b\\r\\f\\a", + 61, + FALSE, + 2, + REPLACE_PREPARE_T_ESCAPE_SEQ + }, + { /* 6. \\v */ + "bla-bla\\{123}bla-bla\\xabc234 bla-bla\\x{456abcd}bla-bla\\xtre\\n\\t\\v\\b\\r\\f\\a", + 63, + FALSE, + 2, + REPLACE_PREPARE_T_ESCAPE_SEQ + }, + { /* 7. \\b */ + "bla-bla\\{123}bla-bla\\xabc234 bla-bla\\x{456abcd}bla-bla\\xtre\\n\\t\\v\\b\\r\\f\\a", + 65, + FALSE, + 2, + REPLACE_PREPARE_T_ESCAPE_SEQ + }, + { /* 8. \\r */ + "bla-bla\\{123}bla-bla\\xabc234 bla-bla\\x{456abcd}bla-bla\\xtre\\n\\t\\v\\b\\r\\f\\a", + 67, + FALSE, + 2, + REPLACE_PREPARE_T_ESCAPE_SEQ + }, + { /* 9. \\f */ + "bla-bla\\{123}bla-bla\\xabc234 bla-bla\\x{456abcd}bla-bla\\xtre\\n\\t\\v\\b\\r\\f\\a", + 69, + FALSE, + 2, + REPLACE_PREPARE_T_ESCAPE_SEQ + }, + { /* 10. \\a */ + "bla-bla\\{123}bla-bla\\xabc234 bla-bla\\x{456abcd}bla-bla\\xtre\\n\\t\\v\\b\\r\\f\\a", + 71, + FALSE, + 2, + REPLACE_PREPARE_T_ESCAPE_SEQ + }, + { /* 11. \\{123 */ + "\\{123 \\x{qwerty} \\12} \\x{456a-bcd}bla-bla\\satre", + 0, + TRUE, + 5, + REPLACE_PREPARE_T_NOTHING_SPECIAL + }, + { /* 12. \\x{qwerty} */ + "\\{123 \\x{qwerty} \\12} \\x{456a-bcd}bla-bla\\satre", + 6, + TRUE, + 3, + REPLACE_PREPARE_T_NOTHING_SPECIAL + }, + { /* 13. \\12} */ + "\\{123 \\x{qwerty} \\12} \\x{456a-bcd}bla-bla\\satre", + 17, + TRUE, + 0, + 0 + }, + { /* 14. \\x{456a-bcd} */ + "\\{123 \\x{qwerty} \\12} \\x{456a-bcd}bla-bla\\satre", + 22, + TRUE, + 7, + REPLACE_PREPARE_T_NOTHING_SPECIAL + }, + { /* 15. \\satre */ + "\\{123 \\x{qwerty} \\12} \\x{456a-bcd}bla-bla\\satre", + 41, + TRUE, + 0, + 0 + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_regex_replace_esc_seq_prepare_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_regex_replace_esc_seq_prepare, test_regex_replace_esc_seq_prepare_ds) +/* *INDENT-ON* */ +{ + /* given */ + GString *replace_str; + gsize actual_skipped_len = 0; + int actual_flags = 0; + gboolean actual_result; + + replace_str = g_string_new (data->input_string); + + /* when */ + actual_result = + mc_search_regex__replace_handle_esc_seq (replace_str, data->input_pos, &actual_skipped_len, + &actual_flags); + + /* then */ + ck_assert_int_eq (actual_result, data->expected_result); + ck_assert_int_eq (actual_skipped_len, data->expected_skipped_len); + ck_assert_int_eq (actual_flags, data->expected_flags); + + g_string_free (replace_str, TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + 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); + /* *********************************** */ + + 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 new file mode 100644 index 0000000..5b77fc7 --- /dev/null +++ b/tests/lib/search/translate_replace_glob_to_regex.c @@ -0,0 +1,98 @@ +/* + libmc - checks for processing esc sequences in replace string + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Andrew Borodin <aborodin@vmail.ru>, 2011 + Slava Zanko <slavazanko@gmail.com>, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "lib/search/glob" + +#include "tests/mctest.h" + +#include "glob.c" /* for testing static functions */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_translate_replace_glob_to_regex_ds") */ +/* *INDENT-OFF* */ +static const struct test_translate_replace_glob_to_regex_ds +{ + const char *input_value; + const char *expected_result; +} test_translate_replace_glob_to_regex_ds[] = +{ + { + "a&a?a", + "a\\&a\\1a" + }, + { + "a\\&a?a", + "a\\&a\\1a" + }, + { + "a&a\\?a", + "a\\&a\\?a" + }, + { + "a\\&a\\?a", + "a\\&a\\?a" + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_translate_replace_glob_to_regex_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_translate_replace_glob_to_regex, test_translate_replace_glob_to_regex_ds) +/* *INDENT-ON* */ +{ + /* given */ + GString *dest_str; + + /* when */ + dest_str = mc_search__translate_replace_glob_to_regex (data->input_value); + + /* then */ + mctest_assert_str_eq (dest_str->str, data->expected_result); + g_string_free (dest_str, TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + 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); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/serialize.c b/tests/lib/serialize.c new file mode 100644 index 0000000..7e122c2 --- /dev/null +++ b/tests/lib/serialize.c @@ -0,0 +1,387 @@ +/* + lib - common serialize/deserialize functions + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib" + +#include "tests/mctest.h" + +#include "lib/strutil.h" +#include "lib/serialize.h" + +static GError *error = NULL; + +static const char *deserialize_input_value1 = + "g6:group1p6:param1v10:some valuep6:param2v11:some value " + "g6:group2p6:param1v4:truep6:param2v6:123456" + "g6:group3p6:param1v11:::bla-bla::p6:param2v31:bla-:p1:w:v2:12:g3:123:bla-bla\n" + "g6:group4p6:param1v5:falsep6:param2v6:654321"; + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + error = NULL; +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ + g_clear_error (&error); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_serialize_ds") */ +/* *INDENT-OFF* */ +static const struct test_serialize_ds +{ + const char input_char_prefix; + const char *input_string; + const char *expected_result; +} test_serialize_ds[] = +{ + { + 's', + "some test string", + "s16:some test string" + }, + { + 'a', + "some test test test string", + "a26:some test test test string" + }, +}; +/* *INDENT-ON* */ +/* @Test(dataSource = "test_serialize_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_serialize, test_serialize_ds) +/* *INDENT-ON* */ +{ + /* given */ + char *actual_result; + + /* when */ + actual_result = mc_serialize_str (data->input_char_prefix, data->input_string, &error); + + /* then */ + mctest_assert_str_eq (actual_result, data->expected_result); + + g_free (actual_result); + + if (error != NULL) + g_error_free (error); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_deserialize_incorrect_ds") */ +/* *INDENT-OFF* */ +static const struct test_deserialize_incorrect_ds +{ + const char input_char_prefix; + const char *input_string; + const int expected_error_code; + const char *expected_error_string; +} test_deserialize_incorrect_ds[] = +{ + { + 's', + NULL, + 0, /* FIXME, TODO */ + "mc_serialize_str(): Input data is NULL or empty." + }, + { + 's', + "incorrect string", + 0, /* FIXME, TODO */ + "mc_serialize_str(): String prefix doesn't equal to 's'" + }, + { + 's', + "s12345string without delimiter", + 0, /* FIXME, TODO */ + "mc_serialize_str(): Length delimiter ':' doesn't exists" + }, + { + 's', + "s1234567890123456789012345678901234567890123456789012345678901234567890:too big number", + 0, /* FIXME, TODO */ + "mc_serialize_str(): Too big string length" + }, + { + 's', + "s500:actual string length less that specified length", + 0, /* FIXME, TODO */ + "mc_serialize_str(): Specified data length (500) is greater than actual data length (47)" + }, +}; +/* *INDENT-ON* */ +/* @Test(dataSource = "test_deserialize_incorrect_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_deserialize_incorrect, test_deserialize_incorrect_ds) +/* *INDENT-ON* */ +{ + /* given */ + char *actual_result; + + /* when */ + actual_result = mc_deserialize_str (data->input_char_prefix, data->input_string, &error); + + /* then */ + mctest_assert_null (actual_result); + + ck_assert_int_eq (error->code, data->expected_error_code); + mctest_assert_str_eq (error->message, data->expected_error_string); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_deserialize_ds") */ +/* *INDENT-OFF* */ +static const struct test_deserialize_ds +{ + const char input_char_prefix; + const char *input_string; + const char *expected_result; +} test_deserialize_ds[] = +{ + { + 's', + "s10:actual string length great that specified length", + "actual str" + }, + { + 'r', + "r21:The right test string", + "The right test string" + }, +}; +/* *INDENT-ON* */ +/* @Test(dataSource = "test_deserialize_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_deserialize, test_deserialize_ds) +/* *INDENT-ON* */ +{ + /* given */ + char *actual_result; + + /* when */ + actual_result = mc_deserialize_str (data->input_char_prefix, data->input_string, &error); + + /* then */ + mctest_assert_str_eq (actual_result, data->expected_result); + + g_free (actual_result); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* *INDENT-OFF* */ +START_TEST (test_serialize_config) +/* *INDENT-ON* */ +{ + /* given */ + mc_config_t *test_data; + char *actual; + const char *expected_result = "g6:group1p6:param1v10:some valuep6:param2v11:some value " + "g6:group2p6:param1v4:truep6:param2v6:123456" + "g6:group3p6:param1v11:::bla-bla::p6:param2v31:bla-:p1:w:v2:12:g3:123:bla-bla\n" + "g6:group4p6:param1v5:falsep6:param2v6:654321"; + + test_data = mc_config_init (NULL, FALSE); + + mc_config_set_string_raw (test_data, "group1", "param1", "some value"); + mc_config_set_string (test_data, "group1", "param2", "some value "); + + mc_config_set_bool (test_data, "group2", "param1", TRUE); + mc_config_set_int (test_data, "group2", "param2", 123456); + + mc_config_set_string_raw (test_data, "group3", "param1", "::bla-bla::"); + mc_config_set_string (test_data, "group3", "param2", "bla-:p1:w:v2:12:g3:123:bla-bla\n"); + + mc_config_set_bool (test_data, "group4", "param1", FALSE); + mc_config_set_int (test_data, "group4", "param2", 654321); + + /* when */ + actual = mc_serialize_config (test_data, &error); + mc_config_deinit (test_data); + + /* then */ + mctest_assert_not_null (actual); + mctest_assert_str_eq (actual, expected_result); + + g_free (actual); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ +/* @DataSource("test_deserialize_config_incorrect_ds") */ +/* *INDENT-OFF* */ +static const struct test_deserialize_config_incorrect_ds +{ + const char *input_string; + const int expected_error_code; + const char *expected_error_string; +} test_deserialize_config_incorrect_ds[] = +{ + { + "g123error in group name", + 0, /* FIXME, TODO */ + "mc_deserialize_config() at 1: mc_serialize_str(): Length delimiter ':' doesn't exists" + }, + { + "p6:param1v10:some valuep6:param2v11:some value ", + 0, /* FIXME, TODO */ + "mc_deserialize_config() at 1: mc_serialize_str(): String prefix doesn't equal to 'g'" + }, + { + "g6:group1v10:some valuep6:param2v11:some value ", + 0, /* FIXME, TODO */ + "mc_deserialize_config() at 10: mc_serialize_str(): String prefix doesn't equal to 'p'" + }, + { + "g6:group1p6000:param2v11:some value ", + 0, /* FIXME, TODO */ + "mc_deserialize_config() at 10: mc_serialize_str(): Specified data length (6000) is greater than actual data length (21)" + }, +}; +/* *INDENT-ON* */ +/* @Test(dataSource = "test_deserialize_config_incorrect_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_deserialize_config_incorrect, test_deserialize_config_incorrect_ds) +/* *INDENT-ON* */ +{ + /* given */ + mc_config_t *actual_result; + + /* when */ + actual_result = mc_deserialize_config (data->input_string, &error); + + /* then */ + mctest_assert_null (actual_result); + + ck_assert_int_eq (error->code, data->expected_error_code); + mctest_assert_str_eq (error->message, data->expected_error_string); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* *INDENT-OFF* */ +START_TEST (test_deserialize_config) +/* *INDENT-ON* */ +{ + /* given */ + mc_config_t *actual; + char *actual_value; + + /* when */ + actual = mc_deserialize_config (deserialize_input_value1, &error); + + /* then */ + mctest_assert_not_null (actual); + + actual_value = mc_config_get_string_raw (actual, "group1", "param1", ""); + mctest_assert_str_eq (actual_value, "some value"); + g_free (actual_value); + + actual_value = mc_config_get_string (actual, "group1", "param2", ""); + mctest_assert_str_eq (actual_value, "some value "); + g_free (actual_value); + + mctest_assert_true (mc_config_get_bool (actual, "group2", "param1", FALSE)); + + ck_assert_int_eq (mc_config_get_int (actual, "group2", "param2", 0), 123456); + + actual_value = mc_config_get_string_raw (actual, "group3", "param1", ""); + mctest_assert_str_eq (actual_value, "::bla-bla::"); + g_free (actual_value); + + actual_value = mc_config_get_string (actual, "group3", "param2", ""); + mctest_assert_str_eq (actual_value, "bla-:p1:w:v2:12:g3:123:bla-bla\n"); + g_free (actual_value); + + mctest_assert_false (mc_config_get_bool (actual, "group4", "param1", TRUE)); + + ck_assert_int_eq (mc_config_get_int (actual, "group4", "param2", 0), 654321); + + mc_config_deinit (actual); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +#undef input_value +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_serialize, test_serialize_ds); + + mctest_add_parameterized_test (tc_core, test_deserialize_incorrect, + test_deserialize_incorrect_ds); + + mctest_add_parameterized_test (tc_core, test_deserialize, test_deserialize_ds); + + tcase_add_test (tc_core, test_serialize_config); + + mctest_add_parameterized_test (tc_core, test_deserialize_config_incorrect, + test_deserialize_config_incorrect_ds); + + tcase_add_test (tc_core, test_deserialize_config); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/strutil/Makefile.am b/tests/lib/strutil/Makefile.am new file mode 100644 index 0000000..6d88f65 --- /dev/null +++ b/tests/lib/strutil/Makefile.am @@ -0,0 +1,33 @@ +PACKAGE_STRING = "/lib/strutil" + +AM_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + -I$(top_srcdir) \ + @CHECK_CFLAGS@ + +LIBS = @CHECK_LIBS@ \ + $(top_builddir)/lib/libmc.la + +if ENABLE_MCLIB +LIBS += $(GLIB_LIBS) +endif + +TESTS = \ + replace__str_replace_all \ + parse_integer \ + str_verscmp \ + filevercmp + +check_PROGRAMS = $(TESTS) + +replace__str_replace_all_SOURCES = \ + replace__str_replace_all.c + +parse_integer_SOURCES = \ + parse_integer.c + +str_verscmp_SOURCES = \ + str_verscmp.c + +filevercmp_SOURCES = \ + filevercmp.c diff --git a/tests/lib/strutil/Makefile.in b/tests/lib/strutil/Makefile.in new file mode 100644 index 0000000..51e70b9 --- /dev/null +++ b/tests/lib/strutil/Makefile.in @@ -0,0 +1,1182 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@ENABLE_MCLIB_TRUE@am__append_1 = $(GLIB_LIBS) +TESTS = replace__str_replace_all$(EXEEXT) parse_integer$(EXEEXT) \ + str_verscmp$(EXEEXT) filevercmp$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = tests/lib/strutil +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/m4.include/gnulib/mode_t.m4 \ + $(top_srcdir)/m4.include/gnulib/stat-size.m4 \ + $(top_srcdir)/m4.include/gnulib/fstypename.m4 \ + $(top_srcdir)/m4.include/gnulib/fsusage.m4 \ + $(top_srcdir)/m4.include/gnulib/mountlist.m4 \ + $(top_srcdir)/m4.include/gnulib/windows-stat-inodes.m4 \ + $(top_srcdir)/m4.include/gnulib/sys_types_h.m4 \ + $(top_srcdir)/m4.include/ax_path_lib_pcre.m4 \ + $(top_srcdir)/m4.include/dx_doxygen.m4 \ + $(top_srcdir)/m4.include/ax_require_defined.m4 \ + $(top_srcdir)/m4.include/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4.include/ax_append_flag.m4 \ + $(top_srcdir)/m4.include/ax_append_compile_flags.m4 \ + $(top_srcdir)/m4.include/mc-cflags.m4 \ + $(top_srcdir)/m4.include/ax_gcc_func_attribute.m4 \ + $(top_srcdir)/m4.include/mc-check-search-type.m4 \ + $(top_srcdir)/m4.include/mc-get-fs-info.m4 \ + $(top_srcdir)/m4.include/mc-with-x.m4 \ + $(top_srcdir)/m4.include/mc-use-termcap.m4 \ + $(top_srcdir)/m4.include/mc-with-screen.m4 \ + $(top_srcdir)/m4.include/mc-with-screen-ncurses.m4 \ + $(top_srcdir)/m4.include/mc-with-screen-slang.m4 \ + $(top_srcdir)/m4.include/mc-with-internal-edit.m4 \ + $(top_srcdir)/m4.include/mc-subshell.m4 \ + $(top_srcdir)/m4.include/mc-background.m4 \ + $(top_srcdir)/m4.include/mc-ext2fs-attr.m4 \ + $(top_srcdir)/m4.include/mc-glib.m4 \ + $(top_srcdir)/m4.include/mc-vfs.m4 \ + $(top_srcdir)/m4.include/vfs/rpc.m4 \ + $(top_srcdir)/m4.include/vfs/socket.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-extfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-sfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-ftp.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-sftp.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-fish.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-undelfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-tarfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-cpiofs.m4 \ + $(top_srcdir)/m4.include/mc-version.m4 \ + $(top_srcdir)/m4.include/mc-tests.m4 \ + $(top_srcdir)/m4.include/mc-i18n.m4 \ + $(top_srcdir)/m4.include/mc-assert.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__EXEEXT_1 = replace__str_replace_all$(EXEEXT) \ + parse_integer$(EXEEXT) str_verscmp$(EXEEXT) \ + filevercmp$(EXEEXT) +am_filevercmp_OBJECTS = filevercmp.$(OBJEXT) +filevercmp_OBJECTS = $(am_filevercmp_OBJECTS) +filevercmp_LDADD = $(LDADD) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am_parse_integer_OBJECTS = parse_integer.$(OBJEXT) +parse_integer_OBJECTS = $(am_parse_integer_OBJECTS) +parse_integer_LDADD = $(LDADD) +am_replace__str_replace_all_OBJECTS = \ + replace__str_replace_all.$(OBJEXT) +replace__str_replace_all_OBJECTS = \ + $(am_replace__str_replace_all_OBJECTS) +replace__str_replace_all_LDADD = $(LDADD) +am_str_verscmp_OBJECTS = str_verscmp.$(OBJEXT) +str_verscmp_OBJECTS = $(am_str_verscmp_OBJECTS) +str_verscmp_LDADD = $(LDADD) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/filevercmp.Po \ + ./$(DEPDIR)/parse_integer.Po \ + ./$(DEPDIR)/replace__str_replace_all.Po \ + ./$(DEPDIR)/str_verscmp.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(filevercmp_SOURCES) $(parse_integer_SOURCES) \ + $(replace__str_replace_all_SOURCES) $(str_verscmp_SOURCES) +DIST_SOURCES = $(filevercmp_SOURCES) $(parse_integer_SOURCES) \ + $(replace__str_replace_all_SOURCES) $(str_verscmp_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red='[0;31m'; \ + grn='[0;32m'; \ + lgn='[1;32m'; \ + blu='[1;34m'; \ + mgn='[0;35m'; \ + brg='[1m'; \ + std='[m'; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_CFLAGS = @CHECK_CFLAGS@ +CHECK_LIBS = @CHECK_LIBS@ +COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ +COM_ERR_LIBS = @COM_ERR_LIBS@ +CP1251 = @CP1251@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOC_LINGUAS = @DOC_LINGUAS@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +E2P_CFLAGS = @E2P_CFLAGS@ +E2P_LIBS = @E2P_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ +EXT2FS_LIBS = @EXT2FS_LIBS@ +EXTHELPERSDIR = @EXTHELPERSDIR@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +HAVE_FILECMD = @HAVE_FILECMD@ +HAVE_ZIPINFO = @HAVE_ZIPINFO@ +HAVE_nroff = @HAVE_nroff@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBMC_RELEASE = @LIBMC_RELEASE@ +LIBMC_VERSION = @LIBMC_VERSION@ +LIBOBJS = @LIBOBJS@ +LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la $(am__append_1) +LIBSSH_CFLAGS = @LIBSSH_CFLAGS@ +LIBSSH_LIBS = @LIBSSH_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANDOC = @MANDOC@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_DATE = @MAN_DATE@ +MAN_FLAGS = @MAN_FLAGS@ +MAN_VERSION = @MAN_VERSION@ +MCLIBS = @MCLIBS@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = "/lib/strutil" +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRE_CPPFLAGS = @PCRE_CPPFLAGS@ +PCRE_LIBS = @PCRE_LIBS@ +PERL = @PERL@ +PERL_FOR_BUILD = @PERL_FOR_BUILD@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +RANLIB = @RANLIB@ +RUBY = @RUBY@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SLANG_CFLAGS = @SLANG_CFLAGS@ +SLANG_LIBS = @SLANG_LIBS@ +STRIP = @STRIP@ +TESTS_LDFLAGS = @TESTS_LDFLAGS@ +UNZIP = @UNZIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +X11_WWW = @X11_WWW@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZIP = @ZIP@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + -I$(top_srcdir) \ + @CHECK_CFLAGS@ + +replace__str_replace_all_SOURCES = \ + replace__str_replace_all.c + +parse_integer_SOURCES = \ + parse_integer.c + +str_verscmp_SOURCES = \ + str_verscmp.c + +filevercmp_SOURCES = \ + filevercmp.c + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/lib/strutil/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/lib/strutil/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +filevercmp$(EXEEXT): $(filevercmp_OBJECTS) $(filevercmp_DEPENDENCIES) $(EXTRA_filevercmp_DEPENDENCIES) + @rm -f filevercmp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(filevercmp_OBJECTS) $(filevercmp_LDADD) $(LIBS) + +parse_integer$(EXEEXT): $(parse_integer_OBJECTS) $(parse_integer_DEPENDENCIES) $(EXTRA_parse_integer_DEPENDENCIES) + @rm -f parse_integer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(parse_integer_OBJECTS) $(parse_integer_LDADD) $(LIBS) + +replace__str_replace_all$(EXEEXT): $(replace__str_replace_all_OBJECTS) $(replace__str_replace_all_DEPENDENCIES) $(EXTRA_replace__str_replace_all_DEPENDENCIES) + @rm -f replace__str_replace_all$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(replace__str_replace_all_OBJECTS) $(replace__str_replace_all_LDADD) $(LIBS) + +str_verscmp$(EXEEXT): $(str_verscmp_OBJECTS) $(str_verscmp_DEPENDENCIES) $(EXTRA_str_verscmp_DEPENDENCIES) + @rm -f str_verscmp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(str_verscmp_OBJECTS) $(str_verscmp_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filevercmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_integer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/replace__str_replace_all.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_verscmp.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: $(check_PROGRAMS) + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +replace__str_replace_all.log: replace__str_replace_all$(EXEEXT) + @p='replace__str_replace_all$(EXEEXT)'; \ + b='replace__str_replace_all'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +parse_integer.log: parse_integer$(EXEEXT) + @p='parse_integer$(EXEEXT)'; \ + b='parse_integer'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +str_verscmp.log: str_verscmp$(EXEEXT) + @p='str_verscmp$(EXEEXT)'; \ + b='str_verscmp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +filevercmp.log: filevercmp$(EXEEXT) + @p='filevercmp$(EXEEXT)'; \ + b='filevercmp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/filevercmp.Po + -rm -f ./$(DEPDIR)/parse_integer.Po + -rm -f ./$(DEPDIR)/replace__str_replace_all.Po + -rm -f ./$(DEPDIR)/str_verscmp.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/filevercmp.Po + -rm -f ./$(DEPDIR)/parse_integer.Po + -rm -f ./$(DEPDIR)/replace__str_replace_all.Po + -rm -f ./$(DEPDIR)/str_verscmp.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/lib/strutil/filevercmp.c b/tests/lib/strutil/filevercmp.c new file mode 100644 index 0000000..c33a4bc --- /dev/null +++ b/tests/lib/strutil/filevercmp.c @@ -0,0 +1,399 @@ +/* + lib/strutil - tests for lib/strutil/fileverscmp function. + + Copyright (C) 2019-2022 + Free Software Foundation, Inc. + + Written by: + Andrew Borodin <aborodin@vmail.ru>, 2019 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/strutil" + +#include "tests/mctest.h" + +#include "lib/strutil.h" +#include "lib/util.h" /* _GL_CMP() */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +static int +sign (int n) +{ + return _GL_CMP (n, 0); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* + * Return filevercmp (a, a), checking that a similar result is gotten after replacing all '\1's + * with '\0's and calling filenvercmp with the embedded '\0's. + */ +static int +test_filevercmp (char const *a, char const *b) +{ + int result; + char buffer[BUF_1K]; + size_t alen, blen; + size_t i; + int nresult; + + result = filevercmp (a, b); + + alen = strlen (a); + blen = strlen (b); + + ck_assert_int_le (alen + blen, sizeof (buffer)); + memcpy (buffer, a, alen); + memcpy (buffer + alen, b, blen); + + for (i = 0; i < alen + blen; i++) + if (buffer[i] == '\1') + buffer[i] = '\0'; + + nresult = filenvercmp (buffer, alen, buffer + alen, blen); + ck_assert_int_eq (sign (nresult), sign (result)); + + return result; +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("filevercmp_test_ds1") */ +/* Testcases are taken from Gnulib */ +/* *INDENT-OFF* */ +static const struct filevercmp_test_struct +{ + const char *s1; + const char *s2; + int expected_result; +} filevercmp_test_ds1[] = +{ + { "", "", 0 }, + { "a", "a", 0 }, + { "a", "b", -1 }, + { "b", "a", 1 }, + { "00", "01", -1 }, + { "01", "010", -1 }, + { "9", "10", -1 }, + { "0a", "0", 1 } +}; +/* *INDENT-ON* */ + + +/* @Test(dataSource = "filevercmp_test_ds1") */ +/* *INDENT-OFF* */ +START_TEST (filevercmp_test1) +/* *INDENT-ON* */ +{ + /* given */ + int actual_result; + const struct filevercmp_test_struct *data = &filevercmp_test_ds1[_i]; + + /* when */ + actual_result = filevercmp (data->s1, data->s2); + + /* then */ + ck_assert_int_eq (sign (actual_result), sign (data->expected_result)); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("filevercmp_test_ds2") */ +/* Testcases are taken from Gnulib */ +static const char *filevercmp_test_ds2[] = { + "", + ".", + "..", + ".0", + ".9", + ".A", + ".Z", + ".a~", + ".a", + ".b~", + ".b", + ".z", + ".zz~", + ".zz", + ".zz.~1~", + ".zz.0", + ".\1", + ".\1.txt", + ".\1x", + ".\1x\1", + ".\1.0", + "0", + "9", + "A", + "Z", + "a~", + "a", + "a.b~", + "a.b", + "a.bc~", + "a.bc", + "a+", + "a.", + "a..a", + "a.+", + "b~", + "b", + "gcc-c++-10.fc9.tar.gz", + "gcc-c++-10.fc9.tar.gz.~1~", + "gcc-c++-10.fc9.tar.gz.~2~", + "gcc-c++-10.8.12-0.7rc2.fc9.tar.bz2", + "gcc-c++-10.8.12-0.7rc2.fc9.tar.bz2.~1~", + "glibc-2-0.1.beta1.fc10.rpm", + "glibc-common-5-0.2.beta2.fc9.ebuild", + "glibc-common-5-0.2b.deb", + "glibc-common-11b.ebuild", + "glibc-common-11-0.6rc2.ebuild", + "libstdc++-0.5.8.11-0.7rc2.fc10.tar.gz", + "libstdc++-4a.fc8.tar.gz", + "libstdc++-4.10.4.20040204svn.rpm", + "libstdc++-devel-3.fc8.ebuild", + "libstdc++-devel-3a.fc9.tar.gz", + "libstdc++-devel-8.fc8.deb", + "libstdc++-devel-8.6.2-0.4b.fc8", + "nss_ldap-1-0.2b.fc9.tar.bz2", + "nss_ldap-1-0.6rc2.fc8.tar.gz", + "nss_ldap-1.0-0.1a.tar.gz", + "nss_ldap-10beta1.fc8.tar.gz", + "nss_ldap-10.11.8.6.20040204cvs.fc10.ebuild", + "z", + "zz~", + "zz", + "zz.~1~", + "zz.0", + "zz.0.txt", + "\1", + "\1.txt", + "\1x", + "\1x\1", + "\1.0", + "#\1.b#", + "#.b#" +}; + +const size_t filevercmp_test_ds2_len = G_N_ELEMENTS (filevercmp_test_ds2); + +/* @Test(dataSource = "filevercmp_test_ds2") */ +/* *INDENT-OFF* */ +START_TEST (filevercmp_test2) +/* *INDENT-ON* */ +{ + const char *i = filevercmp_test_ds2[_i]; + size_t _j; + + for (_j = 0; _j < filevercmp_test_ds2_len; _j++) + { + const char *j = filevercmp_test_ds2[_j]; + int result; + + result = test_filevercmp (i, j); + + if (result < 0) + ck_assert_int_lt ((size_t) _i, _j); + else if (result > 0) + ck_assert_int_gt ((size_t) _i, _j); + else + ck_assert_int_eq ((size_t) _i, _j); + } +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + + +/* @DataSource("filevercmp_test_ds3") */ +/* Ticket #3959 */ +static const char *filevercmp_test_ds3[] = { + "application-1.10.tar.gz", + "application-1.10.1.tar.gz" +}; + +const size_t filevercmp_test_ds3_len = G_N_ELEMENTS (filevercmp_test_ds3); + +/* @Test(dataSource = "filevercmp_test_ds3") */ +/* *INDENT-OFF* */ +START_TEST (filevercmp_test3) +/* *INDENT-ON* */ +{ + const char *i = filevercmp_test_ds3[_i]; + size_t _j; + + for (_j = 0; _j < filevercmp_test_ds3_len; _j++) + { + const char *j = filevercmp_test_ds3[_j]; + int result; + + result = filevercmp (i, j); + + if (result < 0) + ck_assert_int_lt ((size_t) _i, _j); + else if (result > 0) + ck_assert_int_gt ((size_t) _i, _j); + else + ck_assert_int_eq ((size_t) _i, _j); + } +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + + +/* @DataSource("filevercmp_test_ds4") */ +/* Ticket #3905 */ +static const char *filevercmp_test_ds4[] = { + "firefox-58.0.1+build1.tar.gz", + "firefox-59.0~b14+build1.tar.gz", + "firefox-59.0.1+build1.tar.gz" +}; + +const size_t filevercmp_test_ds4_len = G_N_ELEMENTS (filevercmp_test_ds4); + +/* @Test(dataSource = "filevercmp_test_ds4") */ +/* *INDENT-OFF* */ +START_TEST (filevercmp_test4) +/* *INDENT-ON* */ +{ + const char *i = filevercmp_test_ds4[_i]; + size_t _j; + + for (_j = 0; _j < filevercmp_test_ds4_len; _j++) + { + const char *j = filevercmp_test_ds4[_j]; + int result; + + result = filevercmp (i, j); + + if (result < 0) + ck_assert_int_lt ((size_t) _i, _j); + else if (result > 0) + ck_assert_int_gt ((size_t) _i, _j); + else + ck_assert_int_eq ((size_t) _i, _j); + } +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + + +/* @DataSource("filevercmp_test_ds5") */ +/* Testcases are taken from Gnulib */ +static const char *filevercmp_test_ds5[] = { + "a", + "a0", + "a0000", + NULL, + "a\1c-27.txt", + "a\1c-027.txt", + "a\1c-00000000000000000000000000000000000000000000000000000027.txt", + NULL, + ".a\1c-27.txt", + ".a\1c-027.txt", + ".a\1c-00000000000000000000000000000000000000000000000000000027.txt", + NULL, + "a\1c-", + "a\1c-0", + "a\1c-00", + NULL, + ".a\1c-", + ".a\1c-0", + ".a\1c-00", + NULL, + "a\1c-0.txt", + "a\1c-00.txt", + NULL, + ".a\1c-1\1.txt", + ".a\1c-001\1.txt", + NULL +}; + +const size_t filevercmp_test_ds5_len = G_N_ELEMENTS (filevercmp_test_ds5); + +/* @Test(dataSource = "filevercmp_test_ds5") */ +/* *INDENT-OFF* */ +START_TEST (filevercmp_test5) +/* *INDENT-ON* */ +{ + size_t ii; + + for (ii = 0; ii < filevercmp_test_ds5_len; ii++) + for (; filevercmp_test_ds5[ii] != NULL; ii++) + { + const char *i = filevercmp_test_ds5[ii]; + size_t jj; + + for (jj = ii; filevercmp_test_ds5[jj] != NULL; jj++) + { + const char *j = filevercmp_test_ds5[jj]; + + ck_assert_int_eq (test_filevercmp (i, j), 0); + ck_assert_int_eq (test_filevercmp (j, i), 0); + } + } +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, filevercmp_test1, filevercmp_test_ds1); + tcase_add_loop_test (tc_core, filevercmp_test2, 0, filevercmp_test_ds2_len); + tcase_add_loop_test (tc_core, filevercmp_test3, 0, filevercmp_test_ds3_len); + tcase_add_loop_test (tc_core, filevercmp_test4, 0, filevercmp_test_ds4_len); + tcase_add_test (tc_core, filevercmp_test5); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/strutil/parse_integer.c b/tests/lib/strutil/parse_integer.c new file mode 100644 index 0000000..5c51bd5 --- /dev/null +++ b/tests/lib/strutil/parse_integer.c @@ -0,0 +1,159 @@ +/* + lib/strutil - tests for lib/strutil/parse_integer function. + + Copyright (C) 2013-2022 + Free Software Foundation, Inc. + + Written by: + Andrew Borodin <aborodin@vmail.ru>, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/strutil" + +#include "tests/mctest.h" + +#include <inttypes.h> + +#include "lib/strutil.h" + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("parse_integer_test_ds") */ +/* *INDENT-OFF* */ +static const struct parse_integer_test_ds +{ + const char *haystack; + uintmax_t expected_result; + gboolean invalid; +} parse_integer_test_ds[] = +{ + { + /* too big */ + "99999999999999999999999999999999999999999999999999999999999999999999", + 0, + TRUE + }, + { + "x", + 0, + TRUE + }, + { + "9x", + 0, + TRUE + }, + { + "1", + 1, + FALSE + }, + { + "-1", + 0, + TRUE + }, + { + "1k", + 1024, + FALSE + }, + { + "1K", + 1024, + FALSE + }, + { + "1M", + 1024 * 1024, + FALSE + }, + { + "1m", + 0, + TRUE + }, + { + "64M", + 64 * 1024 * 1024, + FALSE + }, + { + "1G", + 1 * 1024 * 1024 * 1024, + FALSE + } +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "parse_integer_test_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (parse_integer_test, parse_integer_test_ds) +/* *INDENT-ON* */ +{ + /* given */ + uintmax_t actual_result; + gboolean invalid = FALSE; + + /* when */ + actual_result = parse_integer (data->haystack, &invalid); + + /* then */ + ck_assert_msg (invalid == data->invalid && actual_result == data->expected_result, + "actial ( %" PRIuMAX ") not equal to\nexpected (%" PRIuMAX ")", + actual_result, data->expected_result); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, parse_integer_test, parse_integer_test_ds); + /* *********************************** */ + + 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 new file mode 100644 index 0000000..6ac60f4 --- /dev/null +++ b/tests/lib/strutil/replace__str_replace_all.c @@ -0,0 +1,186 @@ +/* + lib/strutil - tests for lib/strutil/replace:str_replace_all() function. + + Copyright (C) 2013-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/strutil" + +#include "tests/mctest.h" + +#include "lib/strutil.h" + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("str_replace_all_test_ds") */ +/* *INDENT-OFF* */ +static const struct str_replace_all_test_ds +{ + const char *haystack; + const char *needle; + const char *replacement; + const char *expected_result; +} str_replace_all_test_ds[] = +{ + { + /* 0. needle not found*/ + "needle not found", + "blablablabla", + "1234567890", + "needle not found", + }, + { + /* 1. replacement is less rather that needle */ + "some string blablablabla string", + "blablablabla", + "1234", + "some string 1234 string", + }, + { + /* 2. replacement is great rather that needle */ + "some string bla string", + "bla", + "1234567890", + "some string 1234567890 string", + }, + { + /* 3. replace few substrings in a start of string */ + "blabla blabla string", + "blabla", + "111111111", + "111111111 111111111 string", + }, + { + /* 4. replace few substrings in a middle of string */ + "some string blabla str blabla string", + "blabla", + "111111111", + "some string 111111111 str 111111111 string", + }, + { + /* 5. replace few substrings in an end of string */ + "some string blabla str blabla", + "blabla", + "111111111", + "some string 111111111 str 111111111", + }, + { + /* 6. escaped substring */ + "\\blabla blabla", + "blabla", + "111111111", + "blabla 111111111", + }, + { + /* 7. escaped substring */ + "str \\blabla blabla", + "blabla", + "111111111", + "str blabla 111111111", + }, + { + /* 8. escaped substring */ + "str \\\\\\blabla blabla", + "blabla", + "111111111", + "str \\\\blabla 111111111", + }, + { + /* 9. double-escaped substring (actually non-escaped) */ + "\\\\blabla blabla", + "blabla", + "111111111", + "\\\\111111111 111111111", + }, + { + /* 10. partial substring */ + "blablabla", + "blabla", + "111111111", + "111111111bla", + }, + { + /* 11. special symbols */ + "bla bla", + "bla", + "111\t1 1\n1111", + "111\t1 1\n1111 111\t1 1\n1111", + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "str_replace_all_test_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (str_replace_all_test, str_replace_all_test_ds) +/* *INDENT-ON* */ +{ + /* given */ + char *actual_result; + + /* when */ + actual_result = str_replace_all (data->haystack, data->needle, data->replacement); + + /* then */ + g_assert_cmpstr (actual_result, ==, data->expected_result); + g_free (actual_result); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, str_replace_all_test, str_replace_all_test_ds); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/strutil/str_verscmp.c b/tests/lib/strutil/str_verscmp.c new file mode 100644 index 0000000..619f134 --- /dev/null +++ b/tests/lib/strutil/str_verscmp.c @@ -0,0 +1,136 @@ +/* + lib/strutil - tests for lib/strutil/str_verscmp function. + Testcases are taken from Gnulib. + + Copyright (C) 2019-2022 + Free Software Foundation, Inc. + + Written by: + Andrew Borodin <aborodin@vmail.ru>, 2019 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/strutil" + +#include "tests/mctest.h" + +#include "lib/strutil.h" +#include "lib/util.h" /* _GL_CMP() */ + +/* --------------------------------------------------------------------------------------------- */ + +/* From glibc bug 9913 */ +static char const a[] = "B0075022800016.gbp.corp.com"; +static char const b[] = "B007502280067.gbp.corp.com"; +static char const c[] = "B007502357019.GBP.CORP.COM"; + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +static int +sign (int n) +{ + return _GL_CMP (n, 0); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("str_verscmp_test_ds") */ +/* *INDENT-OFF* */ +static const struct str_verscmp_test_struct +{ + const char *s1; + const char *s2; + int expected_result; +} str_verscmp_test_ds[] = +{ + { "", "", 0 }, + { "a", "a", 0 }, + { "a", "b", -1 }, + { "b", "a", 1 }, + { "000", "00", -1 }, + { "00", "000", 1 }, + { "a0", "a", 1 }, + { "00", "01", -1 }, + { "01", "010", -1 }, + { "010", "09", -1 }, + { "09", "0", -1 }, + { "9", "10", -1 }, + { "0a", "0", 1 }, + /* From glibc bug 9913 */ + { a, b, -1 }, + { b, c, -1 }, + { a, c, -1 }, + { b, a, 1 }, + { c, b, 1 }, + { c, a, 1 } +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "str_verscmp_test_ds") */ +/* *INDENT-OFF* */ +START_TEST (str_verscmp_test) +/* *INDENT-ON* */ +{ + /* given */ + int actual_result; + const struct str_verscmp_test_struct *data = &str_verscmp_test_ds[_i]; + + /* when */ + actual_result = str_verscmp (data->s1, data->s2); + + /* then */ + ck_assert_int_eq (sign (actual_result), sign (data->expected_result)); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, str_verscmp_test, str_verscmp_test_ds); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/utilunix__mc_pstream_get_string.c b/tests/lib/utilunix__mc_pstream_get_string.c new file mode 100644 index 0000000..808a5e9 --- /dev/null +++ b/tests/lib/utilunix__mc_pstream_get_string.c @@ -0,0 +1,396 @@ +/* + lib - Read string from mc_pipe_stream + + Copyright (C) 2021-2022 + Free Software Foundation, Inc. + + Written by: + Andrew Borodin <aborodin@vmail.ru>, 2021 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/util" + +#include "tests/mctest.h" + +#include "lib/util.h" + +/* --------------------------------------------------------------------------------------------- */ + +#define MAX_CHUNKS 8 + +/* --------------------------------------------------------------------------------------------- */ + +static mc_pipe_stream_t stream; + +static char etalon_long_file_list[BUF_1K]; +static size_t etalon_long_file_list_pos; + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ +} + +/* @After */ +static void +teardown (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("data_source") */ +/* *INDENT-OFF* */ +static const struct data_source +{ + /* input */ + const char *buf; /* string to read */ + + /* output */ + int pos[MAX_CHUNKS]; /* ps.pos values */ + const char *str[MAX_CHUNKS]; /* chunks */ + size_t len[MAX_CHUNKS]; /* chunk lengths */ +} +data_source[] = +{ + /* 0 */ + { + .buf = "", + .pos = { 0 }, + .str = { "" }, + .len = { 0 } + }, + /* 1 */ + { + .buf = "\n", + .pos = { 0, 1 }, + .str = { "\n" }, + .len = { 1, 0 } + }, + /* 2 */ + { + .buf = "\\\n", + .pos = { 0, 2 }, + .str = { "\\\n" }, + .len = { 2, 0 } + }, + /* 3 */ + { + .buf = "\\\\\n", + .pos = { 0, 3 }, + .str = { "\\\\\n" }, + .len = { 3, 0 } + }, + /* 4 */ + { + .buf = "\\\\\\\n", + .pos = { 0, 4 }, + .str = { "\\\\\\\n" }, + .len = { 4, 0 } + }, + /* 5 */ + { + .buf = "\\\\\\\\\n", + .pos = { 0, 5 }, + .str = { "\\\\\\\\\n" }, + .len = { 5, 0 } + }, + /* 6 */ + { + .buf = "12345", + .pos = { 0, 5 }, + .str = { "12345" }, + .len = { 5, 0 } + }, + /* 7 */ + { + .buf = "12345\n", + .pos = { 0, 6 }, + .str = { "12345\n" }, + .len = { 6, 0 } + }, + /* 8 */ + { + .buf = "12345\\\n", + .pos = { 0, 7 }, + .str = { "12345\\\n" }, + .len = { 7, 0 } + }, + /* 9 */ + { + .buf = "12345\\\\\n", + .pos = { 0, 8 }, + .str = { "12345\\\\\n" }, + .len = { 8, 0 } + }, + /* 10 */ + { + .buf = "12345\nabcd", + .pos = { 0, 6, 10 }, + .str = { "12345\n", "abcd" }, + .len = { 6, 4, 0 } + }, + /* 11 */ + { + .buf = "12345\\\nabcd", + .pos = { 0, 11 }, + .str = { "12345\\\nabcd" }, + .len = { 11, 0 } + }, + /* 12 */ + { + .buf = "12345\\\\\nabcd", + .pos = { 0, 8, 12 }, + .str = { "12345\\\\\n", "abcd" }, + .len = { 8, 4, 0 } + }, + /* 13 */ + { + .buf = "12345\\\\\\\nabcd", + .pos = { 0, 13 }, + .str = { "12345\\\\\\\nabcd" }, + .len = { 13, 0 } + }, + /* 14 */ + { + .buf = "12345\\\\\\\\\nabcd", + .pos = { 0, 10, 14 }, + .str = { "12345\\\\\\\\\n", "abcd" }, + .len = { 10, 4, 0 } + }, + /* 15 */ + { + .buf = "12345\nabcd\n", + .pos = { 0, 6, 11 }, + .str = { "12345\n", "abcd\n" }, + .len = { 6, 5, 0 } + }, + /* 16 */ + { + .buf = "12345\nabcd\n~!@#$%^", + .pos = { 0, 6, 11, 18 }, + .str = { "12345\n", "abcd\n", "~!@#$%^" }, + .len = { 6, 5, 7, 0 } + }, + /* 17 */ + { + .buf = "12345\nabcd\n~!@#$%^\n", + .pos = { 0, 6, 11, 19 }, + .str = { "12345\n", "abcd\n", "~!@#$%^\n" }, + .len = { 6, 5, 8, 0 } + } +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "data_source") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (mc_pstream_get_string_test, data_source) +/* *INDENT-ON* */ +{ + /* given */ + int j = 0; + + /* when */ + memset (&stream, 0, sizeof (stream)); + stream.len = strlen (data->buf); + memmove (&stream.buf, data->buf, stream.len); + + /* then */ + do + { + GString *ret; + + ck_assert_int_eq (stream.pos, data->pos[j]); + + ret = mc_pstream_get_string (&stream); + if (ret == NULL) + break; + + ck_assert_int_eq (ret->len, data->len[j]); + mctest_assert_str_eq (ret->str, data->str[j]); + + g_string_free (ret, TRUE); + + j++; + } + while (TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +static mc_pipe_t * +test_mc_popen (void) +{ + mc_pipe_t *p; + + p = g_try_new0 (mc_pipe_t, 1); + /* make less than sizeof (etalon_long_file_list) */ + p->out.len = 128; + + etalon_long_file_list_pos = 0; + + return p; +} + +static void +test_mc_pread (mc_pipe_t * p) +{ + size_t len; + + p->out.pos = 0; + + if (etalon_long_file_list_pos >= sizeof (etalon_long_file_list)) + { + etalon_long_file_list_pos = sizeof (etalon_long_file_list); + p->out.len = MC_PIPE_STREAM_EOF; + return; + } + + len = sizeof (etalon_long_file_list) - etalon_long_file_list_pos; + len = MIN (len, (size_t) p->out.len); + memmove (p->out.buf, etalon_long_file_list + etalon_long_file_list_pos, len); + p->out.len = (ssize_t) len; + + etalon_long_file_list_pos += len; +} + +/* *INDENT-OFF* */ +START_TEST (mc_pstream_get_long_file_list_test) +/* *INDENT-ON* */ + +{ + /* given */ + GString *result_long_file_list = NULL; + mc_pipe_t *pip; + GString *remain_file_name = NULL; + + /* when */ + /* fill the list */ + memset (etalon_long_file_list, 'a', sizeof (etalon_long_file_list) - 1); + /* create an \n-separated list */ + etalon_long_file_list[5] = '\n'; + etalon_long_file_list[25] = '\n'; + etalon_long_file_list[50] = '\n'; + etalon_long_file_list[75] = '\n'; + etalon_long_file_list[127] = '\n'; + etalon_long_file_list[200] = '\n'; + etalon_long_file_list[310] = '\n'; + etalon_long_file_list[325] = '\n'; + etalon_long_file_list[360] = '\n'; + etalon_long_file_list[512] = '\n'; + etalon_long_file_list[701] = '\n'; + etalon_long_file_list[725] = '\n'; + etalon_long_file_list[800] = '\n'; + etalon_long_file_list[sizeof (etalon_long_file_list) - 2] = '\n'; + etalon_long_file_list[sizeof (etalon_long_file_list) - 1] = '\0'; + + /* then */ + /* read file list */ + pip = test_mc_popen (); + + while (TRUE) + { + GString *line; + + test_mc_pread (pip); + + if (pip->out.len == MC_PIPE_STREAM_EOF) + break; + + while ((line = mc_pstream_get_string (&pip->out)) != NULL) + { + /* handle an \n-separated file list */ + + if (line->str[line->len - 1] == '\n') + { + /* entire file name or last chunk */ + + g_string_truncate (line, line->len - 1); + + /* join filename chunks */ + if (remain_file_name != NULL) + { + g_string_append_len (remain_file_name, line->str, line->len); + g_string_free (line, TRUE); + line = remain_file_name; + remain_file_name = NULL; + } + } + else + { + /* first or middle chunk of file name */ + if (remain_file_name == NULL) + remain_file_name = line; + else + { + g_string_append_len (remain_file_name, line->str, line->len); + g_string_free (line, TRUE); + } + + line = NULL; + } + + /* collect file names to assemble the result string */ + if (line == NULL) + continue; + + if (result_long_file_list == NULL) + result_long_file_list = line; + else + { + g_string_append_len (result_long_file_list, line->str, line->len); + g_string_free (line, TRUE); + } + + g_string_append_c (result_long_file_list, '\n'); + } + } + + mctest_assert_str_eq (etalon_long_file_list, result_long_file_list->str); + g_string_free (result_long_file_list, TRUE); + +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, mc_pstream_get_string_test, data_source); + tcase_add_test (tc_core, mc_pstream_get_long_file_list_test); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/utilunix__my_system-common.c b/tests/lib/utilunix__my_system-common.c new file mode 100644 index 0000000..d24970e --- /dev/null +++ b/tests/lib/utilunix__my_system-common.c @@ -0,0 +1,328 @@ +/* + lib - common code for testing lib/utilinux:my_system() function + + Copyright (C) 2013-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <signal.h> +#include <unistd.h> + +#include "lib/vfs/vfs.h" + +/* sighandler_t is GNU extension */ +#ifndef HAVE_SIGHANDLER_T +typedef void (*sighandler_t) (int); +#endif + +/* --------------------------------------------------------------------------------------------- */ + +/* @CapturedValue */ +static sigset_t *sigemptyset_set__captured; +/* @ThenReturnValue */ +static int sigemptyset__return_value = 0; + +/* @Mock */ +int +sigemptyset (sigset_t * set) +{ + sigemptyset_set__captured = set; + return sigemptyset__return_value; +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @CapturedValue */ +static GPtrArray *sigaction_signum__captured = NULL; +/* @CapturedValue */ +static GPtrArray *sigaction_act__captured = NULL; +/* @CapturedValue */ +static GPtrArray *sigaction_oldact__captured = NULL; +/* @ThenReturnValue */ +static int sigaction__return_value = 0; + +/* @Mock */ +int +sigaction (int signum, const struct sigaction *act, struct sigaction *oldact) +{ + int *tmp_signum; + struct sigaction *tmp_act; + + /* store signum */ + tmp_signum = g_new (int, 1); + memcpy (tmp_signum, &signum, sizeof (*tmp_signum)); + if (sigaction_signum__captured != NULL) + g_ptr_array_add (sigaction_signum__captured, tmp_signum); + + /* store act */ + if (act != NULL) + { + tmp_act = g_new (struct sigaction, 1); + memcpy (tmp_act, act, sizeof (*tmp_act)); + } + else + tmp_act = NULL; + if (sigaction_act__captured != NULL) + g_ptr_array_add (sigaction_act__captured, tmp_act); + + /* store oldact */ + if (oldact != NULL) + { + tmp_act = g_new (struct sigaction, 1); + memcpy (tmp_act, oldact, sizeof (*tmp_act)); + } + else + tmp_act = NULL; + if (sigaction_oldact__captured != NULL) + g_ptr_array_add (sigaction_oldact__captured, tmp_act); + + return sigaction__return_value; +} + +static void +sigaction__init (void) +{ + sigaction_signum__captured = g_ptr_array_new (); + sigaction_act__captured = g_ptr_array_new (); + sigaction_oldact__captured = g_ptr_array_new (); +} + +static void +sigaction__deinit (void) +{ + g_ptr_array_foreach (sigaction_signum__captured, (GFunc) g_free, NULL); + g_ptr_array_free (sigaction_signum__captured, TRUE); + sigaction_signum__captured = NULL; + + g_ptr_array_foreach (sigaction_act__captured, (GFunc) g_free, NULL); + g_ptr_array_free (sigaction_act__captured, TRUE); + sigaction_act__captured = NULL; + + g_ptr_array_foreach (sigaction_oldact__captured, (GFunc) g_free, NULL); + g_ptr_array_free (sigaction_oldact__captured, TRUE); + sigaction_oldact__captured = NULL; +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @CapturedValue */ +static GPtrArray *signal_signum__captured; +/* @CapturedValue */ +static GPtrArray *signal_handler__captured; +/* @ThenReturnValue */ +static sighandler_t signal__return_value = NULL; + +/* @Mock */ +sighandler_t +signal (int signum, sighandler_t handler) +{ + int *tmp_signum; + sighandler_t *tmp_handler; + + /* store signum */ + tmp_signum = g_new (int, 1); + memcpy (tmp_signum, &signum, sizeof (*tmp_signum)); + g_ptr_array_add (signal_signum__captured, tmp_signum); + + /* store handler */ + if (handler != SIG_DFL) + { + tmp_handler = g_new (sighandler_t, 1); + memcpy (tmp_handler, handler, sizeof (*tmp_handler)); + } + else + tmp_handler = (void *) SIG_DFL; + g_ptr_array_add (signal_handler__captured, tmp_handler); + + return signal__return_value; +} + +static void +signal__init (void) +{ + signal_signum__captured = g_ptr_array_new (); + signal_handler__captured = g_ptr_array_new (); +} + +static void +signal__deinit (void) +{ + g_ptr_array_foreach (signal_signum__captured, (GFunc) g_free, NULL); + g_ptr_array_free (signal_signum__captured, TRUE); + signal_signum__captured = NULL; + + g_ptr_array_foreach (signal_handler__captured, (GFunc) g_free, NULL); + g_ptr_array_free (signal_handler__captured, TRUE); + signal_handler__captured = NULL; +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @ThenReturnValue */ +static pid_t fork__return_value; + +/* @Mock */ +pid_t +fork (void) +{ + return fork__return_value; +} + +/* --------------------------------------------------------------------------------------------- */ +/* @CapturedValue */ +static int my_exit__status__captured; + +/* @Mock */ +void +my_exit (int status) +{ + my_exit__status__captured = status; +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @CapturedValue */ +static char *execvp__file__captured = NULL; +/* @CapturedValue */ +static GPtrArray *execvp__args__captured; +/* @ThenReturnValue */ +static int execvp__return_value = 0; + +/* @Mock */ +int +execvp (const char *file, char *const argv[]) +{ + char **one_arg; + execvp__file__captured = g_strdup (file); + + for (one_arg = (char **) argv; *one_arg != NULL; one_arg++) + g_ptr_array_add (execvp__args__captured, g_strdup (*one_arg)); + + return execvp__return_value; +} + +static void +execvp__init (void) +{ + execvp__args__captured = g_ptr_array_new (); +} + +static void +execvp__deinit (void) +{ + g_ptr_array_foreach (execvp__args__captured, (GFunc) g_free, NULL); + g_ptr_array_free (execvp__args__captured, TRUE); + execvp__args__captured = NULL; + MC_PTR_FREE (execvp__file__captured); +} + +/* --------------------------------------------------------------------------------------------- */ + +#define VERIFY_SIGACTION__ACT_IGNORED(_pntr) { \ + struct sigaction *_act = (struct sigaction *) _pntr; \ + mctest_assert_ptr_eq (_act->sa_handler, SIG_IGN); \ + ck_assert_int_eq (_act->sa_flags, 0); \ +} + +#define VERIFY_SIGACTION__IS_RESTORED(oldact_idx, act_idx) { \ + struct sigaction *_oldact = (struct sigaction *) g_ptr_array_index(sigaction_oldact__captured, oldact_idx); \ + struct sigaction *_act = (struct sigaction *) g_ptr_array_index(sigaction_act__captured, act_idx); \ + ck_assert_msg (memcmp(_oldact, _act, sizeof(struct sigaction)) == 0, \ + "sigaction(): oldact[%d] should be equals to act[%d]", oldact_idx, act_idx); \ +} + +/* @Verify */ +#define VERIFY_SIGACTION_CALLS() { \ + ck_assert_int_eq (sigaction_signum__captured->len, 6); \ +\ + ck_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 0)), SIGINT); \ + ck_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 1)), SIGQUIT); \ + ck_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 2)), SIGTSTP); \ + ck_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 3)), SIGINT); \ + ck_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 4)), SIGQUIT); \ + ck_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 5)), SIGTSTP); \ +\ + VERIFY_SIGACTION__ACT_IGNORED(g_ptr_array_index(sigaction_act__captured, 0)); \ + VERIFY_SIGACTION__ACT_IGNORED(g_ptr_array_index(sigaction_act__captured, 1)); \ + { \ + struct sigaction *_act = g_ptr_array_index(sigaction_act__captured, 2); \ + ck_assert_msg (memcmp (_act, &startup_handler, sizeof(struct sigaction)) == 0, \ + "The 'act' in third call to sigaction() should be equals to startup_handler"); \ + } \ +\ + VERIFY_SIGACTION__IS_RESTORED (0, 3); \ + VERIFY_SIGACTION__IS_RESTORED (1, 4); \ + VERIFY_SIGACTION__IS_RESTORED (2, 5); \ +\ + ck_assert_msg (g_ptr_array_index(sigaction_oldact__captured, 3) == NULL, \ + "oldact in fourth call to sigaction() should be NULL"); \ + ck_assert_msg (g_ptr_array_index(sigaction_oldact__captured, 4) == NULL, \ + "oldact in fifth call to sigaction() should be NULL"); \ + ck_assert_msg (g_ptr_array_index(sigaction_oldact__captured, 5) == NULL, \ + "oldact in sixth call to sigaction() should be NULL"); \ +} + +/* --------------------------------------------------------------------------------------------- */ + +#define VERIFY_SIGNAL_HANDLER_IS_SIG_DFL(_idx) { \ + sighandler_t *tmp_handler = (sighandler_t *) g_ptr_array_index(signal_handler__captured, _idx);\ + mctest_assert_ptr_eq (tmp_handler, (sighandler_t *) SIG_DFL); \ +} + +/* @Verify */ +#define VERIFY_SIGNAL_CALLS() { \ + ck_assert_int_eq (signal_signum__captured->len, 4); \ + ck_assert_int_eq (*((int *) g_ptr_array_index(signal_signum__captured, 0)), SIGINT); \ + ck_assert_int_eq (*((int *) g_ptr_array_index(signal_signum__captured, 1)), SIGQUIT); \ + ck_assert_int_eq (*((int *) g_ptr_array_index(signal_signum__captured, 2)), SIGTSTP); \ + ck_assert_int_eq (*((int *) g_ptr_array_index(signal_signum__captured, 3)), SIGCHLD); \ + \ + VERIFY_SIGNAL_HANDLER_IS_SIG_DFL (0); \ + VERIFY_SIGNAL_HANDLER_IS_SIG_DFL (1); \ + VERIFY_SIGNAL_HANDLER_IS_SIG_DFL (2); \ + VERIFY_SIGNAL_HANDLER_IS_SIG_DFL (3); \ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + signal__return_value = NULL; + + sigaction__init (); + signal__init (); + execvp__init (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ + execvp__deinit (); + signal__deinit (); + sigaction__deinit (); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/utilunix__my_system-fork_child.c b/tests/lib/utilunix__my_system-fork_child.c new file mode 100644 index 0000000..319f79c --- /dev/null +++ b/tests/lib/utilunix__my_system-fork_child.c @@ -0,0 +1,85 @@ +/* + lib - tests lib/utilinux:my_system() function + + Copyright (C) 2013-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/utilunix" + +#include "tests/mctest.h" + +#include "lib/util.h" +#include "lib/utilunix.h" + +#include "utilunix__my_system-common.c" + +/* --------------------------------------------------------------------------------------------- */ + +/* *INDENT-OFF* */ +START_TEST (fork_child) +/* *INDENT-ON* */ +{ + int actual_value; + /* given */ + fork__return_value = 0; + + /* when */ + actual_value = my_system (0, "/bin/some-command", "some parameter"); + + /* then */ + ck_assert_int_eq (actual_value, 0); + + VERIFY_SIGACTION_CALLS (); + VERIFY_SIGNAL_CALLS (); + + mctest_assert_str_eq (execvp__file__captured, "/bin/some-command"); + ck_assert_int_eq (execvp__args__captured->len, 2); + + mctest_assert_str_eq (g_ptr_array_index (execvp__args__captured, 0), "/bin/some-command"); + mctest_assert_str_eq (g_ptr_array_index (execvp__args__captured, 1), "some parameter"); + + /* All exec* calls is mocked, so call to _exit() function with 127 status code it's a normal situation */ + ck_assert_int_eq (my_exit__status__captured, 127); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + tcase_add_test (tc_core, fork_child); + /* *********************************** */ + + 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 new file mode 100644 index 0000000..70f630b --- /dev/null +++ b/tests/lib/utilunix__my_system-fork_child_shell.c @@ -0,0 +1,86 @@ +/* + lib - tests lib/utilinux:my_system() function + + Copyright (C) 2013-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/utilunix" + +#include "tests/mctest.h" + +#include "lib/util.h" +#include "lib/utilunix.h" + +#include "utilunix__my_system-common.c" + +/* --------------------------------------------------------------------------------------------- */ + +/* *INDENT-OFF* */ +START_TEST (fork_child_as_shell) +/* *INDENT-ON* */ +{ + int actual_value; + /* given */ + fork__return_value = 0; + + /* when */ + actual_value = my_system (EXECUTE_AS_SHELL, "/bin/shell", "some command"); + + /* then */ + ck_assert_int_eq (actual_value, 0); + + VERIFY_SIGACTION_CALLS (); + VERIFY_SIGNAL_CALLS (); + + mctest_assert_str_eq (execvp__file__captured, "/bin/shell"); + ck_assert_int_eq (execvp__args__captured->len, 3); + + mctest_assert_str_eq (g_ptr_array_index (execvp__args__captured, 0), "/bin/shell"); + mctest_assert_str_eq (g_ptr_array_index (execvp__args__captured, 1), "-c"); + mctest_assert_str_eq (g_ptr_array_index (execvp__args__captured, 2), "some command"); + + /* All exec* calls is mocked, so call to _exit() function with 127 status code it's a normal situation */ + ck_assert_int_eq (my_exit__status__captured, 127); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + tcase_add_test (tc_core, fork_child_as_shell); + /* *********************************** */ + + 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 new file mode 100644 index 0000000..14dbf00 --- /dev/null +++ b/tests/lib/utilunix__my_system-fork_fail.c @@ -0,0 +1,81 @@ +/* + lib - tests lib/utilinux:my_system() function + + Copyright (C) 2013-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/utilunix" + +#include "tests/mctest.h" + +#include <signal.h> +#include <unistd.h> + +#include "lib/util.h" +#include "lib/utilunix.h" + +#include "utilunix__my_system-common.c" + +/* --------------------------------------------------------------------------------------------- */ + +/* *INDENT-OFF* */ +START_TEST (fork_fail) +/* *INDENT-ON* */ +{ + int actual_value; + + /* given */ + fork__return_value = -1; + + /* when */ + actual_value = my_system (0, NULL, NULL); + + /* then */ + ck_assert_int_eq (actual_value, -1); + + VERIFY_SIGACTION_CALLS (); + + ck_assert_int_eq (signal_signum__captured->len, 0); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + tcase_add_test (tc_core, fork_fail); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/Makefile.am b/tests/lib/vfs/Makefile.am new file mode 100644 index 0000000..62ebe9f --- /dev/null +++ b/tests/lib/vfs/Makefile.am @@ -0,0 +1,98 @@ +PACKAGE_STRING = "/lib/vfs" + +AM_CPPFLAGS = \ + -DTEST_SHARE_DIR=\"$(abs_srcdir)\" \ + $(GLIB_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/lib/vfs \ + @CHECK_CFLAGS@ + +AM_LDFLAGS = @TESTS_LDFLAGS@ + +EXTRA_DIST = mc.charsets + +LIBS = @CHECK_LIBS@ \ + $(top_builddir)/lib/libmc.la + +if ENABLE_MCLIB +LIBS += $(GLIB_LIBS) +endif + +TESTS = \ + canonicalize_pathname \ + current_dir \ + path_cmp \ + path_len \ + path_manipulations \ + path_serialize \ + relative_cd \ + tempdir \ + vfs_adjust_stat \ + vfs_parse_ls_lga \ + vfs_path_from_str_flags \ + vfs_path_string_convert \ + vfs_prefix_to_class \ + vfs_setup_cwd \ + vfs_split \ + vfs_s_get_path + +if CHARSET +TESTS += path_recode \ + vfs_get_encoding +endif + +check_PROGRAMS = $(TESTS) + +canonicalize_pathname_SOURCES = \ + canonicalize_pathname.c + +current_dir_SOURCES = \ + current_dir.c + +path_cmp_SOURCES = \ + path_cmp.c + +path_len_SOURCES = \ + path_len.c + +path_manipulations_SOURCES = \ + path_manipulations.c + +path_recode_SOURCES = \ + path_recode.c + +path_serialize_SOURCES = \ + path_serialize.c + +relative_cd_SOURCES = \ + relative_cd.c + +tempdir_SOURCES = \ + tempdir.c + +vfs_adjust_stat_SOURCES = \ + vfs_adjust_stat.c + +vfs_get_encoding_SOURCES = \ + vfs_get_encoding.c + +vfs_setup_cwd_SOURCES = \ + vfs_setup_cwd.c + +vfs_split_SOURCES = \ + vfs_split.c + +vfs_parse_ls_lga_SOURCES = \ + vfs_parse_ls_lga.c + +vfs_prefix_to_class_SOURCES = \ + vfs_prefix_to_class.c + +vfs_path_from_str_flags_SOURCES = \ + vfs_path_from_str_flags.c + +vfs_path_string_convert_SOURCES = \ + vfs_path_string_convert.c + +vfs_s_get_path_SOURCES = \ + vfs_s_get_path.c diff --git a/tests/lib/vfs/Makefile.in b/tests/lib/vfs/Makefile.in new file mode 100644 index 0000000..b0c0adc --- /dev/null +++ b/tests/lib/vfs/Makefile.in @@ -0,0 +1,1508 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@ENABLE_MCLIB_TRUE@am__append_1 = $(GLIB_LIBS) +TESTS = canonicalize_pathname$(EXEEXT) current_dir$(EXEEXT) \ + path_cmp$(EXEEXT) path_len$(EXEEXT) \ + path_manipulations$(EXEEXT) path_serialize$(EXEEXT) \ + relative_cd$(EXEEXT) tempdir$(EXEEXT) vfs_adjust_stat$(EXEEXT) \ + vfs_parse_ls_lga$(EXEEXT) vfs_path_from_str_flags$(EXEEXT) \ + vfs_path_string_convert$(EXEEXT) vfs_prefix_to_class$(EXEEXT) \ + vfs_setup_cwd$(EXEEXT) vfs_split$(EXEEXT) \ + vfs_s_get_path$(EXEEXT) $(am__EXEEXT_1) +@CHARSET_TRUE@am__append_2 = path_recode \ +@CHARSET_TRUE@ vfs_get_encoding + +check_PROGRAMS = $(am__EXEEXT_2) +subdir = tests/lib/vfs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/m4.include/gnulib/mode_t.m4 \ + $(top_srcdir)/m4.include/gnulib/stat-size.m4 \ + $(top_srcdir)/m4.include/gnulib/fstypename.m4 \ + $(top_srcdir)/m4.include/gnulib/fsusage.m4 \ + $(top_srcdir)/m4.include/gnulib/mountlist.m4 \ + $(top_srcdir)/m4.include/gnulib/windows-stat-inodes.m4 \ + $(top_srcdir)/m4.include/gnulib/sys_types_h.m4 \ + $(top_srcdir)/m4.include/ax_path_lib_pcre.m4 \ + $(top_srcdir)/m4.include/dx_doxygen.m4 \ + $(top_srcdir)/m4.include/ax_require_defined.m4 \ + $(top_srcdir)/m4.include/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4.include/ax_append_flag.m4 \ + $(top_srcdir)/m4.include/ax_append_compile_flags.m4 \ + $(top_srcdir)/m4.include/mc-cflags.m4 \ + $(top_srcdir)/m4.include/ax_gcc_func_attribute.m4 \ + $(top_srcdir)/m4.include/mc-check-search-type.m4 \ + $(top_srcdir)/m4.include/mc-get-fs-info.m4 \ + $(top_srcdir)/m4.include/mc-with-x.m4 \ + $(top_srcdir)/m4.include/mc-use-termcap.m4 \ + $(top_srcdir)/m4.include/mc-with-screen.m4 \ + $(top_srcdir)/m4.include/mc-with-screen-ncurses.m4 \ + $(top_srcdir)/m4.include/mc-with-screen-slang.m4 \ + $(top_srcdir)/m4.include/mc-with-internal-edit.m4 \ + $(top_srcdir)/m4.include/mc-subshell.m4 \ + $(top_srcdir)/m4.include/mc-background.m4 \ + $(top_srcdir)/m4.include/mc-ext2fs-attr.m4 \ + $(top_srcdir)/m4.include/mc-glib.m4 \ + $(top_srcdir)/m4.include/mc-vfs.m4 \ + $(top_srcdir)/m4.include/vfs/rpc.m4 \ + $(top_srcdir)/m4.include/vfs/socket.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-extfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-sfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-ftp.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-sftp.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-fish.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-undelfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-tarfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-cpiofs.m4 \ + $(top_srcdir)/m4.include/mc-version.m4 \ + $(top_srcdir)/m4.include/mc-tests.m4 \ + $(top_srcdir)/m4.include/mc-i18n.m4 \ + $(top_srcdir)/m4.include/mc-assert.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +@CHARSET_TRUE@am__EXEEXT_1 = path_recode$(EXEEXT) \ +@CHARSET_TRUE@ vfs_get_encoding$(EXEEXT) +am__EXEEXT_2 = canonicalize_pathname$(EXEEXT) current_dir$(EXEEXT) \ + path_cmp$(EXEEXT) path_len$(EXEEXT) \ + path_manipulations$(EXEEXT) path_serialize$(EXEEXT) \ + relative_cd$(EXEEXT) tempdir$(EXEEXT) vfs_adjust_stat$(EXEEXT) \ + vfs_parse_ls_lga$(EXEEXT) vfs_path_from_str_flags$(EXEEXT) \ + vfs_path_string_convert$(EXEEXT) vfs_prefix_to_class$(EXEEXT) \ + vfs_setup_cwd$(EXEEXT) vfs_split$(EXEEXT) \ + vfs_s_get_path$(EXEEXT) $(am__EXEEXT_1) +am_canonicalize_pathname_OBJECTS = canonicalize_pathname.$(OBJEXT) +canonicalize_pathname_OBJECTS = $(am_canonicalize_pathname_OBJECTS) +canonicalize_pathname_LDADD = $(LDADD) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am_current_dir_OBJECTS = current_dir.$(OBJEXT) +current_dir_OBJECTS = $(am_current_dir_OBJECTS) +current_dir_LDADD = $(LDADD) +am_path_cmp_OBJECTS = path_cmp.$(OBJEXT) +path_cmp_OBJECTS = $(am_path_cmp_OBJECTS) +path_cmp_LDADD = $(LDADD) +am_path_len_OBJECTS = path_len.$(OBJEXT) +path_len_OBJECTS = $(am_path_len_OBJECTS) +path_len_LDADD = $(LDADD) +am_path_manipulations_OBJECTS = path_manipulations.$(OBJEXT) +path_manipulations_OBJECTS = $(am_path_manipulations_OBJECTS) +path_manipulations_LDADD = $(LDADD) +am_path_recode_OBJECTS = path_recode.$(OBJEXT) +path_recode_OBJECTS = $(am_path_recode_OBJECTS) +path_recode_LDADD = $(LDADD) +am_path_serialize_OBJECTS = path_serialize.$(OBJEXT) +path_serialize_OBJECTS = $(am_path_serialize_OBJECTS) +path_serialize_LDADD = $(LDADD) +am_relative_cd_OBJECTS = relative_cd.$(OBJEXT) +relative_cd_OBJECTS = $(am_relative_cd_OBJECTS) +relative_cd_LDADD = $(LDADD) +am_tempdir_OBJECTS = tempdir.$(OBJEXT) +tempdir_OBJECTS = $(am_tempdir_OBJECTS) +tempdir_LDADD = $(LDADD) +am_vfs_adjust_stat_OBJECTS = vfs_adjust_stat.$(OBJEXT) +vfs_adjust_stat_OBJECTS = $(am_vfs_adjust_stat_OBJECTS) +vfs_adjust_stat_LDADD = $(LDADD) +am_vfs_get_encoding_OBJECTS = vfs_get_encoding.$(OBJEXT) +vfs_get_encoding_OBJECTS = $(am_vfs_get_encoding_OBJECTS) +vfs_get_encoding_LDADD = $(LDADD) +am_vfs_parse_ls_lga_OBJECTS = vfs_parse_ls_lga.$(OBJEXT) +vfs_parse_ls_lga_OBJECTS = $(am_vfs_parse_ls_lga_OBJECTS) +vfs_parse_ls_lga_LDADD = $(LDADD) +am_vfs_path_from_str_flags_OBJECTS = \ + vfs_path_from_str_flags.$(OBJEXT) +vfs_path_from_str_flags_OBJECTS = \ + $(am_vfs_path_from_str_flags_OBJECTS) +vfs_path_from_str_flags_LDADD = $(LDADD) +am_vfs_path_string_convert_OBJECTS = \ + vfs_path_string_convert.$(OBJEXT) +vfs_path_string_convert_OBJECTS = \ + $(am_vfs_path_string_convert_OBJECTS) +vfs_path_string_convert_LDADD = $(LDADD) +am_vfs_prefix_to_class_OBJECTS = vfs_prefix_to_class.$(OBJEXT) +vfs_prefix_to_class_OBJECTS = $(am_vfs_prefix_to_class_OBJECTS) +vfs_prefix_to_class_LDADD = $(LDADD) +am_vfs_s_get_path_OBJECTS = vfs_s_get_path.$(OBJEXT) +vfs_s_get_path_OBJECTS = $(am_vfs_s_get_path_OBJECTS) +vfs_s_get_path_LDADD = $(LDADD) +am_vfs_setup_cwd_OBJECTS = vfs_setup_cwd.$(OBJEXT) +vfs_setup_cwd_OBJECTS = $(am_vfs_setup_cwd_OBJECTS) +vfs_setup_cwd_LDADD = $(LDADD) +am_vfs_split_OBJECTS = vfs_split.$(OBJEXT) +vfs_split_OBJECTS = $(am_vfs_split_OBJECTS) +vfs_split_LDADD = $(LDADD) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/canonicalize_pathname.Po \ + ./$(DEPDIR)/current_dir.Po ./$(DEPDIR)/path_cmp.Po \ + ./$(DEPDIR)/path_len.Po ./$(DEPDIR)/path_manipulations.Po \ + ./$(DEPDIR)/path_recode.Po ./$(DEPDIR)/path_serialize.Po \ + ./$(DEPDIR)/relative_cd.Po ./$(DEPDIR)/tempdir.Po \ + ./$(DEPDIR)/vfs_adjust_stat.Po ./$(DEPDIR)/vfs_get_encoding.Po \ + ./$(DEPDIR)/vfs_parse_ls_lga.Po \ + ./$(DEPDIR)/vfs_path_from_str_flags.Po \ + ./$(DEPDIR)/vfs_path_string_convert.Po \ + ./$(DEPDIR)/vfs_prefix_to_class.Po \ + ./$(DEPDIR)/vfs_s_get_path.Po ./$(DEPDIR)/vfs_setup_cwd.Po \ + ./$(DEPDIR)/vfs_split.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(canonicalize_pathname_SOURCES) $(current_dir_SOURCES) \ + $(path_cmp_SOURCES) $(path_len_SOURCES) \ + $(path_manipulations_SOURCES) $(path_recode_SOURCES) \ + $(path_serialize_SOURCES) $(relative_cd_SOURCES) \ + $(tempdir_SOURCES) $(vfs_adjust_stat_SOURCES) \ + $(vfs_get_encoding_SOURCES) $(vfs_parse_ls_lga_SOURCES) \ + $(vfs_path_from_str_flags_SOURCES) \ + $(vfs_path_string_convert_SOURCES) \ + $(vfs_prefix_to_class_SOURCES) $(vfs_s_get_path_SOURCES) \ + $(vfs_setup_cwd_SOURCES) $(vfs_split_SOURCES) +DIST_SOURCES = $(canonicalize_pathname_SOURCES) $(current_dir_SOURCES) \ + $(path_cmp_SOURCES) $(path_len_SOURCES) \ + $(path_manipulations_SOURCES) $(path_recode_SOURCES) \ + $(path_serialize_SOURCES) $(relative_cd_SOURCES) \ + $(tempdir_SOURCES) $(vfs_adjust_stat_SOURCES) \ + $(vfs_get_encoding_SOURCES) $(vfs_parse_ls_lga_SOURCES) \ + $(vfs_path_from_str_flags_SOURCES) \ + $(vfs_path_string_convert_SOURCES) \ + $(vfs_prefix_to_class_SOURCES) $(vfs_s_get_path_SOURCES) \ + $(vfs_setup_cwd_SOURCES) $(vfs_split_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red='[0;31m'; \ + grn='[0;32m'; \ + lgn='[1;32m'; \ + blu='[1;34m'; \ + mgn='[0;35m'; \ + brg='[1m'; \ + std='[m'; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_CFLAGS = @CHECK_CFLAGS@ +CHECK_LIBS = @CHECK_LIBS@ +COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ +COM_ERR_LIBS = @COM_ERR_LIBS@ +CP1251 = @CP1251@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOC_LINGUAS = @DOC_LINGUAS@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +E2P_CFLAGS = @E2P_CFLAGS@ +E2P_LIBS = @E2P_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ +EXT2FS_LIBS = @EXT2FS_LIBS@ +EXTHELPERSDIR = @EXTHELPERSDIR@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +HAVE_FILECMD = @HAVE_FILECMD@ +HAVE_ZIPINFO = @HAVE_ZIPINFO@ +HAVE_nroff = @HAVE_nroff@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBMC_RELEASE = @LIBMC_RELEASE@ +LIBMC_VERSION = @LIBMC_VERSION@ +LIBOBJS = @LIBOBJS@ +LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la $(am__append_1) +LIBSSH_CFLAGS = @LIBSSH_CFLAGS@ +LIBSSH_LIBS = @LIBSSH_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANDOC = @MANDOC@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_DATE = @MAN_DATE@ +MAN_FLAGS = @MAN_FLAGS@ +MAN_VERSION = @MAN_VERSION@ +MCLIBS = @MCLIBS@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = "/lib/vfs" +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRE_CPPFLAGS = @PCRE_CPPFLAGS@ +PCRE_LIBS = @PCRE_LIBS@ +PERL = @PERL@ +PERL_FOR_BUILD = @PERL_FOR_BUILD@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +RANLIB = @RANLIB@ +RUBY = @RUBY@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SLANG_CFLAGS = @SLANG_CFLAGS@ +SLANG_LIBS = @SLANG_LIBS@ +STRIP = @STRIP@ +TESTS_LDFLAGS = @TESTS_LDFLAGS@ +UNZIP = @UNZIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +X11_WWW = @X11_WWW@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZIP = @ZIP@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = \ + -DTEST_SHARE_DIR=\"$(abs_srcdir)\" \ + $(GLIB_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/lib/vfs \ + @CHECK_CFLAGS@ + +AM_LDFLAGS = @TESTS_LDFLAGS@ +EXTRA_DIST = mc.charsets +canonicalize_pathname_SOURCES = \ + canonicalize_pathname.c + +current_dir_SOURCES = \ + current_dir.c + +path_cmp_SOURCES = \ + path_cmp.c + +path_len_SOURCES = \ + path_len.c + +path_manipulations_SOURCES = \ + path_manipulations.c + +path_recode_SOURCES = \ + path_recode.c + +path_serialize_SOURCES = \ + path_serialize.c + +relative_cd_SOURCES = \ + relative_cd.c + +tempdir_SOURCES = \ + tempdir.c + +vfs_adjust_stat_SOURCES = \ + vfs_adjust_stat.c + +vfs_get_encoding_SOURCES = \ + vfs_get_encoding.c + +vfs_setup_cwd_SOURCES = \ + vfs_setup_cwd.c + +vfs_split_SOURCES = \ + vfs_split.c + +vfs_parse_ls_lga_SOURCES = \ + vfs_parse_ls_lga.c + +vfs_prefix_to_class_SOURCES = \ + vfs_prefix_to_class.c + +vfs_path_from_str_flags_SOURCES = \ + vfs_path_from_str_flags.c + +vfs_path_string_convert_SOURCES = \ + vfs_path_string_convert.c + +vfs_s_get_path_SOURCES = \ + vfs_s_get_path.c + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/lib/vfs/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/lib/vfs/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +canonicalize_pathname$(EXEEXT): $(canonicalize_pathname_OBJECTS) $(canonicalize_pathname_DEPENDENCIES) $(EXTRA_canonicalize_pathname_DEPENDENCIES) + @rm -f canonicalize_pathname$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(canonicalize_pathname_OBJECTS) $(canonicalize_pathname_LDADD) $(LIBS) + +current_dir$(EXEEXT): $(current_dir_OBJECTS) $(current_dir_DEPENDENCIES) $(EXTRA_current_dir_DEPENDENCIES) + @rm -f current_dir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(current_dir_OBJECTS) $(current_dir_LDADD) $(LIBS) + +path_cmp$(EXEEXT): $(path_cmp_OBJECTS) $(path_cmp_DEPENDENCIES) $(EXTRA_path_cmp_DEPENDENCIES) + @rm -f path_cmp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(path_cmp_OBJECTS) $(path_cmp_LDADD) $(LIBS) + +path_len$(EXEEXT): $(path_len_OBJECTS) $(path_len_DEPENDENCIES) $(EXTRA_path_len_DEPENDENCIES) + @rm -f path_len$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(path_len_OBJECTS) $(path_len_LDADD) $(LIBS) + +path_manipulations$(EXEEXT): $(path_manipulations_OBJECTS) $(path_manipulations_DEPENDENCIES) $(EXTRA_path_manipulations_DEPENDENCIES) + @rm -f path_manipulations$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(path_manipulations_OBJECTS) $(path_manipulations_LDADD) $(LIBS) + +path_recode$(EXEEXT): $(path_recode_OBJECTS) $(path_recode_DEPENDENCIES) $(EXTRA_path_recode_DEPENDENCIES) + @rm -f path_recode$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(path_recode_OBJECTS) $(path_recode_LDADD) $(LIBS) + +path_serialize$(EXEEXT): $(path_serialize_OBJECTS) $(path_serialize_DEPENDENCIES) $(EXTRA_path_serialize_DEPENDENCIES) + @rm -f path_serialize$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(path_serialize_OBJECTS) $(path_serialize_LDADD) $(LIBS) + +relative_cd$(EXEEXT): $(relative_cd_OBJECTS) $(relative_cd_DEPENDENCIES) $(EXTRA_relative_cd_DEPENDENCIES) + @rm -f relative_cd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(relative_cd_OBJECTS) $(relative_cd_LDADD) $(LIBS) + +tempdir$(EXEEXT): $(tempdir_OBJECTS) $(tempdir_DEPENDENCIES) $(EXTRA_tempdir_DEPENDENCIES) + @rm -f tempdir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tempdir_OBJECTS) $(tempdir_LDADD) $(LIBS) + +vfs_adjust_stat$(EXEEXT): $(vfs_adjust_stat_OBJECTS) $(vfs_adjust_stat_DEPENDENCIES) $(EXTRA_vfs_adjust_stat_DEPENDENCIES) + @rm -f vfs_adjust_stat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vfs_adjust_stat_OBJECTS) $(vfs_adjust_stat_LDADD) $(LIBS) + +vfs_get_encoding$(EXEEXT): $(vfs_get_encoding_OBJECTS) $(vfs_get_encoding_DEPENDENCIES) $(EXTRA_vfs_get_encoding_DEPENDENCIES) + @rm -f vfs_get_encoding$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vfs_get_encoding_OBJECTS) $(vfs_get_encoding_LDADD) $(LIBS) + +vfs_parse_ls_lga$(EXEEXT): $(vfs_parse_ls_lga_OBJECTS) $(vfs_parse_ls_lga_DEPENDENCIES) $(EXTRA_vfs_parse_ls_lga_DEPENDENCIES) + @rm -f vfs_parse_ls_lga$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vfs_parse_ls_lga_OBJECTS) $(vfs_parse_ls_lga_LDADD) $(LIBS) + +vfs_path_from_str_flags$(EXEEXT): $(vfs_path_from_str_flags_OBJECTS) $(vfs_path_from_str_flags_DEPENDENCIES) $(EXTRA_vfs_path_from_str_flags_DEPENDENCIES) + @rm -f vfs_path_from_str_flags$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vfs_path_from_str_flags_OBJECTS) $(vfs_path_from_str_flags_LDADD) $(LIBS) + +vfs_path_string_convert$(EXEEXT): $(vfs_path_string_convert_OBJECTS) $(vfs_path_string_convert_DEPENDENCIES) $(EXTRA_vfs_path_string_convert_DEPENDENCIES) + @rm -f vfs_path_string_convert$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vfs_path_string_convert_OBJECTS) $(vfs_path_string_convert_LDADD) $(LIBS) + +vfs_prefix_to_class$(EXEEXT): $(vfs_prefix_to_class_OBJECTS) $(vfs_prefix_to_class_DEPENDENCIES) $(EXTRA_vfs_prefix_to_class_DEPENDENCIES) + @rm -f vfs_prefix_to_class$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vfs_prefix_to_class_OBJECTS) $(vfs_prefix_to_class_LDADD) $(LIBS) + +vfs_s_get_path$(EXEEXT): $(vfs_s_get_path_OBJECTS) $(vfs_s_get_path_DEPENDENCIES) $(EXTRA_vfs_s_get_path_DEPENDENCIES) + @rm -f vfs_s_get_path$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vfs_s_get_path_OBJECTS) $(vfs_s_get_path_LDADD) $(LIBS) + +vfs_setup_cwd$(EXEEXT): $(vfs_setup_cwd_OBJECTS) $(vfs_setup_cwd_DEPENDENCIES) $(EXTRA_vfs_setup_cwd_DEPENDENCIES) + @rm -f vfs_setup_cwd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vfs_setup_cwd_OBJECTS) $(vfs_setup_cwd_LDADD) $(LIBS) + +vfs_split$(EXEEXT): $(vfs_split_OBJECTS) $(vfs_split_DEPENDENCIES) $(EXTRA_vfs_split_DEPENDENCIES) + @rm -f vfs_split$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vfs_split_OBJECTS) $(vfs_split_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canonicalize_pathname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/current_dir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path_cmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path_len.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path_manipulations.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path_recode.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path_serialize.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/relative_cd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tempdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs_adjust_stat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs_get_encoding.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs_parse_ls_lga.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs_path_from_str_flags.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs_path_string_convert.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs_prefix_to_class.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs_s_get_path.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs_setup_cwd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs_split.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: $(check_PROGRAMS) + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +canonicalize_pathname.log: canonicalize_pathname$(EXEEXT) + @p='canonicalize_pathname$(EXEEXT)'; \ + b='canonicalize_pathname'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +current_dir.log: current_dir$(EXEEXT) + @p='current_dir$(EXEEXT)'; \ + b='current_dir'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +path_cmp.log: path_cmp$(EXEEXT) + @p='path_cmp$(EXEEXT)'; \ + b='path_cmp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +path_len.log: path_len$(EXEEXT) + @p='path_len$(EXEEXT)'; \ + b='path_len'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +path_manipulations.log: path_manipulations$(EXEEXT) + @p='path_manipulations$(EXEEXT)'; \ + b='path_manipulations'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +path_serialize.log: path_serialize$(EXEEXT) + @p='path_serialize$(EXEEXT)'; \ + b='path_serialize'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +relative_cd.log: relative_cd$(EXEEXT) + @p='relative_cd$(EXEEXT)'; \ + b='relative_cd'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tempdir.log: tempdir$(EXEEXT) + @p='tempdir$(EXEEXT)'; \ + b='tempdir'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +vfs_adjust_stat.log: vfs_adjust_stat$(EXEEXT) + @p='vfs_adjust_stat$(EXEEXT)'; \ + b='vfs_adjust_stat'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +vfs_parse_ls_lga.log: vfs_parse_ls_lga$(EXEEXT) + @p='vfs_parse_ls_lga$(EXEEXT)'; \ + b='vfs_parse_ls_lga'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +vfs_path_from_str_flags.log: vfs_path_from_str_flags$(EXEEXT) + @p='vfs_path_from_str_flags$(EXEEXT)'; \ + b='vfs_path_from_str_flags'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +vfs_path_string_convert.log: vfs_path_string_convert$(EXEEXT) + @p='vfs_path_string_convert$(EXEEXT)'; \ + b='vfs_path_string_convert'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +vfs_prefix_to_class.log: vfs_prefix_to_class$(EXEEXT) + @p='vfs_prefix_to_class$(EXEEXT)'; \ + b='vfs_prefix_to_class'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +vfs_setup_cwd.log: vfs_setup_cwd$(EXEEXT) + @p='vfs_setup_cwd$(EXEEXT)'; \ + b='vfs_setup_cwd'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +vfs_split.log: vfs_split$(EXEEXT) + @p='vfs_split$(EXEEXT)'; \ + b='vfs_split'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +vfs_s_get_path.log: vfs_s_get_path$(EXEEXT) + @p='vfs_s_get_path$(EXEEXT)'; \ + b='vfs_s_get_path'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +path_recode.log: path_recode$(EXEEXT) + @p='path_recode$(EXEEXT)'; \ + b='path_recode'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +vfs_get_encoding.log: vfs_get_encoding$(EXEEXT) + @p='vfs_get_encoding$(EXEEXT)'; \ + b='vfs_get_encoding'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/canonicalize_pathname.Po + -rm -f ./$(DEPDIR)/current_dir.Po + -rm -f ./$(DEPDIR)/path_cmp.Po + -rm -f ./$(DEPDIR)/path_len.Po + -rm -f ./$(DEPDIR)/path_manipulations.Po + -rm -f ./$(DEPDIR)/path_recode.Po + -rm -f ./$(DEPDIR)/path_serialize.Po + -rm -f ./$(DEPDIR)/relative_cd.Po + -rm -f ./$(DEPDIR)/tempdir.Po + -rm -f ./$(DEPDIR)/vfs_adjust_stat.Po + -rm -f ./$(DEPDIR)/vfs_get_encoding.Po + -rm -f ./$(DEPDIR)/vfs_parse_ls_lga.Po + -rm -f ./$(DEPDIR)/vfs_path_from_str_flags.Po + -rm -f ./$(DEPDIR)/vfs_path_string_convert.Po + -rm -f ./$(DEPDIR)/vfs_prefix_to_class.Po + -rm -f ./$(DEPDIR)/vfs_s_get_path.Po + -rm -f ./$(DEPDIR)/vfs_setup_cwd.Po + -rm -f ./$(DEPDIR)/vfs_split.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/canonicalize_pathname.Po + -rm -f ./$(DEPDIR)/current_dir.Po + -rm -f ./$(DEPDIR)/path_cmp.Po + -rm -f ./$(DEPDIR)/path_len.Po + -rm -f ./$(DEPDIR)/path_manipulations.Po + -rm -f ./$(DEPDIR)/path_recode.Po + -rm -f ./$(DEPDIR)/path_serialize.Po + -rm -f ./$(DEPDIR)/relative_cd.Po + -rm -f ./$(DEPDIR)/tempdir.Po + -rm -f ./$(DEPDIR)/vfs_adjust_stat.Po + -rm -f ./$(DEPDIR)/vfs_get_encoding.Po + -rm -f ./$(DEPDIR)/vfs_parse_ls_lga.Po + -rm -f ./$(DEPDIR)/vfs_path_from_str_flags.Po + -rm -f ./$(DEPDIR)/vfs_path_string_convert.Po + -rm -f ./$(DEPDIR)/vfs_prefix_to_class.Po + -rm -f ./$(DEPDIR)/vfs_s_get_path.Po + -rm -f ./$(DEPDIR)/vfs_setup_cwd.Po + -rm -f ./$(DEPDIR)/vfs_split.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/lib/vfs/canonicalize_pathname.c b/tests/lib/vfs/canonicalize_pathname.c new file mode 100644 index 0000000..c40c81d --- /dev/null +++ b/tests/lib/vfs/canonicalize_pathname.c @@ -0,0 +1,203 @@ +/* + lib - canonicalize path + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#ifdef HAVE_CHARSET +#include "lib/charsets.h" +#endif + +#include "lib/strutil.h" +#include "lib/util.h" +#include "lib/vfs/xdirentry.h" + +#include "src/vfs/local/local.c" + +static struct vfs_class vfs_test_ops; + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); + +#ifdef HAVE_CHARSET + mc_global.sysconfig_dir = (char *) TEST_SHARE_DIR; + load_codepages_list (); +#endif + + vfs_init_class (&vfs_test_ops, "testfs", VFSF_NOLINKS | VFSF_REMOTE, "ftp"); + vfs_register_class (&vfs_test_ops); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ +#ifdef HAVE_CHARSET + free_codepages_list (); +#endif + + vfs_shut (); + + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_canonicalize_path_ds") */ +/* *INDENT-OFF* */ +static const struct test_canonicalize_path_ds +{ + const char *input_path; + const char *expected_path; +} test_canonicalize_path_ds[] = +{ + { /* 0. UNC path */ + "//some_server/ww", + "//some_server/ww" + }, + { /* 1. join slashes */ + "///some_server/////////ww", + "/some_server/ww" + }, + { /* 2. Collapse "/./" -> "/" */ + "//some_server//.///////ww/./././.", + "//some_server/ww" + }, + {/* 3. Remove leading "./" */ + "./some_server/ww", + "some_server/ww" + }, + { /* 4. some/.. -> . */ + "some_server/..", + "." + }, + { /* 5. Collapse "/.." with the previous part of path */ + "/some_server/ww/some_server/../ww/../some_server/..//ww/some_server/ww", + "/some_server/ww/ww/some_server/ww" + }, + { /* 6. URI style */ + "/some_server/ww/ftp://user:pass@host.net/path/", + "/some_server/ww/ftp://user:pass@host.net/path" + }, + { /* 7. */ + "/some_server/ww/ftp://user:pass@host.net/path/../../", + "/some_server/ww" + }, + { /* 8. */ + "ftp://user:pass@host.net/path/../../", + "." + }, + { /* 9. */ + "ftp://user/../../", + ".." + }, +#ifdef HAVE_CHARSET + { /* 10. Supported encoding */ + "/b/#enc:utf-8/../c", + "/c" + }, + { /* 11. Unsupported encoding */ + "/b/#enc:aaaa/../c", + "/b/c" + }, + { /* 12. Supported encoding */ + "/b/../#enc:utf-8/c", + "/#enc:utf-8/c" + }, + { /* 13. Unsupported encoding */ + "/b/../#enc:aaaa/c", + "/#enc:aaaa/c" + }, + { /* 14. Supported encoding */ + "/b/c/#enc:utf-8/..", + "/b" + }, + { /* 15. Unsupported encoding */ + "/b/c/#enc:aaaa/..", + "/b/c" + }, + { /* 16. Supported encoding */ + "/b/c/../#enc:utf-8", + "/b/#enc:utf-8" + }, + { /* 17. Unsupported encoding */ + "/b/c/../#enc:aaaa", + "/b/#enc:aaaa" + }, +#endif /* HAVE_CHARSET */ +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_canonicalize_path_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_canonicalize_path, test_canonicalize_path_ds) +/* *INDENT-ON* */ +{ + /* given */ + char *actual_path; + + actual_path = g_strdup (data->input_path); + + /* when */ + canonicalize_pathname (actual_path); + + /* then */ + mctest_assert_str_eq (actual_path, data->expected_path) g_free (actual_path); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_canonicalize_path, test_canonicalize_path_ds); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/current_dir.c b/tests/lib/vfs/current_dir.c new file mode 100644 index 0000000..6ae1651 --- /dev/null +++ b/tests/lib/vfs/current_dir.c @@ -0,0 +1,207 @@ +/* + lib/vfs - manipulate with current directory + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#include <string.h> /* memset() */ + +#include "lib/global.h" +#include "lib/strutil.h" +#include "lib/vfs/xdirentry.h" + +#include "src/vfs/local/local.c" + +static struct vfs_s_subclass vfs_test_subclass; +static struct vfs_class *vfs_test_ops = VFS_CLASS (&vfs_test_subclass); + +/* --------------------------------------------------------------------------------------------- */ + +/* @Mock */ +static int +test_chdir (const vfs_path_t * vpath) +{ + (void) vpath; + + return 0; +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); + + memset (&vfs_test_subclass, 0, sizeof (vfs_test_subclass)); + vfs_init_class (vfs_test_ops, "testfs", VFSF_UNKNOWN, "test"); + vfs_test_ops->chdir = test_chdir; +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_cd_ds") */ +/* *INDENT-OFF* */ +static const struct test_cd_ds +{ + const char *input_initial_path; + const char *input_cd_path; + const vfs_flags_t input_class_flags; + + const char *expected_cd_path; +} test_cd_ds[] = +{ + { /* 0. */ + "/", + "/dev/some.file/test://", + VFSF_NOLINKS, + "/dev/some.file/test://" + }, + { /* 1. */ + "/", + "/dev/some.file/test://bla-bla", + VFSF_NOLINKS, + "/dev/some.file/test://bla-bla" + }, + { /* 2. */ + "/dev/some.file/test://bla-bla", + "..", + VFSF_NOLINKS, + "/dev/some.file/test://" + }, + { /* 3. */ + "/dev/some.file/test://", + "..", + VFSF_NOLINKS, + "/dev" + }, + { /* 4. */ + "/dev", + "..", + VFSF_NOLINKS, + "/" + }, + { /* 5. */ + "/", + "..", + VFSF_NOLINKS, + "/" + }, + { /* 6. */ + "/", + "/test://user:pass@host.net/path", + VFSF_NOLINKS | VFSF_REMOTE, + "/test://user:pass@host.net/path" + }, + { /* 7. */ + "/test://user:pass@host.net/path", + "..", + VFSF_NOLINKS | VFSF_REMOTE, + "/test://user:pass@host.net/" + }, + { /* 8. */ + "/test://user:pass@host.net/", + "..", + VFSF_NOLINKS | VFSF_REMOTE, + "/" + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_cd_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_cd, test_cd_ds) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath; + + vfs_test_ops->flags = data->input_class_flags; + vfs_register_class (vfs_test_ops); + + vfs_set_raw_current_dir (vfs_path_from_str (data->input_initial_path)); + + vpath = vfs_path_from_str (data->input_cd_path); + + /* when */ + mc_chdir (vpath); + + /* then */ + { + char *actual_cd_path; + + actual_cd_path = _vfs_get_cwd (); + mctest_assert_str_eq (actual_cd_path, data->expected_cd_path); + g_free (actual_cd_path); + } + vfs_path_free (vpath, TRUE); + + vfs_unregister_class (vfs_test_ops); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + char *cwd; + + tc_core = tcase_create ("Core"); + + /* writable directory where check creates temporary files */ + cwd = g_get_current_dir (); + g_setenv ("TEMP", cwd, TRUE); + g_free (cwd); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_cd, test_cd_ds); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/mc.charsets b/tests/lib/vfs/mc.charsets new file mode 100644 index 0000000..f51ee2a --- /dev/null +++ b/tests/lib/vfs/mc.charsets @@ -0,0 +1,5 @@ +ASCII 7-bit ASCII +IBM866 CP 866 +KOI8-R KOI8-R +KOI8-U KOI8-U +UTF-8 UTF-8 diff --git a/tests/lib/vfs/path_cmp.c b/tests/lib/vfs/path_cmp.c new file mode 100644 index 0000000..abb3ecd --- /dev/null +++ b/tests/lib/vfs/path_cmp.c @@ -0,0 +1,254 @@ +/* lib/vfs - vfs_path_t compare functions + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#ifdef HAVE_CHARSET +#include "lib/charsets.h" +#endif + +#include "lib/strutil.h" +#include "lib/vfs/xdirentry.h" +#include "lib/vfs/path.h" + +#include "src/vfs/local/local.c" + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); + + mc_global.sysconfig_dir = (char *) TEST_SHARE_DIR; +#ifdef HAVE_CHARSET + load_codepages_list (); +#endif +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ +#ifdef HAVE_CHARSET + free_codepages_list (); +#endif + + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_path_equal_ds") */ +/* *INDENT-OFF* */ +static const struct test_path_equal_ds +{ + const char *input_path1; + const char *input_path2; + const gboolean expected_result; +} test_path_equal_ds[] = +{ + { /* 0. */ + NULL, + NULL, + FALSE + }, + { /* 1. */ + NULL, + "/test/path", + FALSE + }, + { /* 2. */ + "/test/path", + NULL, + FALSE + }, + { /* 3. */ + "/test/path", + "/test/path", + TRUE + }, +#ifdef HAVE_CHARSET + { /* 4. */ + "/#enc:KOI8-R/теÑтовый/путь", + "/теÑтовый/путь", + FALSE + }, + { /* 5. */ + "/теÑтовый/путь", + "/#enc:KOI8-R/теÑтовый/путь", + FALSE + }, + { /* 6. */ + "/#enc:KOI8-R/теÑтовый/путь", + "/#enc:KOI8-R/теÑтовый/путь", + TRUE + }, +#endif +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_path_equal_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_path_equal, test_path_equal_ds) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath1, *vpath2; + gboolean actual_result; + + vpath1 = vfs_path_from_str (data->input_path1); + vpath2 = vfs_path_from_str (data->input_path2); + + /* when */ + actual_result = vfs_path_equal (vpath1, vpath2); + + /* then */ + ck_assert_int_eq (actual_result, data->expected_result); + + vfs_path_free (vpath1, TRUE); + vfs_path_free (vpath2, TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_path_equal_len_ds") */ +/* *INDENT-OFF* */ +static const struct test_path_equal_len_ds +{ + const char *input_path1; + const char *input_path2; + const size_t input_length; + const gboolean expected_result; +} test_path_equal_len_ds[] = +{ + { /* 0. */ + NULL, + NULL, + 0, + FALSE + }, + { /* 1. */ + NULL, + NULL, + 100, + FALSE + }, + { /* 2. */ + NULL, + "/теÑтовый/путь", + 10, + FALSE + }, + { /* 3. */ + "/теÑтовый/путь", + NULL, + 10, + FALSE + }, + { /* 4. */ + "/теÑтовый/путь", + "/теÑтовый/путь", + 10, + TRUE + }, + { /* 5. */ + "/теÑÑ‚/овый/путь", + "/теÑтовый/путь", + 8, + TRUE + }, + { /* 6. */ + "/теÑÑ‚/овый/путь", + "/теÑтовый/путь", + 10, + FALSE + }, + { /* 7. */ + "/теÑтовый/путь", + "/теÑÑ‚/овый/путь", + 10, + FALSE + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_path_equal_len_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_path_equal_len, test_path_equal_len_ds) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath1, *vpath2; + gboolean actual_result; + + vpath1 = vfs_path_from_str (data->input_path1); + vpath2 = vfs_path_from_str (data->input_path2); + + /* when */ + actual_result = vfs_path_equal_len (vpath1, vpath2, data->input_length); + + /* then */ + ck_assert_int_eq (actual_result, data->expected_result); + + vfs_path_free (vpath1, TRUE); + vfs_path_free (vpath2, TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_path_equal, test_path_equal_ds); + mctest_add_parameterized_test (tc_core, test_path_equal_len, test_path_equal_len_ds); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_len.c b/tests/lib/vfs/path_len.c new file mode 100644 index 0000000..dec99ba --- /dev/null +++ b/tests/lib/vfs/path_len.c @@ -0,0 +1,142 @@ +/* lib/vfs - tests for vfspath_len() function. + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#ifdef HAVE_CHARSET +#include "lib/charsets.h" +#endif + +#include "lib/strutil.h" +#include "lib/vfs/xdirentry.h" +#include "lib/vfs/path.h" + +#include "src/vfs/local/local.c" + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); + + mc_global.sysconfig_dir = (char *) TEST_SHARE_DIR; +#ifdef HAVE_CHARSET + load_codepages_list (); +#endif +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ +#ifdef HAVE_CHARSET + free_codepages_list (); +#endif + + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ +/* @DataSource("test_path_length_ds") */ +/* *INDENT-OFF* */ +static const struct test_path_length_ds +{ + const char *input_path; + const size_t expected_length; +} test_path_length_ds[] = +{ + { /* 0. */ + NULL, + 0 + }, + { /* 1. */ + "/", + 1 + }, + { /* 2. */ + "/теÑтовый/путь", + 26 + }, +#ifdef HAVE_CHARSET + { /* 3. */ + "/#enc:KOI8-R/теÑтовый/путь", + 38 + }, +#endif /* HAVE_CHARSET */ +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_path_length_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_path_length, test_path_length_ds) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath; + size_t actual_length; + + vpath = vfs_path_from_str (data->input_path); + + /* when */ + actual_length = vfs_path_len (vpath); + + /* then */ + ck_assert_int_eq (actual_length, data->expected_length); + + vfs_path_free (vpath, TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_path_length, test_path_length_ds); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_manipulations.c b/tests/lib/vfs/path_manipulations.c new file mode 100644 index 0000000..bb4f64d --- /dev/null +++ b/tests/lib/vfs/path_manipulations.c @@ -0,0 +1,458 @@ +/* lib/vfs - test vfs_path_t manipulation functions + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#ifdef HAVE_CHARSET +#include "lib/charsets.h" +#endif + +#include "lib/strutil.h" +#include "lib/vfs/xdirentry.h" +#include "lib/vfs/path.h" + +#include "src/vfs/local/local.c" + + +static struct vfs_class vfs_test_ops1, vfs_test_ops2, vfs_test_ops3; + +/* --------------------------------------------------------------------------------------------- */ + +static void +init_test_classes (void) +{ + vfs_init_class (&vfs_test_ops1, "testfs1", VFSF_NOLINKS | VFSF_REMOTE, "test1"); + vfs_register_class (&vfs_test_ops1); + + vfs_init_class (&vfs_test_ops2, "testfs2", VFSF_UNKNOWN, "test2"); + vfs_register_class (&vfs_test_ops2); + + vfs_init_class (&vfs_test_ops3, "testfs3", VFSF_LOCAL, "test3"); + vfs_register_class (&vfs_test_ops3); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); + + init_test_classes (); + + mc_global.sysconfig_dir = (char *) TEST_SHARE_DIR; +#ifdef HAVE_CHARSET + load_codepages_list (); +#endif +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ +#ifdef HAVE_CHARSET + free_codepages_list (); +#endif + + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_vfs_path_tokens_count_ds") */ +/* *INDENT-OFF* */ +static const struct test_vfs_path_tokens_count_ds +{ + const char *input_path; + const vfs_path_flag_t input_flags; + const size_t expected_token_count; +} test_vfs_path_tokens_count_ds[] = +{ + { /* 0. */ + "/", + VPF_NONE, + 0 + }, + { /* 1. */ + "/path", + VPF_NONE, + 1 + }, + { /* 2. */ + "/path1/path2/path3", + VPF_NONE, + 3 + }, + { /* 3. */ + "test3://path1/path2/path3/path4", + VPF_NO_CANON, + 4 + }, + { /* 4. */ + "path1/path2/path3", + VPF_NO_CANON, + 3 + }, + { /* 5. */ + "/path1/path2/path3/", + VPF_NONE, + 3 + }, + { /* 6. */ + "/local/path/test1://user:pass@some.host:12345/bla-bla/some/path/", + VPF_NONE, + 5 + }, +#ifdef HAVE_CHARSET + { /* 7. */ + "/local/path/test1://user:pass@some.host:12345/bla-bla/some/path/" + "test2://#enc:KOI8-R/bla-bla/some/path/test3://111/22/33", + VPF_NONE, + 11 + }, +#endif +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_vfs_path_tokens_count_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_vfs_path_tokens_count, test_vfs_path_tokens_count_ds) +/* *INDENT-ON* */ +{ + /* given */ + size_t tokens_count; + vfs_path_t *vpath; + + vpath = vfs_path_from_str_flags (data->input_path, data->input_flags); + + /* when */ + tokens_count = vfs_path_tokens_count (vpath); + + /* then */ + ck_assert_int_eq (tokens_count, data->expected_token_count); + + vfs_path_free (vpath, TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_vfs_path_tokens_get_ds") */ +/* *INDENT-OFF* */ +static const struct test_vfs_path_tokens_get_ds +{ + const char *input_path; + const ssize_t input_start_position; + const ssize_t input_length; + + const char *expected_path; +} test_vfs_path_tokens_get_ds[] = +{ + { /* 0. Invalid start position */ + "/", + 2, + 1, + NULL + }, + { /* 1. Invalid negative position */ + "/path", + -3, + 1, + NULL + }, + { /* 2. Count of tokens is zero. Count should be autocorrected */ + "/path", + 0, + 0, + "path" + }, + { /* 3. get 'path2/path3' by 1,2 */ + "/path1/path2/path3/path4", + 1, + 2, + "path2/path3" + }, + { /* 4. get 'path2/path3' by 1,2 from LOCAL VFS */ + "test3://path1/path2/path3/path4", + 1, + 2, + "path2/path3" + }, + { /* 5. get 'path2/path3' by 1,2 from non-LOCAL VFS */ + "test2://path1/path2/path3/path4", + 1, + 2, + "test2://path2/path3" + }, + { /* 6. get 'path2/path3' by 1,2 throught non-LOCAL VFS */ + "/path1/path2/test1://user:pass@some.host:12345/path3/path4", + 1, + 2, + "path2/test1://user:pass@some.host:12345/path3" + }, + { /* 7. get 'path2/path3' by 1,2 where path2 it's LOCAL VFS */ + "test3://path1/path2/test2://path3/path4", + 1, + 2, + "path2/test2://path3" + }, + { /* 8. get 'path2/path3' by 1,2 where path3 it's LOCAL VFS */ + "test2://path1/path2/test3://path3/path4", + 1, + 2, + "test2://path2/test3://path3" + }, + { /* 9. get 'path4' by -1,1 */ + "/path1/path2/path3/path4", + -1, + 1, + "path4" + }, + { /* 10. get 'path2/path3/path4' by -3,0 */ + "/path1/path2/path3/path4", + -3, + 0, + "path2/path3/path4" + }, +#ifdef HAVE_CHARSET + { /* 11. get 'path2/path3' by 1,2 from LOCAL VFS with encoding */ + "test3://path1/path2/test3://#enc:KOI8-R/path3/path4", + 1, + 2, + "path2/test3://#enc:KOI8-R/path3" + }, + { /* 12. get 'path2/path3' by 1,2 with encoding */ + "#enc:KOI8-R/path1/path2/path3/path4", + 1, + 2, + "#enc:KOI8-R/path2/path3" + }, +#endif +/* TODO: currently this test don't passed. Probably broken string URI parser + { *//* 13. get 'path2/path3' by 1,2 from LOCAL VFS *//* + + "test3://path1/path2/test2://test3://path3/path4", + 1, + 2, + "path2/path3" + }, +*/ +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_vfs_path_tokens_get_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_vfs_path_tokens_get, test_vfs_path_tokens_get_ds) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath; + char *actual_path; + + vpath = vfs_path_from_str_flags (data->input_path, VPF_NO_CANON); + + /* when */ + actual_path = vfs_path_tokens_get (vpath, data->input_start_position, data->input_length); + + /* then */ + mctest_assert_str_eq (actual_path, data->expected_path); + + g_free (actual_path); + vfs_path_free (vpath, TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_vfs_path_append_vpath_ds") */ +/* *INDENT-OFF* */ +static const struct test_vfs_path_append_vpath_ds +{ + const char *input_path1; + const char *input_path2; + const int expected_element_count; + const char *expected_path; +} test_vfs_path_append_vpath_ds[] = +{ + { /* 0. */ + "/local/path/test1://user:pass@some.host:12345/bla-bla/some/path/test2://bla-bla/some/path/test3://111/22/33", + "/local/path/test1://user:pass@some.host:12345/bla-bla/some/path/", + 6, + "/local/path/test1://user:pass@some.host:12345/bla-bla/some/path/test2://bla-bla/some/path/test3://111/22/33" + "/local/path/test1://user:pass@some.host:12345/bla-bla/some/path", + }, +#ifdef HAVE_CHARSET + { /* 1. */ + "/local/path/test1://user:pass@some.host:12345/bla-bla/some/path/test2://#enc:KOI8-R/bla-bla/some/path/test3://111/22/33", + "/local/path/test1://user:pass@some.host:12345/bla-bla/some/path/", + 6, + "/local/path/test1://user:pass@some.host:12345/bla-bla/some/path/test2://#enc:KOI8-R/bla-bla/some/path/test3://111/22/33" + "/local/path/test1://user:pass@some.host:12345/bla-bla/some/path", + }, +#endif /* HAVE_CHARSET */ +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_vfs_path_append_vpath_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_vfs_path_append_vpath, test_vfs_path_append_vpath_ds) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath1, *vpath2, *vpath3; + + vpath1 = vfs_path_from_str (data->input_path1); + vpath2 = vfs_path_from_str (data->input_path2); + + /* when */ + vpath3 = vfs_path_append_vpath_new (vpath1, vpath2, NULL); + + /* then */ + ck_assert_int_eq (vfs_path_elements_count (vpath3), data->expected_element_count); + mctest_assert_str_eq (vfs_path_as_str (vpath3), data->expected_path); + + vfs_path_free (vpath1, TRUE); + vfs_path_free (vpath2, TRUE); + vfs_path_free (vpath3, TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_vfs_path_relative_ds") */ +/* *INDENT-OFF* */ +static const struct test_vfs_path_relative_ds +{ + const char *input_path; + const char *expected_path; + const char *expected_last_path_in_element; +} test_vfs_path_relative_ds[] = +{ + { /* 0. */ + "../bla-bla", + "../bla-bla", + "../bla-bla" + }, + { /* 1. */ + "../path/test1://user:pass@some.host:12345/bla-bla/some/path/", + "../path/test1://user:pass@some.host:12345/bla-bla/some/path/", + "bla-bla/some/path/" + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_vfs_path_relative_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_vfs_path_relative, test_vfs_path_relative_ds) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath; + + /* when */ + + vpath = vfs_path_from_str_flags (data->input_path, VPF_NO_CANON); + + /* then */ + mctest_assert_true (vpath->relative); + mctest_assert_str_eq (vfs_path_get_last_path_str (vpath), data->expected_last_path_in_element); + mctest_assert_str_eq (vfs_path_as_str (vpath), data->expected_path); + + vfs_path_free (vpath, TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @Test(dataSource = "test_vfs_path_relative_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_vfs_path_relative_clone, test_vfs_path_relative_ds) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath, *cloned_vpath; + + vpath = vfs_path_from_str_flags (data->input_path, VPF_NO_CANON); + + /* when */ + + cloned_vpath = vfs_path_clone (vpath); + + /* then */ + mctest_assert_true (cloned_vpath->relative); + mctest_assert_str_eq (vfs_path_get_last_path_str (cloned_vpath), + data->expected_last_path_in_element); + mctest_assert_str_eq (vfs_path_as_str (cloned_vpath), data->expected_path); + + vfs_path_free (vpath, TRUE); + vfs_path_free (cloned_vpath, TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_vfs_path_tokens_count, + test_vfs_path_tokens_count_ds); + mctest_add_parameterized_test (tc_core, test_vfs_path_tokens_get, test_vfs_path_tokens_get_ds); + mctest_add_parameterized_test (tc_core, test_vfs_path_append_vpath, + test_vfs_path_append_vpath_ds); + mctest_add_parameterized_test (tc_core, test_vfs_path_relative, test_vfs_path_relative_ds); + mctest_add_parameterized_test (tc_core, test_vfs_path_relative_clone, + test_vfs_path_relative_ds); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_recode.c b/tests/lib/vfs/path_recode.c new file mode 100644 index 0000000..55ec1ad --- /dev/null +++ b/tests/lib/vfs/path_recode.c @@ -0,0 +1,285 @@ +/* + lib/vfs - vfs_path_t charset recode functions + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#include "lib/charsets.h" + +#include "lib/strutil.h" +#include "lib/vfs/xdirentry.h" +#include "lib/vfs/path.h" + +#include "src/vfs/local/local.c" + +/* --------------------------------------------------------------------------------------------- */ + +/* @Mock */ +const char * +mc_config_get_home_dir (void) +{ + return "/mock/home"; +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +static void +test_init_vfs (const char *encoding) +{ + str_init_strings (encoding); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); + + mc_global.sysconfig_dir = (char *) TEST_SHARE_DIR; + + mc_global.sysconfig_dir = (char *) TEST_SHARE_DIR; + load_codepages_list (); +} + +/* --------------------------------------------------------------------------------------------- */ + +static void +test_deinit_vfs (void) +{ + free_codepages_list (); + str_uninit_strings (); + vfs_shut (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_path_recode_ds") */ +/* *INDENT-OFF* */ +static const struct test_path_recode_ds +{ + const char *input_codepage; + const char *input_path; + const char *expected_element_path; + const char *expected_recoded_path; +} test_path_recode_ds[] = +{ + { /* 0. */ + "UTF-8", + "/ÔÅÓÔÏ×ÙÊ/ÐÕÔØ", + "/ÔÅÓÔÏ×ÙÊ/ÐÕÔØ", + "/ÔÅÓÔÏ×ÙÊ/ÐÕÔØ" + }, + { /* 1. */ + "UTF-8", + "/#enc:KOI8-R/теÑтовый/путь", + "/ÔÅÓÔÏ×ÙÊ/ÐÕÔØ", + "/#enc:KOI8-R/теÑтовый/путь" + }, + { /* 2. */ + "KOI8-R", + "/теÑтовый/путь", + "/теÑтовый/путь", + "/теÑтовый/путь" + }, + { /* 3. */ + "KOI8-R", + "/#enc:UTF-8/ÔÅÓÔÏ×ÙÊ/ÐÕÔØ", + "/теÑтовый/путь", + "/#enc:UTF-8/ÔÅÓÔÏ×ÙÊ/ÐÕÔØ" + }, + { /* 4. Test encode info at start */ + "UTF-8", + "#enc:KOI8-R/bla-bla/some/path", + "/bla-bla/some/path", + "/#enc:KOI8-R/bla-bla/some/path" + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_path_recode_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_path_recode, test_path_recode_ds) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath; + const vfs_path_element_t *element; + const char *vpath_str; + + test_init_vfs (data->input_codepage); + + /* when */ + vpath = vfs_path_from_str (data->input_path); + element = vfs_path_get_by_index (vpath, -1); + + /* then */ + vpath_str = vfs_path_as_str (vpath); + mctest_assert_ptr_ne (vpath, NULL); + mctest_assert_str_eq (element->path, data->expected_element_path); + mctest_assert_str_eq (vpath_str, data->expected_recoded_path); + + vfs_path_free (vpath, TRUE); + test_deinit_vfs (); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + + +/* --------------------------------------------------------------------------------------------- */ + +static struct vfs_class vfs_test_ops1; + +/* @DataSource("test_path_to_str_flags_ds") */ +/* *INDENT-OFF* */ +static const struct test_path_to_str_flags_ds +{ + const char *input_path; + const vfs_path_flag_t input_from_str_flags; + const vfs_path_flag_t input_to_str_flags; + const char *expected_path; +} test_path_to_str_flags_ds[] = +{ + { /* 0. */ + "test1://user:passwd@127.0.0.1", + VPF_NO_CANON, + VPF_STRIP_PASSWORD, + "test1://user@127.0.0.1/" + }, + { /* 1. */ + "/test1://user:passwd@host.name/#enc:KOI8-R/теÑтовый/путь", + VPF_NONE, + VPF_STRIP_PASSWORD, + "/test1://user@host.name/#enc:KOI8-R/теÑтовый/путь" + }, + { /* 2. */ + "/test1://user:passwd@host.name/#enc:KOI8-R/теÑтовый/путь", + VPF_NONE, + VPF_RECODE, + "/test1://user:passwd@host.name/ÔÅÓÔÏ×ÙÊ/ÐÕÔØ" + }, + { /* 3. */ + "/test1://user:passwd@host.name/#enc:KOI8-R/теÑтовый/путь", + VPF_NONE, + VPF_RECODE | VPF_STRIP_PASSWORD, + "/test1://user@host.name/ÔÅÓÔÏ×ÙÊ/ÐÕÔØ" + }, + { /* 4. */ + "/mock/home/test/dir", + VPF_NONE, + VPF_STRIP_HOME, + "~/test/dir" + }, + { /* 5. */ + "/mock/home/test1://user:passwd@host.name/#enc:KOI8-R/теÑтовый/путь", + VPF_NONE, + VPF_STRIP_HOME | VPF_STRIP_PASSWORD, + "~/test1://user@host.name/#enc:KOI8-R/теÑтовый/путь" + }, + { /* 6. */ + "/mock/home/test1://user:passwd@host.name/#enc:KOI8-R/теÑтовый/путь", + VPF_NONE, + VPF_STRIP_HOME | VPF_STRIP_PASSWORD | VPF_HIDE_CHARSET, + "~/test1://user@host.name/теÑтовый/путь" + }, + { /* 7. */ + "/mock/home/test1://user:passwd@host.name/#enc:KOI8-R/теÑтовый/путь", + VPF_NONE, + VPF_STRIP_HOME | VPF_RECODE, + "~/test1://user:passwd@host.name/ÔÅÓÔÏ×ÙÊ/ÐÕÔØ" + }, + { /* 8. */ + "/mock/home/test1://user:passwd@host.name/#enc:KOI8-R/теÑтовый/путь", + VPF_NONE, + VPF_STRIP_HOME | VPF_RECODE | VPF_STRIP_PASSWORD, + "~/test1://user@host.name/ÔÅÓÔÏ×ÙÊ/ÐÕÔØ" + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_path_to_str_flags_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_path_to_str_flags, test_path_to_str_flags_ds) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath; + char *str_path; + + test_init_vfs ("UTF-8"); + + vfs_init_class (&vfs_test_ops1, "testfs1", VFSF_NOLINKS | VFSF_REMOTE, "test1"); + vfs_register_class (&vfs_test_ops1); + + /* when */ + + vpath = vfs_path_from_str_flags (data->input_path, data->input_from_str_flags); + str_path = vfs_path_to_str_flags (vpath, 0, data->input_to_str_flags); + + /* then */ + mctest_assert_str_eq (str_path, data->expected_path); + + g_free (str_path); + vfs_path_free (vpath, TRUE); + test_deinit_vfs (); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_path_recode, test_path_recode_ds); + mctest_add_parameterized_test (tc_core, test_path_to_str_flags, test_path_to_str_flags_ds); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/path_serialize.c b/tests/lib/vfs/path_serialize.c new file mode 100644 index 0000000..e4812a4 --- /dev/null +++ b/tests/lib/vfs/path_serialize.c @@ -0,0 +1,203 @@ +/* + lib/vfs - vfs_path_t serialize/deserialize functions + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#ifdef HAVE_CHARSET +#include "lib/charsets.h" +#endif + +#include "lib/strutil.h" +#include "lib/vfs/xdirentry.h" +#include "lib/vfs/path.h" + +#include "src/vfs/local/local.c" + +static struct vfs_class vfs_test_ops1, vfs_test_ops2, vfs_test_ops3; + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); + + vfs_init_class (&vfs_test_ops1, "testfs1", VFSF_NOLINKS | VFSF_REMOTE, "test1"); + vfs_register_class (&vfs_test_ops1); + + vfs_init_class (&vfs_test_ops2, "testfs2", VFSF_UNKNOWN, "test2"); + vfs_register_class (&vfs_test_ops2); + + vfs_init_class (&vfs_test_ops3, "testfs3", VFSF_UNKNOWN, "test3"); + vfs_register_class (&vfs_test_ops3); + + mc_global.sysconfig_dir = (char *) TEST_SHARE_DIR; +#ifdef HAVE_CHARSET + load_codepages_list (); +#endif +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ +#ifdef HAVE_CHARSET + free_codepages_list (); +#endif + + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +#ifdef HAVE_CHARSET +#define ETALON_PATH_STR "/local/path/#test1:user:pass@some.host:12345/bla-bla/some/path/#test2/#enc:KOI8-R/bla-bla/some/path#test3/111/22/33" +#define ETALON_PATH_URL_STR "/local/path/test1://user:pass@some.host:12345/bla-bla/some/path/test2://#enc:KOI8-R/bla-bla/some/path/test3://111/22/33" +#define ETALON_SERIALIZED_PATH \ + "g14:path-element-0" \ + "p4:pathv12:/local/path/" \ + "p10:class-namev7:localfs" \ + "g14:path-element-1" \ + "p4:pathv18:bla-bla/some/path/" \ + "p10:class-namev7:testfs1" \ + "p10:vfs_prefixv5:test1" \ + "p4:userv4:user" \ + "p8:passwordv4:pass" \ + "p4:hostv9:some.host" \ + "p4:portv5:12345" \ + "g14:path-element-2" \ + "p4:pathv17:bla-bla/some/path" \ + "p10:class-namev7:testfs2" \ + "p8:encodingv6:KOI8-R" \ + "p10:vfs_prefixv5:test2" \ + "g14:path-element-3" \ + "p4:pathv9:111/22/33" \ + "p10:class-namev7:testfs3" \ + "p10:vfs_prefixv5:test3" +#else +#define ETALON_PATH_STR "/local/path/#test1:user:pass@some.host:12345/bla-bla/some/path/#test2/bla-bla/some/path#test3/111/22/33" +#define ETALON_PATH_URL_STR "/local/path/test1://user:pass@some.host:12345/bla-bla/some/path/test2://bla-bla/some/path/test3://111/22/33" +#define ETALON_SERIALIZED_PATH \ + "g14:path-element-0" \ + "p4:pathv12:/local/path/" \ + "p10:class-namev7:localfs" \ + "g14:path-element-1" \ + "p4:pathv18:bla-bla/some/path/" \ + "p10:class-namev7:testfs1" \ + "p10:vfs_prefixv5:test1" \ + "p4:userv4:user" \ + "p8:passwordv4:pass" \ + "p4:hostv9:some.host" \ + "p4:portv5:12345" \ + "g14:path-element-2" \ + "p4:pathv17:bla-bla/some/path" \ + "p10:class-namev7:testfs2" \ + "p10:vfs_prefixv5:test2" \ + "g14:path-element-3" \ + "p4:pathv9:111/22/33" \ + "p10:class-namev7:testfs3" \ + "p10:vfs_prefixv5:test3" +#endif + +/* *INDENT-OFF* */ +START_TEST (test_path_serialize) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath; + char *serialized_vpath; + GError *error = NULL; + + /* when */ + vpath = vfs_path_from_str_flags (ETALON_PATH_STR, VPF_USE_DEPRECATED_PARSER); + serialized_vpath = vfs_path_serialize (vpath, &error); + + vfs_path_free (vpath, TRUE); + + if (error != NULL) + g_error_free (error); + + /* then */ + mctest_assert_ptr_ne (serialized_vpath, NULL); + mctest_assert_str_eq (serialized_vpath, ETALON_SERIALIZED_PATH); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* *INDENT-OFF* */ +START_TEST (test_path_deserialize) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath; + GError *error = NULL; + + /* when */ + vpath = vfs_path_deserialize (ETALON_SERIALIZED_PATH, &error); + + /* then */ + mctest_assert_ptr_ne (vpath, NULL); + mctest_assert_str_eq (vfs_path_as_str (vpath), ETALON_PATH_URL_STR); + + vfs_path_free (vpath, TRUE); + +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + tcase_add_test (tc_core, test_path_serialize); + tcase_add_test (tc_core, test_path_deserialize); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/relative_cd.c b/tests/lib/vfs/relative_cd.c new file mode 100644 index 0000000..406a3e3 --- /dev/null +++ b/tests/lib/vfs/relative_cd.c @@ -0,0 +1,221 @@ +/* lib/vfs - test vfs_path_t manipulation functions + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#include <string.h> /* memset() */ + +#include "lib/strutil.h" +#include "lib/vfs/xdirentry.h" +#include "lib/vfs/path.h" + +#include "src/vfs/local/local.c" + + +static struct vfs_s_subclass vfs_test_subclass1; +static struct vfs_class *vfs_test_ops1 = VFS_CLASS (&vfs_test_subclass1); + +static int test_chdir (const vfs_path_t * vpath); + +/* --------------------------------------------------------------------------------------------- */ + +/* @CapturedValue */ +static vfs_path_t *test_chdir__vpath__captured; +/* @ThenReturnValue */ +static int test_chdir__return_value; + +/* @Mock */ +static int +test_chdir (const vfs_path_t * vpath) +{ + test_chdir__vpath__captured = vfs_path_clone (vpath); + return test_chdir__return_value; +} + +static void +test_chdir__init (void) +{ + test_chdir__vpath__captured = NULL; +} + +static void +test_chdir__deinit (void) +{ + vfs_path_free (test_chdir__vpath__captured, TRUE); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); + + memset (&vfs_test_subclass1, 0, sizeof (vfs_test_subclass1)); + vfs_init_class (vfs_test_ops1, "testfs1", VFSF_NOLINKS | VFSF_REMOTE, "test1"); + vfs_test_ops1->chdir = test_chdir; + vfs_register_class (vfs_test_ops1); + + mc_global.sysconfig_dir = (char *) TEST_SHARE_DIR; + + vfs_local_ops->chdir = test_chdir; + + test_chdir__init (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ + test_chdir__deinit (); + + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ +/* @DataSource("test_relative_cd_ds") */ +/* *INDENT-OFF* */ +static const struct test_relative_cd_ds +{ + const char *input_string; + const vfs_path_flag_t input_flags; + const char *expected_element_path; +} test_relative_cd_ds[] = +{ + { /* 0. */ + "/test1://user:pass@some.host:12345/path/to/dir", + VPF_NONE, + "path/to/dir" + }, + { /* 1. */ + "some-non-exists-dir", + VPF_NO_CANON, + "some-non-exists-dir" + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_relative_cd_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_relative_cd, test_relative_cd_ds) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath; + int actual_result; + + test_chdir__return_value = 0; + + vpath = vfs_path_from_str_flags (data->input_string, data->input_flags); + + /* when */ + actual_result = mc_chdir (vpath); + + /* then */ + { + const vfs_path_element_t *element; + + ck_assert_int_eq (actual_result, 0); + element = vfs_path_get_by_index (vpath, -1); + mctest_assert_str_eq (element->path, data->expected_element_path); + vfs_path_free (vpath, TRUE); + } +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* Relative to panel_correct_path_to_show() */ + +/* @Test */ +/* *INDENT-OFF* */ +START_TEST (test_vpath_to_str_filter) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath, *last_vpath; + char *filtered_path; + const vfs_path_element_t *path_element; + + /* when */ + vpath = vfs_path_from_str ("/test1://some.host/dir"); + path_element = vfs_path_element_clone (vfs_path_get_by_index (vpath, -1)); + vfs_path_free (vpath, TRUE); + + last_vpath = vfs_path_new (); + last_vpath->relative = TRUE; + + vfs_path_add_element (last_vpath, path_element); + + filtered_path = vfs_path_to_str_flags (last_vpath, 0, + VPF_STRIP_HOME | VPF_STRIP_PASSWORD | VPF_HIDE_CHARSET); + + /* then */ + mctest_assert_str_eq (filtered_path, "test1://some.host/dir"); + + vfs_path_free (last_vpath, TRUE); + g_free (filtered_path); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + char *cwd; + + tc_core = tcase_create ("Core"); + + /* writable directory where check creates temporary files */ + cwd = g_get_current_dir (); + g_setenv ("TEMP", cwd, TRUE); + g_free (cwd); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_relative_cd, test_relative_cd_ds); + tcase_add_test (tc_core, test_vpath_to_str_filter); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/tempdir.c b/tests/lib/vfs/tempdir.c new file mode 100644 index 0000000..5676eaa --- /dev/null +++ b/tests/lib/vfs/tempdir.c @@ -0,0 +1,140 @@ +/* + lib/vfs - manipulations with temp files and dirs + + Copyright (C) 2012-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2012, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#ifndef HAVE_CHARSET +#define HAVE_CHARSET 1 +#endif + +#include "lib/charsets.h" + +#include "lib/strutil.h" +#include "lib/vfs/xdirentry.h" +#include "lib/vfs/path.h" + +#include "src/vfs/local/local.c" + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @Test */ +/* *INDENT-OFF* */ +START_TEST (test_mc_tmpdir) +/* *INDENT-ON* */ +{ + /* given */ + const char *tmpdir; + const char *env_tmpdir; + + /* when */ + tmpdir = mc_tmpdir (); + env_tmpdir = g_getenv ("MC_TMPDIR"); + + /* then */ + ck_assert_msg (g_file_test (tmpdir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR), + "\nNo such directory: %s\n", tmpdir); + mctest_assert_str_eq (env_tmpdir, tmpdir); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @Test */ +/* *INDENT-OFF* */ +START_TEST (test_mc_mkstemps) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *pname_vpath = NULL; + char *begin_pname; + int fd; + + /* when */ + fd = mc_mkstemps (&pname_vpath, "mctest-", NULL); + begin_pname = g_build_filename (mc_tmpdir (), "mctest-", (char *) NULL); + + /* then */ + close (fd); + ck_assert_int_ne (fd, -1); + ck_assert_msg (g_file_test + (vfs_path_as_str (pname_vpath), G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR), + "\nNo such file: %s\n", vfs_path_as_str (pname_vpath)); + unlink (vfs_path_as_str (pname_vpath)); + ck_assert_msg (strncmp (vfs_path_as_str (pname_vpath), begin_pname, strlen (begin_pname)) == 0, + "\nstart of %s should be equal to %s\n", vfs_path_as_str (pname_vpath), + begin_pname); + vfs_path_free (pname_vpath, TRUE); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + tcase_add_test (tc_core, test_mc_tmpdir); + tcase_add_test (tc_core, test_mc_mkstemps); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_adjust_stat.c b/tests/lib/vfs/vfs_adjust_stat.c new file mode 100644 index 0000000..a687c45 --- /dev/null +++ b/tests/lib/vfs/vfs_adjust_stat.c @@ -0,0 +1,205 @@ +/* + lib/vfs - test vfs_adjust_stat() functionality + + Copyright (C) 2017-2022 + Free Software Foundation, Inc. + + Written by: + Andrew Borodin <aborodin@vmail.ru>, 2017 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#include <sys/stat.h> + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_test_vfs_adjust_stat_ds") */ +/* *INDENT-OFF* */ +static const struct test_vfs_adjust_stat_ds +{ + struct stat etalon_stat; +} test_vfs_adjust_stat_ds[] = +{ + /* 0 */ + { + .etalon_stat = + { + .st_size = 0, +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + .st_blksize = 512, +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + .st_blocks = 0 +#endif + } + }, + /* 1 */ + { + .etalon_stat = + { + .st_size = 4096, +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + .st_blksize = 512, +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + .st_blocks = 8 +#endif + } + }, + /* 2 */ + { + .etalon_stat = + { + .st_size = 4096, +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + .st_blksize = 1024, +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + .st_blocks = 8 +#endif + } + }, + /* 3 */ + { + .etalon_stat = + { + .st_size = 4096, +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + .st_blksize = 2048, +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + .st_blocks = 8 +#endif + } + }, + /* 4 */ + { + .etalon_stat = + { + .st_size = 4096, +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + .st_blksize = 4096, +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + .st_blocks = 8 +#endif + } + }, + /* 5 */ + { + .etalon_stat = + { + .st_size = 5000, +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + .st_blksize = 512, +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + .st_blocks = 10 +#endif + } + }, + /* 6 */ + { + .etalon_stat = + { + .st_size = 5000, +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + .st_blksize = 1024, +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + .st_blocks = 10 +#endif + } + }, + /* 7 */ + { + .etalon_stat = + { + .st_size = 5000, +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + .st_blksize = 2048, +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + .st_blocks = 12 +#endif + } + }, + /* 8 */ + { + .etalon_stat = + { + .st_size = 5000, +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + .st_blksize = 4096, +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + .st_blocks = 16 +#endif + } + } +}; +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @Test(dataSource = "test_vfs_adjust_stat_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_vfs_adjust_stat, test_vfs_adjust_stat_ds) +/* *INDENT-ON* */ +{ +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + /* given */ + struct stat expected_stat; + + expected_stat.st_size = data->etalon_stat.st_size; +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + expected_stat.st_blksize = data->etalon_stat.st_blksize; +#endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */ + /* when */ + vfs_adjust_stat (&expected_stat); + + /* then */ + ck_assert_int_eq (data->etalon_stat.st_blocks, expected_stat.st_blocks); +#else + ck_assert_int_eq (0, 0); +#endif /* HAVE_STRUCT_STAT_ST_BLOCKS */ +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_vfs_adjust_stat, test_vfs_adjust_stat_ds); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_get_encoding.c b/tests/lib/vfs/vfs_get_encoding.c new file mode 100644 index 0000000..f27720d --- /dev/null +++ b/tests/lib/vfs/vfs_get_encoding.c @@ -0,0 +1,159 @@ +/* + lib/vfs - test vfs_get_encoding() functionality + + Copyright (C) 2013-2022 + Free Software Foundation, Inc. + + Written by: + Andrew Borodin <aborodin@vmail.ru>, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#include "lib/vfs/path.c" /* for testing of static vfs_get_encoding() */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_vfs_get_encoding_ds") */ +/* *INDENT-OFF* */ +static const struct test_vfs_get_encoding_ds +{ + const char *path; + const char *expected_encoding; +} test_vfs_get_encoding_ds[] = +{ + { /* 0 */ + "", + NULL + }, + { /* 1 */ + "aaaa", + NULL + }, + { /* 2 */ + "/aaaa", + NULL + }, + { /* 3 */ + "aaaa/bbbb", + NULL + }, + { /* 4 */ + "/aaaa/bbbb", + NULL + }, + { /* 5 */ + "#enc:UTF-8/aaaa", + "UTF-8" + }, + { /* 6 */ + "/#enc:UTF-8/aaaa", + "UTF-8" + }, + { /* 7 */ + "/aaaa/#enc:UTF-8/bbbb", + "UTF-8" + }, + { /* 8 */ + "/aaaa/#enc:UTF-8/bbbb/#enc:KOI8-R", + "KOI8-R" + }, + { /* 9 */ + "/aaaa/#enc:UTF-8/bbbb/#enc:KOI8-R/cccc", + "KOI8-R" + }, + { /* 10 */ + "/aaaa/#enc:UTF-8/bbbb/cccc#enc:KOI8-R/dddd", + "UTF-8" + }, + { /* 11 */ + "/#enc:UTF-8/bbbb/cccc#enc:KOI8-R/dddd", + "UTF-8" + }, + { /* 12 */ + "#enc:UTF-8/bbbb/cccc#enc:KOI8-R/dddd", + "UTF-8" + }, + { /* 13 */ + "aaaa#enc:UTF-8/bbbb/cccc#enc:KOI8-R/dddd", + NULL + }, + { /* 14 */ + "/aaaa/#enc:UTF-8/bbbb/#enc:KOI8-R#enc:IBM866/cccc", + "KOI8-R#enc:IBM866" + } +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_vfs_get_encoding_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_vfs_get_encoding, test_vfs_get_encoding_ds) +/* *INDENT-ON* */ +{ + /* given */ + char *actual_encoding; + + /* when */ + actual_encoding = vfs_get_encoding (data->path, -1); + + /* then */ + mctest_assert_str_eq (actual_encoding, data->expected_encoding); + + g_free (actual_encoding); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_vfs_get_encoding, test_vfs_get_encoding_ds); + /* *********************************** */ + + 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 new file mode 100644 index 0000000..98d2d78 --- /dev/null +++ b/tests/lib/vfs/vfs_parse_ls_lga.c @@ -0,0 +1,426 @@ +/* + lib/vfs - test vfs_parse_ls_lga() functionality + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#include <stdio.h> + +#include "lib/vfs/utilvfs.h" +#include "lib/vfs/xdirentry.h" +#include "lib/strutil.h" + +#include "src/vfs/local/local.c" + + +struct vfs_s_subclass test_subclass1; +static struct vfs_class *vfs_test_ops1 = VFS_CLASS (&test_subclass1); + +struct vfs_s_entry *vfs_root_entry; +static struct vfs_s_inode *vfs_root_inode; +static struct vfs_s_super *vfs_test_super; + +/* *INDENT-OFF* */ +void message (int flags, const char *title, const char *text, ...) G_GNUC_PRINTF (3, 4); +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + static struct stat initstat; + + str_init_strings (NULL); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); + + vfs_init_subclass (&test_subclass1, "testfs1", VFSF_NOLINKS | VFSF_REMOTE, "test1"); + vfs_register_class (vfs_test_ops1); + + vfs_test_super = g_new0 (struct vfs_s_super, 1); + vfs_test_super->me = vfs_test_ops1; + + vfs_root_inode = vfs_s_new_inode (vfs_test_ops1, vfs_test_super, &initstat); + vfs_root_entry = vfs_s_new_entry (vfs_test_ops1, "/", vfs_root_inode); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ + vfs_s_free_entry (vfs_test_ops1, vfs_root_entry); + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @Mock */ +void +message (int flags, const char *title, const char *text, ...) +{ + char *p; + va_list ap; + + (void) flags; + (void) title; + + va_start (ap, text); + p = g_strdup_vprintf (text, ap); + va_end (ap); + printf ("message(): %s\n", p); + g_free (p); +} + +/* --------------------------------------------------------------------------------------------- */ + +static void +fill_stat_struct (struct stat *etalon_stat, int iterator) +{ + +#ifdef HAVE_STRUCT_STAT_ST_MTIM + etalon_stat->st_atim.tv_nsec = etalon_stat->st_mtim.tv_nsec = etalon_stat->st_ctim.tv_nsec = 0; +#endif + + switch (iterator) + { + case 0: + etalon_stat->st_dev = 0; + etalon_stat->st_ino = 0; + etalon_stat->st_mode = 0x41fd; + etalon_stat->st_nlink = 10; + etalon_stat->st_uid = 500; + etalon_stat->st_gid = 500; +#ifdef HAVE_STRUCT_STAT_ST_RDEV + etalon_stat->st_rdev = 0; +#endif + etalon_stat->st_size = 4096; +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + etalon_stat->st_blksize = 512; +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + etalon_stat->st_blocks = 8; +#endif + etalon_stat->st_atime = 1308838140; + etalon_stat->st_mtime = 1308838140; + etalon_stat->st_ctime = 1308838140; + break; + case 1: + etalon_stat->st_dev = 0; + etalon_stat->st_ino = 0; + etalon_stat->st_mode = 0xa1ff; + etalon_stat->st_nlink = 10; + etalon_stat->st_uid = 500; + etalon_stat->st_gid = 500; +#ifdef HAVE_STRUCT_STAT_ST_RDEV + etalon_stat->st_rdev = 0; +#endif + etalon_stat->st_size = 11; +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + etalon_stat->st_blksize = 512; +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + etalon_stat->st_blocks = 1; +#endif + etalon_stat->st_atime = 1268431200; + etalon_stat->st_mtime = 1268431200; + etalon_stat->st_ctime = 1268431200; + break; + case 2: + etalon_stat->st_dev = 0; + etalon_stat->st_ino = 0; + etalon_stat->st_mode = 0x41fd; + etalon_stat->st_nlink = 10; + etalon_stat->st_uid = 500; + etalon_stat->st_gid = 500; +#ifdef HAVE_STRUCT_STAT_ST_RDEV + etalon_stat->st_rdev = 0; +#endif + etalon_stat->st_size = 4096; +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + etalon_stat->st_blksize = 512; +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + etalon_stat->st_blocks = 8; +#endif + etalon_stat->st_atime = 1308838140; + etalon_stat->st_mtime = 1308838140; + etalon_stat->st_ctime = 1308838140; + break; + case 3: + etalon_stat->st_dev = 0; + etalon_stat->st_ino = 0; + etalon_stat->st_mode = 0x41fd; + etalon_stat->st_nlink = 10; + etalon_stat->st_uid = 500; + etalon_stat->st_gid = 500; +#ifdef HAVE_STRUCT_STAT_ST_RDEV + etalon_stat->st_rdev = 0; +#endif + etalon_stat->st_size = 4096; +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + etalon_stat->st_blksize = 512; +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + etalon_stat->st_blocks = 8; +#endif + etalon_stat->st_atime = 1308838140; + etalon_stat->st_mtime = 1308838140; + etalon_stat->st_ctime = 1308838140; + break; + default: + break; + } +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_vfs_parse_ls_lga_ds") */ +/* *INDENT-OFF* */ +static const struct test_vfs_parse_ls_lga_ds +{ + const char *input_string; + int expected_result; + const char *expected_filename; + const char *expected_linkname; + const size_t expected_filepos; +} test_vfs_parse_ls_lga_ds[] = +{ + { /* 0. */ + "drwxrwxr-x 10 500 500 4096 Jun 23 17:09 build_root", + 1, + "build_root", + NULL, + 0 + }, + { /* 1. */ + "lrwxrwxrwx 1 500 500 11 Mar 13 2010 COPYING -> doc/COPYING", + 1, + "COPYING", + "doc/COPYING", + 0 + }, + { /* 2. */ + "drwxrwxr-x 10 500 500 4096 Jun 23 17:09 ..", + 1, + "..", + NULL, + 0 + }, + { /* 3. */ + "drwxrwxr-x 10 500 500 4096 Jun 23 17:09 build_root", + 1, + "build_root", + NULL, + 0 + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_vfs_parse_ls_lga_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_vfs_parse_ls_lga, test_vfs_parse_ls_lga_ds) +/* *INDENT-ON* */ + +{ + /* given */ + size_t filepos = 0; + struct stat etalon_stat; + static struct stat test_stat; + char *filename = NULL; + char *linkname = NULL; + gboolean actual_result; + + vfs_parse_ls_lga_init (); + +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + etalon_stat.st_blocks = 0; +#endif + etalon_stat.st_size = 0; + etalon_stat.st_mode = 0; + fill_stat_struct (&etalon_stat, _i); + + /* when */ + actual_result = + vfs_parse_ls_lga (data->input_string, &test_stat, &filename, &linkname, &filepos); + + /* then */ + ck_assert_int_eq (actual_result, data->expected_result); + + mctest_assert_str_eq (filename, data->expected_filename); + mctest_assert_str_eq (linkname, data->expected_linkname); + + ck_assert_int_eq (etalon_stat.st_dev, test_stat.st_dev); + ck_assert_int_eq (etalon_stat.st_ino, test_stat.st_ino); + ck_assert_int_eq (etalon_stat.st_mode, test_stat.st_mode); + ck_assert_int_eq (etalon_stat.st_uid, test_stat.st_uid); + ck_assert_int_eq (etalon_stat.st_gid, test_stat.st_gid); +#ifdef HAVE_STRUCT_STAT_ST_RDEV + ck_assert_int_eq (etalon_stat.st_rdev, test_stat.st_rdev); +#endif + ck_assert_int_eq (etalon_stat.st_size, test_stat.st_size); +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + ck_assert_int_eq (etalon_stat.st_blksize, test_stat.st_blksize); +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + ck_assert_int_eq (etalon_stat.st_blocks, test_stat.st_blocks); +#endif + + /* FIXME: these commented checks are related to time zone! + ck_assert_int_eq (etalon_stat.st_atime, test_stat.st_atime); + ck_assert_int_eq (etalon_stat.st_mtime, test_stat.st_mtime); + ck_assert_int_eq (etalon_stat.st_ctime, test_stat.st_ctime); + */ + +#ifdef HAVE_STRUCT_STAT_ST_MTIM + ck_assert_int_eq (0, test_stat.st_atim.tv_nsec); + ck_assert_int_eq (0, test_stat.st_mtim.tv_nsec); + ck_assert_int_eq (0, test_stat.st_ctim.tv_nsec); +#endif + +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @Test */ +/* *INDENT-OFF* */ +START_TEST (test_vfs_parse_ls_lga_reorder) +/* *INDENT-ON* */ +{ + /* given */ + size_t filepos = 0; + struct vfs_s_entry *ent1, *ent2, *ent3; + + vfs_parse_ls_lga_init (); + + /* init ent1 */ + ent1 = vfs_s_generate_entry (vfs_test_ops1, NULL, vfs_root_inode, 0); + vfs_parse_ls_lga + ("drwxrwxr-x 10 500 500 4096 Jun 23 17:09 build_root1", &ent1->ino->st, + &ent1->name, &ent1->ino->linkname, &filepos); + vfs_s_store_filename_leading_spaces (ent1, filepos); + vfs_s_insert_entry (vfs_test_ops1, vfs_root_inode, ent1); + + + /* init ent2 */ + ent2 = vfs_s_generate_entry (vfs_test_ops1, NULL, vfs_root_inode, 0); + vfs_parse_ls_lga ("drwxrwxr-x 10 500 500 4096 Jun 23 17:09 build_root2", + &ent2->ino->st, &ent2->name, &ent2->ino->linkname, &filepos); + vfs_s_store_filename_leading_spaces (ent2, filepos); + vfs_s_insert_entry (vfs_test_ops1, vfs_root_inode, ent2); + + /* init ent3 */ + ent3 = vfs_s_generate_entry (vfs_test_ops1, NULL, vfs_root_inode, 0); + vfs_parse_ls_lga ("drwxrwxr-x 10 500 500 4096 Jun 23 17:09 ..", + &ent3->ino->st, &ent3->name, &ent3->ino->linkname, &filepos); + vfs_s_store_filename_leading_spaces (ent3, filepos); + vfs_s_insert_entry (vfs_test_ops1, vfs_root_inode, ent3); + + /* when */ + vfs_s_normalize_filename_leading_spaces (vfs_root_inode, vfs_parse_ls_lga_get_final_spaces ()); + + /* then */ + mctest_assert_str_eq (ent1->name, " build_root1"); + mctest_assert_str_eq (ent2->name, " build_root2"); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ +#define parce_one_line(ent_index, ls_output) {\ + ent[ent_index] = vfs_s_generate_entry (vfs_test_ops1, NULL, vfs_root_inode, 0);\ + if (! vfs_parse_ls_lga (ls_output,\ + &ent[ent_index]->ino->st, &ent[ent_index]->name, &ent[ent_index]->ino->linkname, &filepos))\ + {\ + ck_abort_msg ("An error occurred while parse ls output");\ + return;\ + }\ + vfs_s_store_filename_leading_spaces (ent[ent_index], filepos);\ + vfs_s_insert_entry (vfs_test_ops1, vfs_root_inode, ent[ent_index]);\ + \ +} + +/* @Test */ +/* *INDENT-OFF* */ +START_TEST (test_vfs_parse_ls_lga_unaligned) +/* *INDENT-ON* */ +{ + /* given */ + size_t filepos = 0; + struct vfs_s_entry *ent[4]; + + vfs_parse_ls_lga_init (); + + parce_one_line (0, "drwxrwxr-x 10 500 500 4096 Jun 23 17:09 build_root1"); + parce_one_line (1, "drwxrwxr-x 10 500 500 4096 Jun 23 17:09 build_root2"); + parce_one_line (2, "drwxrwxr-x 10 500 500 4096 Jun 23 17:09 .."); + parce_one_line (3, + "drwxrwxr-x 10 500 500 4096 Jun 23 17:09 build_root 0"); + + /* when */ + vfs_s_normalize_filename_leading_spaces (vfs_root_inode, vfs_parse_ls_lga_get_final_spaces ()); + + /* then */ + mctest_assert_str_eq (ent[0]->name, "build_root1"); + mctest_assert_str_eq (ent[0]->name, "build_root1"); + mctest_assert_str_eq (ent[1]->name, " build_root2"); + mctest_assert_str_eq (ent[3]->name, " build_root 0"); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_vfs_parse_ls_lga, test_vfs_parse_ls_lga_ds); + tcase_add_test (tc_core, test_vfs_parse_ls_lga_reorder); + tcase_add_test (tc_core, test_vfs_parse_ls_lga_unaligned); + /* *********************************** */ + + 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 new file mode 100644 index 0000000..d4e949b --- /dev/null +++ b/tests/lib/vfs/vfs_path_from_str_flags.c @@ -0,0 +1,125 @@ +/* lib/vfs - test vfs_path_from_str_flags() function + + Copyright (C) 2013-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#include "lib/strutil.h" +#include "lib/vfs/xdirentry.h" +#include "lib/vfs/path.h" + +#include "src/vfs/local/local.c" + +/* --------------------------------------------------------------------------------------------- */ + +/* @Mock */ +const char * +mc_config_get_home_dir (void) +{ + return "/mock/test"; +} + +/* --------------------------------------------------------------------------------------------- */ +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_from_to_string_ds") */ +/* *INDENT-OFF* */ +static const struct test_strip_home_ds +{ + const char *input_string; + const char *expected_result; +} test_strip_home_ds[] = +{ + { /* 0. */ + "/mock/test/some/path", + "~/some/path" + }, + { /* 1. */ + "/mock/testttt/some/path", + "/mock/testttt/some/path" + }, +}; +/* *INDENT-ON* */ + +/* @Test */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_strip_home, test_strip_home_ds) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *actual_result; + + /* when */ + actual_result = vfs_path_from_str_flags (data->input_string, VPF_STRIP_HOME); + + /* then */ + mctest_assert_str_eq (actual_result->str, data->expected_result); + + vfs_path_free (actual_result, TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_strip_home, test_strip_home_ds); + /* *********************************** */ + + 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 new file mode 100644 index 0000000..38272bd --- /dev/null +++ b/tests/lib/vfs/vfs_path_string_convert.c @@ -0,0 +1,335 @@ +/* + lib/vfs - get vfs_path_t from string + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#ifdef HAVE_CHARSET +#include "lib/charsets.h" +#endif + +#include "lib/strutil.h" +#include "lib/vfs/xdirentry.h" +#include "lib/vfs/path.c" /* for testing static methods */ + +#include "src/vfs/local/local.c" + +static struct vfs_class vfs_test_ops1, vfs_test_ops2, vfs_test_ops3; + +#define ETALON_PATH_STR "/#test1/bla-bla/some/path/#test2/bla-bla/some/path#test3/111/22/33" +#define ETALON_PATH_URL_STR "/test1://bla-bla/some/path/test2://bla-bla/some/path/test3://111/22/33" + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); + + vfs_init_class (&vfs_test_ops1, "testfs1", VFSF_NOLINKS, "test1"); + vfs_register_class (&vfs_test_ops1); + + vfs_init_class (&vfs_test_ops2, "testfs2", VFSF_REMOTE, "test2"); + vfs_register_class (&vfs_test_ops2); + + vfs_init_class (&vfs_test_ops3, "testfs3", VFSF_UNKNOWN, "test3"); + vfs_register_class (&vfs_test_ops3); + +#ifdef HAVE_CHARSET + mc_global.sysconfig_dir = (char *) TEST_SHARE_DIR; + load_codepages_list (); +#endif /* HAVE_CHARSET */ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ +#ifdef HAVE_CHARSET + free_codepages_list (); +#endif /* HAVE_CHARSET */ + + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ +/* @DataSource("test_from_to_string_ds") */ +/* *INDENT-OFF* */ +static const struct test_from_to_string_ds +{ + const char *input_string; + const char *expected_result; + const char *expected_element_path; + const size_t expected_elements_count; + struct vfs_class *expected_vfs_class; +} test_from_to_string_ds[] = +{ + { /* 0. */ + ETALON_PATH_STR, + ETALON_PATH_URL_STR, + "111/22/33", + 4, + &vfs_test_ops3 + }, + { /* 1. */ + "/", + "/", + "/", + 1, + VFS_CLASS (&local_subclass) + }, + { /* 2. */ + "/test1://bla-bla/some/path/test2://user:passwd@some.host:1234/bla-bla/some/path/test3://111/22/33", + "/test1://bla-bla/some/path/test2://user:passwd@some.host:1234/bla-bla/some/path/test3://111/22/33", + "111/22/33", + 4, + &vfs_test_ops3 + }, +#ifdef HAVE_CHARSET + { /* 3. */ + "/#test1/bla-bla1/some/path/#test2/bla-bla2/#enc:KOI8-R/some/path#test3/111/22/33", + "/test1://bla-bla1/some/path/test2://#enc:KOI8-R/bla-bla2/some/path/test3://111/22/33", + "111/22/33", + 4, + &vfs_test_ops3 + }, + { /* 4. */ + "/#test1/bla-bla1/#enc:IBM866/some/path/#test2/bla-bla2/#enc:KOI8-R/some/path#test3/111/22/33", + "/test1://#enc:IBM866/bla-bla1/some/path/test2://#enc:KOI8-R/bla-bla2/some/path/test3://111/22/33", + "111/22/33", + 4, + &vfs_test_ops3 + }, + { /* 5. */ + "/#test1/bla-bla1/some/path/#test2/bla-bla2/#enc:IBM866/#enc:KOI8-R/some/path#test3/111/22/33", + "/test1://bla-bla1/some/path/test2://#enc:KOI8-R/bla-bla2/some/path/test3://111/22/33", + "111/22/33", + 4, + &vfs_test_ops3 + }, + { /* 6. */ + "/#test1/bla-bla1/some/path/#test2/bla-bla2/#enc:IBM866/some/#enc:KOI8-R/path#test3/111/22/33", + "/test1://bla-bla1/some/path/test2://#enc:KOI8-R/bla-bla2/some/path/test3://111/22/33", + "111/22/33", + 4, + &vfs_test_ops3 + }, + { /* 7. */ + "/#test1/bla-bla1/some/path/#test2/#enc:IBM866/bla-bla2/#enc:KOI8-R/some/path#test3/111/22/33", + "/test1://bla-bla1/some/path/test2://#enc:KOI8-R/bla-bla2/some/path/test3://111/22/33", + "111/22/33", + 4, + &vfs_test_ops3 + }, + { /* 8. */ + "/#test1/bla-bla1/some/path/#enc:IBM866/#test2/bla-bla2/#enc:KOI8-R/some/path#test3/111/22/33", + "/test1://#enc:IBM866/bla-bla1/some/path/test2://#enc:KOI8-R/bla-bla2/some/path/test3://111/22/33", + "111/22/33", + 4, + &vfs_test_ops3 + }, +#endif /* HAVE_CHARSET */ +}; +/* *INDENT-ON* */ + +/* @Test */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_from_to_string, test_from_to_string_ds) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath; + size_t vpath_len; + const vfs_path_element_t *path_element; + const char *actual_result; + + vpath = vfs_path_from_str_flags (data->input_string, VPF_USE_DEPRECATED_PARSER); + + /* when */ + vpath_len = vfs_path_elements_count (vpath); + actual_result = vfs_path_as_str (vpath); + path_element = vfs_path_get_by_index (vpath, -1); + + /* then */ + ck_assert_int_eq (vpath_len, data->expected_elements_count); + mctest_assert_str_eq (actual_result, data->expected_result); + mctest_assert_ptr_eq (path_element->class, data->expected_vfs_class); + mctest_assert_str_eq (path_element->path, data->expected_element_path); + + vfs_path_free (vpath, TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_partial_string_by_index_ds") */ +/* *INDENT-OFF* */ +static const struct test_partial_string_by_index_ds +{ + const char *input_string; + const off_t element_index; + const char *expected_result; +} test_partial_string_by_index_ds[] = +{ + { /* 0. */ + ETALON_PATH_STR, + -1, + "/test1://bla-bla/some/path/test2://bla-bla/some/path" + }, + { /* 1. */ + ETALON_PATH_STR, + -2, + "/test1://bla-bla/some/path/" + }, + { /* 2. */ + ETALON_PATH_STR, + -3, + "/" + }, + { /* 3. Index out of bound */ + ETALON_PATH_STR, + -4, + "" + }, + { /* 4. */ + ETALON_PATH_STR, + 1, + "/" + }, + { /* 5. */ + ETALON_PATH_STR, + 2, + "/test1://bla-bla/some/path/" + }, + { /* 6. */ + ETALON_PATH_STR, + 3, + "/test1://bla-bla/some/path/test2://bla-bla/some/path" + }, + { /* 6. */ + ETALON_PATH_STR, + 4, + ETALON_PATH_URL_STR + }, + { /* 7. Index out of bound */ + ETALON_PATH_STR, + 5, + ETALON_PATH_URL_STR + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_partial_string_by_index_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_partial_string_by_index, test_partial_string_by_index_ds) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath; + char *actual_result; + vpath = vfs_path_from_str_flags (data->input_string, VPF_USE_DEPRECATED_PARSER); + + /* when */ + actual_result = vfs_path_to_str_elements_count (vpath, data->element_index); + + /* then */ + mctest_assert_str_eq (actual_result, data->expected_result); + g_free (actual_result); + + vfs_path_free (vpath, TRUE); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ +#ifdef HAVE_CHARSET +/* --------------------------------------------------------------------------------------------- */ + +#define ETALON_STR "/path/to/file.ext/test1://#enc:KOI8-R" +/* @Test */ +/* *INDENT-OFF* */ +START_TEST (test_vfs_path_encoding_at_end) +/* *INDENT-ON* */ +{ + /* given */ + vfs_path_t *vpath; + const char *result; + const vfs_path_element_t *element; + + vpath = + vfs_path_from_str_flags ("/path/to/file.ext#test1:/#enc:KOI8-R", VPF_USE_DEPRECATED_PARSER); + + /* when */ + result = vfs_path_as_str (vpath); + element = vfs_path_get_by_index (vpath, -1); + + /* then */ + mctest_assert_str_eq (element->path, ""); + mctest_assert_not_null (element->encoding); + mctest_assert_str_eq (result, ETALON_STR); + + vfs_path_free (vpath, TRUE); +} + +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ +#endif /* HAVE_CHARSET */ +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_from_to_string, test_from_to_string_ds); + mctest_add_parameterized_test (tc_core, test_partial_string_by_index, + test_partial_string_by_index_ds); +#ifdef HAVE_CHARSET + tcase_add_test (tc_core, test_vfs_path_encoding_at_end); +#endif + /* *********************************** */ + + 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 new file mode 100644 index 0000000..0be9840 --- /dev/null +++ b/tests/lib/vfs/vfs_prefix_to_class.c @@ -0,0 +1,170 @@ +/* + lib/vfs - test vfs_prefix_to_class() functionality + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#include "lib/strutil.h" +#include "lib/vfs/xdirentry.h" +#include "lib/vfs/vfs.c" /* for testing static methods */ + +#include "src/vfs/local/local.c" + +static struct vfs_class vfs_test_ops1, vfs_test_ops2, vfs_test_ops3; + +/* --------------------------------------------------------------------------------------------- */ + +static int +test_which (struct vfs_class *me, const char *path) +{ + (void) me; + + if ((strcmp (path, "test_1:") == 0) || + (strcmp (path, "test_2:") == 0) || + (strcmp (path, "test_3:") == 0) || (strcmp (path, "test_4:") == 0)) + return 1; + return -1; +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); + + vfs_init_class (&vfs_test_ops1, "testfs1", VFSF_NOLINKS | VFSF_REMOTE, "test1"); + vfs_test_ops1.which = test_which; + vfs_register_class (&vfs_test_ops1); + + vfs_init_class (&vfs_test_ops2, "testfs2", VFSF_UNKNOWN, "test2"); + vfs_register_class (&vfs_test_ops2); + + vfs_init_class (&vfs_test_ops3, "testfs3", VFSF_UNKNOWN, "test3"); + vfs_register_class (&vfs_test_ops3); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_vfs_prefix_to_class_ds") */ +/* *INDENT-OFF* */ +static const struct test_vfs_prefix_to_class_ds +{ + const char *input_string; + const struct vfs_class *expected_result; +} test_vfs_prefix_to_class_ds[] = +{ + { /* 0 */ + "test_1:", + &vfs_test_ops1 + }, + { /* 1 */ + "test_2:", + &vfs_test_ops1 + }, + { /* 2 */ + "test_3:", + &vfs_test_ops1 + }, + { /* 3 */ + "test_4:", + &vfs_test_ops1 + }, + { /* 4 */ + "test2:", + &vfs_test_ops2 + }, + { /* 5 */ + "test3:", + &vfs_test_ops3 + }, + { + "test1:", + NULL + }, + { /* 6 */ + "test_5:", + NULL + }, + { /* 7 */ + "test4:", + NULL + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_vfs_prefix_to_class_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_vfs_prefix_to_class, test_vfs_prefix_to_class_ds) +/* *INDENT-ON* */ +{ + /* given */ + struct vfs_class *actual_result; + + /* when */ + actual_result = vfs_prefix_to_class ((char *) data->input_string); + + /* then */ + mctest_assert_ptr_eq (actual_result, data->expected_result); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_vfs_prefix_to_class, test_vfs_prefix_to_class_ds); + /* *********************************** */ + + 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 new file mode 100644 index 0000000..c4f2cba --- /dev/null +++ b/tests/lib/vfs/vfs_s_get_path.c @@ -0,0 +1,168 @@ +/* + lib/vfs - test vfs_s_get_path() function + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#include "lib/strutil.h" +#include "lib/vfs/direntry.c" /* for testing static methods */ + +#include "src/vfs/local/local.c" + +#define ARCH_NAME "/path/to/some/file.ext" +#define ETALON_PATH "path/to/test1_file.ext" +#define ETALON_VFS_NAME "#test2:user:pass@host.net" +#define ETALON_VFS_URL_NAME "test2://user:pass@host.net" + +struct vfs_s_subclass test_subclass1, test_subclass2, test_subclass3; +static struct vfs_class *vfs_test_ops1 = VFS_CLASS (&test_subclass1); +static struct vfs_class *vfs_test_ops2 = VFS_CLASS (&test_subclass2); +static struct vfs_class *vfs_test_ops3 = VFS_CLASS (&test_subclass3); + +/* --------------------------------------------------------------------------------------------- */ + +static int +test1_mock_open_archive (struct vfs_s_super *super, const vfs_path_t * vpath, + const vfs_path_element_t * vpath_element) +{ + struct vfs_s_inode *root; + + mctest_assert_str_eq (vfs_path_as_str (vpath), "/" ETALON_VFS_URL_NAME ARCH_NAME); + + super->name = g_strdup (vfs_path_as_str (vpath)); + root = vfs_s_new_inode (vpath_element->class, super, NULL); + super->root = root; + return 0; +} + +/* --------------------------------------------------------------------------------------------- */ + +static int +test1_mock_archive_same (const vfs_path_element_t * vpath_element, struct vfs_s_super *super, + const vfs_path_t * vpath, void *cookie) +{ + const vfs_path_element_t *path_element; + + (void) vpath_element; + (void) super; + (void) cookie; + + path_element = vfs_path_get_by_index (vpath, -1); + if (strcmp (ARCH_NAME, path_element->path) != 0) + return 0; + return 1; +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); + + vfs_init_subclass (&test_subclass1, "testfs1", VFSF_NOLINKS | VFSF_REMOTE, "test1"); + test_subclass1.open_archive = test1_mock_open_archive; + test_subclass1.archive_same = test1_mock_archive_same; + test_subclass1.archive_check = NULL; + vfs_register_class (vfs_test_ops1); + + vfs_init_subclass (&test_subclass2, "testfs2", VFSF_UNKNOWN, "test2"); + vfs_register_class (vfs_test_ops2); + + vfs_init_subclass (&test_subclass3, "testfs3", VFSF_UNKNOWN, "test3"); + vfs_register_class (vfs_test_ops3); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ + vfs_shut (); + str_uninit_strings (); +} + + +void +vfs_die (const char *m) +{ + printf ("VFS_DIE: '%s'\n", m); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @Test */ +/* *INDENT-OFF* */ +START_TEST (test_vfs_s_get_path) +/* *INDENT-ON* */ +{ + /* given */ + struct vfs_s_super *archive; + const char *result; + + /* when */ + vfs_path_t *vpath = + vfs_path_from_str_flags ("/" ETALON_VFS_NAME ARCH_NAME "#test1:/" ETALON_PATH, + VPF_USE_DEPRECATED_PARSER); + + result = vfs_s_get_path (vpath, &archive, 0); + + /* then */ + mctest_assert_str_eq (result, ETALON_PATH); + mctest_assert_str_eq (archive->name, "/" ETALON_VFS_URL_NAME ARCH_NAME); + + g_free (vpath); + +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + tcase_add_test (tc_core, test_vfs_s_get_path); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_setup_cwd.c b/tests/lib/vfs/vfs_setup_cwd.c new file mode 100644 index 0000000..9390731 --- /dev/null +++ b/tests/lib/vfs/vfs_setup_cwd.c @@ -0,0 +1,157 @@ +/* + lib/vfs - test vfs_setup_cwd() functionality + + Copyright (C) 2013-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#include <stdlib.h> + +#include "lib/strutil.h" +#include "lib/vfs/xdirentry.h" +#include "src/vfs/local/local.c" + +/* --------------------------------------------------------------------------------------------- */ + +/* @Mock */ +char * +g_get_current_dir (void) +{ + return g_strdup ("/some/path"); +} + +/* --------------------------------------------------------------------------------------------- */ + +static gboolean mc_stat__is_2nd_call_different = FALSE; +static gboolean mc_stat__call_count = 0; + +/* @Mock */ +int +mc_stat (const vfs_path_t * vpath, struct stat *my_stat) +{ + (void) vpath; + + if (mc_stat__call_count++ > 1 && mc_stat__is_2nd_call_different) + { + my_stat->st_ino = 2; + my_stat->st_dev = 22; + } + else + { + my_stat->st_ino = 1; + my_stat->st_dev = 11; + } + if (mc_stat__call_count > 2) + { + mc_stat__call_count = 0; + } + return 0; +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_vfs_setup_cwd_symlink_ds") */ +/* *INDENT-OFF* */ +static const struct test_vfs_setup_cwd_symlink_ds +{ + gboolean is_2nd_call_different; + const char *expected_result; +} test_vfs_setup_cwd_symlink_ds[] = +{ + { /* 0. */ + TRUE, + "/some/path" + }, + { /* 1. */ + FALSE, + "/some/path2" + }, +}; +/* *INDENT-ON* */ + +/* @Test */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_vfs_setup_cwd_symlink, test_vfs_setup_cwd_symlink_ds) +/* *INDENT-ON* */ +{ + /* given */ + vfs_set_raw_current_dir (NULL); + mc_stat__is_2nd_call_different = data->is_2nd_call_different; + mc_stat__call_count = 0; + setenv ("PWD", "/some/path2", 1); + + /* when */ + vfs_setup_cwd (); + + /* then */ + mctest_assert_str_eq (vfs_path_as_str (vfs_get_raw_current_dir ()), data->expected_result); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_vfs_setup_cwd_symlink, + test_vfs_setup_cwd_symlink_ds); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/vfs/vfs_split.c b/tests/lib/vfs/vfs_split.c new file mode 100644 index 0000000..9333766 --- /dev/null +++ b/tests/lib/vfs/vfs_split.c @@ -0,0 +1,207 @@ +/* + lib/vfs - test vfs_split() functionality + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/vfs" + +#include "tests/mctest.h" + +#include "lib/strutil.h" +#include "lib/vfs/xdirentry.h" +#include "lib/vfs/path.c" /* for testing static methods */ + +#include "src/vfs/local/local.c" + +static struct vfs_class vfs_test_ops1, vfs_test_ops2, vfs_test_ops3; + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + + vfs_init (); + vfs_init_localfs (); + vfs_setup_work_dir (); + + vfs_init_class (&vfs_test_ops1, "testfs1", VFSF_NOLINKS | VFSF_REMOTE, "test1"); + vfs_register_class (&vfs_test_ops1); + + vfs_init_class (&vfs_test_ops2, "testfs2", VFSF_UNKNOWN, "test2"); + vfs_register_class (&vfs_test_ops2); + + vfs_init_class (&vfs_test_ops3, "testfs3", VFSF_UNKNOWN, "test3"); + vfs_register_class (&vfs_test_ops3); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ + vfs_shut (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_vfs_split_ds") */ +/* *INDENT-OFF* */ +static const struct test_vfs_split_ds +{ + const char *input_string; + const char *expected_path; + const char *expected_local; + const char *expected_op; + const struct vfs_class *expected_result; +} test_vfs_split_ds[] = +{ + { /* 0. */ + "#test1:/bla-bla/some/path/#test2:/bla-bla/some/path2/#test3:/qqq/www/eee.rr", + "#test1:/bla-bla/some/path/#test2:/bla-bla/some/path2/", + "qqq/www/eee.rr", + "test3:", + &vfs_test_ops3 + }, + { /* 1. */ + "#test1:/bla-bla/some/path/#test2:/bla-bla/some/path2/", + "#test1:/bla-bla/some/path/", + "bla-bla/some/path2/", + "test2:", + &vfs_test_ops2 + }, + { /* 2. */ + "#test1:/bla-bla/some/path/", + "", + "bla-bla/some/path/", + "test1:", + &vfs_test_ops1 + }, + { /* 3. */ + "", + "", + NULL, + NULL, + NULL + }, + { /* 4. split with local */ + "/local/path/#test1:/bla-bla/some/path/#test2:/bla-bla/some/path2#test3:/qqq/www/eee.rr", + "/local/path/#test1:/bla-bla/some/path/#test2:/bla-bla/some/path2", + "qqq/www/eee.rr", + "test3:", + &vfs_test_ops3 + }, + { /* 5. split with local */ + "/local/path/#test1:/bla-bla/some/path/#test2:/bla-bla/some/path2", + "/local/path/#test1:/bla-bla/some/path/", + "bla-bla/some/path2", + "test2:", + &vfs_test_ops2 + }, + { /* 6. split with local */ + "/local/path/#test1:/bla-bla/some/path/", + "/local/path/", + "bla-bla/some/path/", + "test1:", + &vfs_test_ops1 + }, + { /* 7. split with local */ + "/local/path/", + "/local/path/", + NULL, + NULL, + NULL + }, + { /* 8. split with URL */ + "#test2:username:passwd@somehost.net/bla-bla/some/path2", + "", + "bla-bla/some/path2", + "test2:username:passwd@somehost.net", + &vfs_test_ops2 + }, + { /* 9. split URL with semi */ + "/local/path/#test1:/bla-bla/some/path/#test2:username:p!a@s#s$w%d@somehost.net/bla-bla/some/path2", + "/local/path/#test1:/bla-bla/some/path/", + "bla-bla/some/path2", + "test2:username:p!a@s#s$w%d@somehost.net", + &vfs_test_ops2 + }, + { /* 10. split with semi in path */ + "#test2:/bl#a-bl#a/so#me/pa#th2", + "", + "bl#a-bl#a/so#me/pa#th2", + "test2:", + &vfs_test_ops2 + } +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_vfs_split_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_vfs_split, test_vfs_split_ds) +/* *INDENT-ON* */ +{ + /* given */ + const char *local = NULL, *op = NULL; + struct vfs_class *actual_result; + char *path; + + path = g_strdup (data->input_string); + + /* when */ + actual_result = _vfs_split_with_semi_skip_count (path, &local, &op, 0); + + /* then */ + mctest_assert_ptr_eq (actual_result, data->expected_result); + mctest_assert_str_eq (path, data->expected_path); + mctest_assert_str_eq (local, data->expected_local); + mctest_assert_str_eq (op, data->expected_op); + g_free (path); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_vfs_split, test_vfs_split_ds); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/widget/Makefile.am b/tests/lib/widget/Makefile.am new file mode 100644 index 0000000..0cf0c75 --- /dev/null +++ b/tests/lib/widget/Makefile.am @@ -0,0 +1,40 @@ +PACKAGE_STRING = "/lib/widget" + +AM_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/lib/vfs \ + @CHECK_CFLAGS@ + +AM_LDFLAGS = @TESTS_LDFLAGS@ + +LIBS = @CHECK_LIBS@ \ + $(top_builddir)/lib/libmc.la + +if ENABLE_MCLIB +LIBS += $(GLIB_LIBS) +endif + +TESTS = \ + complete_engine \ + hotkey_equal \ + group_init_destroy \ + widget_find_by_id \ + widget_make_global_local + +check_PROGRAMS = $(TESTS) + +complete_engine_SOURCES = \ + complete_engine.c + +hotkey_equal_SOURCES = \ + hotkey_equal.c + +group_init_destroy_SOURCES = \ + group_init_destroy.c + +widget_find_by_id_SOURCES = \ + widget_find_by_id.c + +widget_make_global_local_SOURCES = \ + widget_make_global_local.c diff --git a/tests/lib/widget/Makefile.in b/tests/lib/widget/Makefile.in new file mode 100644 index 0000000..b795f81 --- /dev/null +++ b/tests/lib/widget/Makefile.in @@ -0,0 +1,1208 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@ENABLE_MCLIB_TRUE@am__append_1 = $(GLIB_LIBS) +TESTS = complete_engine$(EXEEXT) hotkey_equal$(EXEEXT) \ + group_init_destroy$(EXEEXT) widget_find_by_id$(EXEEXT) \ + widget_make_global_local$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = tests/lib/widget +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/m4.include/gnulib/mode_t.m4 \ + $(top_srcdir)/m4.include/gnulib/stat-size.m4 \ + $(top_srcdir)/m4.include/gnulib/fstypename.m4 \ + $(top_srcdir)/m4.include/gnulib/fsusage.m4 \ + $(top_srcdir)/m4.include/gnulib/mountlist.m4 \ + $(top_srcdir)/m4.include/gnulib/windows-stat-inodes.m4 \ + $(top_srcdir)/m4.include/gnulib/sys_types_h.m4 \ + $(top_srcdir)/m4.include/ax_path_lib_pcre.m4 \ + $(top_srcdir)/m4.include/dx_doxygen.m4 \ + $(top_srcdir)/m4.include/ax_require_defined.m4 \ + $(top_srcdir)/m4.include/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4.include/ax_append_flag.m4 \ + $(top_srcdir)/m4.include/ax_append_compile_flags.m4 \ + $(top_srcdir)/m4.include/mc-cflags.m4 \ + $(top_srcdir)/m4.include/ax_gcc_func_attribute.m4 \ + $(top_srcdir)/m4.include/mc-check-search-type.m4 \ + $(top_srcdir)/m4.include/mc-get-fs-info.m4 \ + $(top_srcdir)/m4.include/mc-with-x.m4 \ + $(top_srcdir)/m4.include/mc-use-termcap.m4 \ + $(top_srcdir)/m4.include/mc-with-screen.m4 \ + $(top_srcdir)/m4.include/mc-with-screen-ncurses.m4 \ + $(top_srcdir)/m4.include/mc-with-screen-slang.m4 \ + $(top_srcdir)/m4.include/mc-with-internal-edit.m4 \ + $(top_srcdir)/m4.include/mc-subshell.m4 \ + $(top_srcdir)/m4.include/mc-background.m4 \ + $(top_srcdir)/m4.include/mc-ext2fs-attr.m4 \ + $(top_srcdir)/m4.include/mc-glib.m4 \ + $(top_srcdir)/m4.include/mc-vfs.m4 \ + $(top_srcdir)/m4.include/vfs/rpc.m4 \ + $(top_srcdir)/m4.include/vfs/socket.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-extfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-sfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-ftp.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-sftp.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-fish.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-undelfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-tarfs.m4 \ + $(top_srcdir)/m4.include/vfs/mc-vfs-cpiofs.m4 \ + $(top_srcdir)/m4.include/mc-version.m4 \ + $(top_srcdir)/m4.include/mc-tests.m4 \ + $(top_srcdir)/m4.include/mc-i18n.m4 \ + $(top_srcdir)/m4.include/mc-assert.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__EXEEXT_1 = complete_engine$(EXEEXT) hotkey_equal$(EXEEXT) \ + group_init_destroy$(EXEEXT) widget_find_by_id$(EXEEXT) \ + widget_make_global_local$(EXEEXT) +am_complete_engine_OBJECTS = complete_engine.$(OBJEXT) +complete_engine_OBJECTS = $(am_complete_engine_OBJECTS) +complete_engine_LDADD = $(LDADD) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am_group_init_destroy_OBJECTS = group_init_destroy.$(OBJEXT) +group_init_destroy_OBJECTS = $(am_group_init_destroy_OBJECTS) +group_init_destroy_LDADD = $(LDADD) +am_hotkey_equal_OBJECTS = hotkey_equal.$(OBJEXT) +hotkey_equal_OBJECTS = $(am_hotkey_equal_OBJECTS) +hotkey_equal_LDADD = $(LDADD) +am_widget_find_by_id_OBJECTS = widget_find_by_id.$(OBJEXT) +widget_find_by_id_OBJECTS = $(am_widget_find_by_id_OBJECTS) +widget_find_by_id_LDADD = $(LDADD) +am_widget_make_global_local_OBJECTS = \ + widget_make_global_local.$(OBJEXT) +widget_make_global_local_OBJECTS = \ + $(am_widget_make_global_local_OBJECTS) +widget_make_global_local_LDADD = $(LDADD) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/complete_engine.Po \ + ./$(DEPDIR)/group_init_destroy.Po ./$(DEPDIR)/hotkey_equal.Po \ + ./$(DEPDIR)/widget_find_by_id.Po \ + ./$(DEPDIR)/widget_make_global_local.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(complete_engine_SOURCES) $(group_init_destroy_SOURCES) \ + $(hotkey_equal_SOURCES) $(widget_find_by_id_SOURCES) \ + $(widget_make_global_local_SOURCES) +DIST_SOURCES = $(complete_engine_SOURCES) \ + $(group_init_destroy_SOURCES) $(hotkey_equal_SOURCES) \ + $(widget_find_by_id_SOURCES) \ + $(widget_make_global_local_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red='[0;31m'; \ + grn='[0;32m'; \ + lgn='[1;32m'; \ + blu='[1;34m'; \ + mgn='[0;35m'; \ + brg='[1m'; \ + std='[m'; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_CFLAGS = @CHECK_CFLAGS@ +CHECK_LIBS = @CHECK_LIBS@ +COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ +COM_ERR_LIBS = @COM_ERR_LIBS@ +CP1251 = @CP1251@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOC_LINGUAS = @DOC_LINGUAS@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +E2P_CFLAGS = @E2P_CFLAGS@ +E2P_LIBS = @E2P_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ +EXT2FS_LIBS = @EXT2FS_LIBS@ +EXTHELPERSDIR = @EXTHELPERSDIR@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +HAVE_FILECMD = @HAVE_FILECMD@ +HAVE_ZIPINFO = @HAVE_ZIPINFO@ +HAVE_nroff = @HAVE_nroff@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBMC_RELEASE = @LIBMC_RELEASE@ +LIBMC_VERSION = @LIBMC_VERSION@ +LIBOBJS = @LIBOBJS@ +LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la $(am__append_1) +LIBSSH_CFLAGS = @LIBSSH_CFLAGS@ +LIBSSH_LIBS = @LIBSSH_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANDOC = @MANDOC@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_DATE = @MAN_DATE@ +MAN_FLAGS = @MAN_FLAGS@ +MAN_VERSION = @MAN_VERSION@ +MCLIBS = @MCLIBS@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = "/lib/widget" +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRE_CPPFLAGS = @PCRE_CPPFLAGS@ +PCRE_LIBS = @PCRE_LIBS@ +PERL = @PERL@ +PERL_FOR_BUILD = @PERL_FOR_BUILD@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +RANLIB = @RANLIB@ +RUBY = @RUBY@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SLANG_CFLAGS = @SLANG_CFLAGS@ +SLANG_LIBS = @SLANG_LIBS@ +STRIP = @STRIP@ +TESTS_LDFLAGS = @TESTS_LDFLAGS@ +UNZIP = @UNZIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +X11_WWW = @X11_WWW@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZIP = @ZIP@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/lib/vfs \ + @CHECK_CFLAGS@ + +AM_LDFLAGS = @TESTS_LDFLAGS@ +complete_engine_SOURCES = \ + complete_engine.c + +hotkey_equal_SOURCES = \ + hotkey_equal.c + +group_init_destroy_SOURCES = \ + group_init_destroy.c + +widget_find_by_id_SOURCES = \ + widget_find_by_id.c + +widget_make_global_local_SOURCES = \ + widget_make_global_local.c + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/lib/widget/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/lib/widget/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +complete_engine$(EXEEXT): $(complete_engine_OBJECTS) $(complete_engine_DEPENDENCIES) $(EXTRA_complete_engine_DEPENDENCIES) + @rm -f complete_engine$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(complete_engine_OBJECTS) $(complete_engine_LDADD) $(LIBS) + +group_init_destroy$(EXEEXT): $(group_init_destroy_OBJECTS) $(group_init_destroy_DEPENDENCIES) $(EXTRA_group_init_destroy_DEPENDENCIES) + @rm -f group_init_destroy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(group_init_destroy_OBJECTS) $(group_init_destroy_LDADD) $(LIBS) + +hotkey_equal$(EXEEXT): $(hotkey_equal_OBJECTS) $(hotkey_equal_DEPENDENCIES) $(EXTRA_hotkey_equal_DEPENDENCIES) + @rm -f hotkey_equal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(hotkey_equal_OBJECTS) $(hotkey_equal_LDADD) $(LIBS) + +widget_find_by_id$(EXEEXT): $(widget_find_by_id_OBJECTS) $(widget_find_by_id_DEPENDENCIES) $(EXTRA_widget_find_by_id_DEPENDENCIES) + @rm -f widget_find_by_id$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(widget_find_by_id_OBJECTS) $(widget_find_by_id_LDADD) $(LIBS) + +widget_make_global_local$(EXEEXT): $(widget_make_global_local_OBJECTS) $(widget_make_global_local_DEPENDENCIES) $(EXTRA_widget_make_global_local_DEPENDENCIES) + @rm -f widget_make_global_local$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(widget_make_global_local_OBJECTS) $(widget_make_global_local_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/complete_engine.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/group_init_destroy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hotkey_equal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/widget_find_by_id.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/widget_make_global_local.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: $(check_PROGRAMS) + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +complete_engine.log: complete_engine$(EXEEXT) + @p='complete_engine$(EXEEXT)'; \ + b='complete_engine'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +hotkey_equal.log: hotkey_equal$(EXEEXT) + @p='hotkey_equal$(EXEEXT)'; \ + b='hotkey_equal'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +group_init_destroy.log: group_init_destroy$(EXEEXT) + @p='group_init_destroy$(EXEEXT)'; \ + b='group_init_destroy'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +widget_find_by_id.log: widget_find_by_id$(EXEEXT) + @p='widget_find_by_id$(EXEEXT)'; \ + b='widget_find_by_id'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +widget_make_global_local.log: widget_make_global_local$(EXEEXT) + @p='widget_make_global_local$(EXEEXT)'; \ + b='widget_make_global_local'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/complete_engine.Po + -rm -f ./$(DEPDIR)/group_init_destroy.Po + -rm -f ./$(DEPDIR)/hotkey_equal.Po + -rm -f ./$(DEPDIR)/widget_find_by_id.Po + -rm -f ./$(DEPDIR)/widget_make_global_local.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/complete_engine.Po + -rm -f ./$(DEPDIR)/group_init_destroy.Po + -rm -f ./$(DEPDIR)/hotkey_equal.Po + -rm -f ./$(DEPDIR)/widget_find_by_id.Po + -rm -f ./$(DEPDIR)/widget_make_global_local.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/lib/widget/complete_engine.c b/tests/lib/widget/complete_engine.c new file mode 100644 index 0000000..9a3e8e1 --- /dev/null +++ b/tests/lib/widget/complete_engine.c @@ -0,0 +1,236 @@ +/* + lib/widget - tests for autocomplete feature + + Copyright (C) 2013-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/widget" + +#include "tests/mctest.h" + +#include "lib/strutil.h" +#include "lib/widget.h" + +/* --------------------------------------------------------------------------------------------- */ + +void complete_engine_fill_completions (WInput * in); +char **try_complete (char *text, int *lc_start, int *lc_end, input_complete_t flags); + +/* --------------------------------------------------------------------------------------------- */ + +/* @CapturedValue */ +static char *try_complete__text__captured; +/* @CapturedValue */ +static int try_complete__lc_start__captured; +/* @CapturedValue */ +static int try_complete__lc_end__captured; +/* @CapturedValue */ +static input_complete_t try_complete__flags__captured; + +/* @ThenReturnValue */ +static char **try_complete__return_value; + +/* @Mock */ +char ** +try_complete (char *text, int *lc_start, int *lc_end, input_complete_t flags) +{ + try_complete__text__captured = g_strdup (text); + try_complete__lc_start__captured = *lc_start; + try_complete__lc_end__captured = *lc_end; + try_complete__flags__captured = flags; + + return try_complete__return_value; +} + +static void +try_complete__init (void) +{ + try_complete__text__captured = NULL; + try_complete__lc_start__captured = 0; + try_complete__lc_end__captured = 0; + try_complete__flags__captured = 0; +} + +static void +try_complete__deinit (void) +{ + g_free (try_complete__text__captured); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ + str_init_strings (NULL); + try_complete__init (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ + try_complete__deinit (); + str_uninit_strings (); +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_complete_engine_fill_completions_ds") */ +/* *INDENT-OFF* */ +static const struct test_complete_engine_fill_completions_ds +{ + const char *input_buffer; + const int input_point; + const input_complete_t input_completion_flags; + int expected_start; + int expected_end; +} test_complete_engine_fill_completions_ds[] = +{ + { + "string", + 3, + INPUT_COMPLETE_NONE, + 0, + 3 + }, + { + "some string", + 7, + INPUT_COMPLETE_NONE, + 0, + 7 + }, + { + "some string", + 7, + INPUT_COMPLETE_SHELL_ESC, + 5, + 7 + }, + { + "some\\ string111", + 9, + INPUT_COMPLETE_SHELL_ESC, + 0, + 9 + }, + { + "some\\\tstring111", + 9, + INPUT_COMPLETE_SHELL_ESC, + 0, + 9 + }, + { + "some\tstring", + 7, + INPUT_COMPLETE_NONE, + 5, + 7 + }, + { + "some;string", + 7, + INPUT_COMPLETE_NONE, + 5, + 7 + }, + { + "some|string", + 7, + INPUT_COMPLETE_NONE, + 5, + 7 + }, + { + "some<string", + 7, + INPUT_COMPLETE_NONE, + 5, + 7 + }, + { + "some>string", + 7, + INPUT_COMPLETE_NONE, + 5, + 7 + }, + { + "some!@#$%^&*()_\\+~`\"',./?:string", + 30, + INPUT_COMPLETE_NONE, + 0, + 30 + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_complete_engine_fill_completions_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_complete_engine_fill_completions, + test_complete_engine_fill_completions_ds) +/* *INDENT-ON* */ +{ + /* given */ + WInput *w_input; + + w_input = input_new (1, 1, NULL, 100, data->input_buffer, NULL, data->input_completion_flags); + w_input->point = data->input_point; + + /* when */ + complete_engine_fill_completions (w_input); + + /* then */ + mctest_assert_str_eq (try_complete__text__captured, data->input_buffer); + ck_assert_int_eq (try_complete__lc_start__captured, data->expected_start); + ck_assert_int_eq (try_complete__lc_end__captured, data->expected_end); + ck_assert_int_eq (try_complete__flags__captured, data->input_completion_flags); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_complete_engine_fill_completions, + test_complete_engine_fill_completions_ds); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/widget/group_init_destroy.c b/tests/lib/widget/group_init_destroy.c new file mode 100644 index 0000000..9caad4e --- /dev/null +++ b/tests/lib/widget/group_init_destroy.c @@ -0,0 +1,159 @@ +/* + libmc - checks for initialization and deinitialization of WGroup widget + + Copyright (C) 2020-2022 + The Free Software Foundation, Inc. + + Written by: + Andrew Borodin <aborodin@vmail.ru>, 2020-2022 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "lib/widget/group" + +#include <config.h> + +#include <check.h> + +#include "lib/widget.h" + +#include "tests/mctest.h" + +/* --------------------------------------------------------------------------------------------- */ + +static int ref = 0; + +/* --------------------------------------------------------------------------------------------- */ + +static cb_ret_t +widget_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data) +{ + switch (msg) + { + case MSG_INIT: + ref++; + return widget_default_callback (w, NULL, MSG_INIT, 0, NULL); + + case MSG_DESTROY: + ref--; + return widget_default_callback (w, NULL, MSG_DESTROY, 0, NULL); + + default: + return widget_default_callback (w, sender, msg, parm, data); + } +} + +/* --------------------------------------------------------------------------------------------- */ + +static cb_ret_t +group_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data) +{ + switch (msg) + { + case MSG_INIT: + ref++; + return group_default_callback (w, NULL, MSG_INIT, 0, NULL); + + case MSG_DESTROY: + ref--; + return group_default_callback (w, NULL, MSG_DESTROY, 0, NULL); + + default: + return group_default_callback (w, sender, msg, parm, data); + } +} + +/* --------------------------------------------------------------------------------------------- */ + +/* *INDENT-OFF* */ +START_TEST (test_group_init_deinit) +/* *INDENT-ON* */ +{ + WGroup *g, *g0; + Widget *w0; + WRect r; + + g = g_new0 (WGroup, 1); + rect_init (&r, 0, 0, 20, 20); + group_init (g, &r, group_callback, NULL); + + g0 = g_new0 (WGroup, 1); + rect_init (&r, 0, 0, 10, 10); + group_init (g0, &r, group_callback, NULL); + group_add_widget (g, g0); + + w0 = g_new0 (Widget, 1); + rect_init (&r, 0, 0, 5, 5); + widget_init (w0, &r, widget_callback, NULL); + group_add_widget (g0, w0); + + w0 = g_new0 (Widget, 1); + rect_init (&r, 5, 5, 5, 5); + widget_init (w0, &r, widget_callback, NULL); + group_add_widget (g0, w0); + + g0 = g_new0 (WGroup, 1); + rect_init (&r, 10, 10, 10, 10); + group_init (g0, &r, group_callback, NULL); + group_add_widget (g, g0); + + w0 = g_new0 (Widget, 1); + rect_init (&r, 10, 10, 5, 5); + widget_init (w0, &r, widget_callback, NULL); + group_add_widget (g0, w0); + + w0 = g_new0 (Widget, 1); + rect_init (&r, 15, 15, 5, 5); + widget_init (w0, &r, widget_callback, NULL); + group_add_widget (g0, w0); + + w0 = g_new0 (Widget, 1); + rect_init (&r, 5, 5, 10, 10); + widget_init (w0, &r, widget_callback, NULL); + group_add_widget (g, w0); + + ck_assert_msg (w0->id == 7, "last id (%d) != 7", ref); + + send_message (g, NULL, MSG_INIT, 0, NULL); + + ck_assert_msg (ref == 8, "ref (%d) != 8", ref); + + widget_destroy (WIDGET (g)); + + ck_assert_msg (ref == 0, "ref (%d) != 0", ref); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + /* Add new tests here: *************** */ + tcase_add_test (tc_core, test_group_init_deinit); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/widget/hotkey_equal.c b/tests/lib/widget/hotkey_equal.c new file mode 100644 index 0000000..4ec1925 --- /dev/null +++ b/tests/lib/widget/hotkey_equal.c @@ -0,0 +1,167 @@ +/* + lib/widget - tests for hotkey comparision + + Copyright (C) 2019-2022 + Free Software Foundation, Inc. + + Written by: + Andrew Borodin <aborodin@vmail.ru>, 2019 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib/widget" + +#include "tests/mctest.h" + +#include "lib/widget.h" + +#define C(x) ((char *) x) + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_hotkey_equal_ds") */ +/* *INDENT-OFF* */ +static const struct test_hotkey_equal_ds +{ + const hotkey_t hotkey1; + const hotkey_t hotkey2; + gboolean expected_result; +} test_hotkey_equal_ds[] = +{ + /* 0 */ + { + { .start = C ("abc"), .hotkey = NULL, .end = NULL }, + { .start = C ("abc"), .hotkey = NULL, .end = NULL }, + TRUE + }, + /* 1 */ + { + { .start = C (""), .hotkey = C (""), .end = C ("") }, + { .start = C (""), .hotkey = C (""), .end = C ("") }, + TRUE + }, + /* 2 */ + { + { .start = C ("abc"), .hotkey = C ("d"), .end = C ("efg") }, + { .start = C ("abc"), .hotkey = C ("d"), .end = C ("efg") }, + TRUE + }, + /* 3 */ + { + { .start = C ("abc"), .hotkey = NULL, .end = C ("efg") }, + { .start = C ("abc"), .hotkey = NULL, .end = C ("efg") }, + TRUE + }, + /* 4 */ + { + { .start = C ("abc"), .hotkey = C ("d"), .end = NULL }, + { .start = C ("abc"), .hotkey = C ("d"), .end = NULL }, + TRUE + }, + /* 5 */ + { + { .start = C ("abc"), .hotkey = C ("d"), .end = C ("efg") }, + { .start = C ("_bc"), .hotkey = C ("d"), .end = C ("efg") }, + FALSE + }, + /* 6 */ + { + { .start = C ("abc"), .hotkey = C ("d"), .end = C ("efg") }, + { .start = C ("abc"), .hotkey = C ("_"), .end = C ("efg") }, + FALSE + }, + /* 7 */ + { + { .start = C ("abc"), .hotkey = C ("d"), .end = C ("efg") }, + { .start = C ("abc"), .hotkey = C ("d"), .end = C ("_fg") }, + FALSE + }, + /* 8 */ + { + { .start = C ("abc"), .hotkey = C ("d"), .end = C ("efg") }, + { .start = C ("adc"), .hotkey = NULL, .end = C ("efg") }, + FALSE + }, + /* 9 */ + { + { .start = C ("abc"), .hotkey = C ("d"), .end = C ("efg") }, + { .start = C ("abc"), .hotkey = C ("d"), .end = NULL }, + FALSE + }, + /* 10 */ + { + { .start = C ("abc"), .hotkey = C ("d"), .end = C ("efg") }, + { .start = C ("abc"), .hotkey = NULL, .end = NULL }, + FALSE + } +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_hotkey_equal_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_hotkey_equal, + test_hotkey_equal_ds) +/* *INDENT-ON* */ +{ + /* given */ + gboolean result; + + /* when */ + result = hotkey_equal (data->hotkey1, data->hotkey2); + + /* then */ + ck_assert_int_eq (result, data->expected_result); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_hotkey_equal, test_hotkey_equal_ds); + /* *********************************** */ + + 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 new file mode 100644 index 0000000..9f64326 --- /dev/null +++ b/tests/lib/widget/widget_find_by_id.c @@ -0,0 +1,120 @@ +/* + libmc - checks for search widget with requested ID + + Copyright (C) 2020-2022 + The Free Software Foundation, Inc. + + Written by: + Andrew Borodin <aborodin@vmail.ru>, 2020-2022 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "lib/widget" + +#include <config.h> + +#include <check.h> + +#include "lib/widget.h" + +#include "tests/mctest.h" + +/* --------------------------------------------------------------------------------------------- */ + +/* *INDENT-OFF* */ +START_TEST (test_widget_find_by_id) +/* *INDENT-ON* */ +{ + WGroup *g, *g0; + Widget *w0; + WRect r; + + g = g_new0 (WGroup, 1); + rect_init (&r, 0, 0, 20, 20); + group_init (g, &r, NULL, NULL); /* ID = 0 */ + + g0 = g_new0 (WGroup, 1); + rect_init (&r, 0, 0, 10, 10); + group_init (g0, &r, NULL, NULL); /* ID = 1 */ + group_add_widget (g, g0); + + w0 = g_new0 (Widget, 1); + rect_init (&r, 0, 0, 5, 5); + widget_init (w0, &r, widget_default_callback, NULL); /* ID = 2 */ + group_add_widget (g0, w0); + + w0 = g_new0 (Widget, 1); + rect_init (&r, 5, 5, 5, 5); + widget_init (w0, &r, widget_default_callback, NULL); /* ID = 3 */ + group_add_widget (g0, w0); + + g0 = g_new0 (WGroup, 1); + rect_init (&r, 10, 10, 10, 10); + group_init (g0, &r, NULL, NULL); /* ID = 4 */ + group_add_widget (g, g0); + + w0 = g_new0 (Widget, 1); + rect_init (&r, 10, 10, 5, 5); + widget_init (w0, &r, widget_default_callback, NULL); /* ID = 5 */ + group_add_widget (g0, w0); + + w0 = g_new0 (Widget, 1); + rect_init (&r, 15, 15, 5, 5); + widget_init (w0, &r, widget_default_callback, NULL); /* ID = 6 */ + group_add_widget (g0, w0); + + w0 = g_new0 (Widget, 1); + rect_init (&r, 5, 5, 10, 10); + widget_init (w0, &r, widget_default_callback, NULL); /* ID = 7 */ + group_add_widget (g, w0); + + w0 = WIDGET (g); + + ck_assert_msg (widget_find_by_id (w0, 0) != NULL, "Not found ID=0"); + ck_assert_msg (widget_find_by_id (w0, 1) != NULL, "Not found ID=1"); + ck_assert_msg (widget_find_by_id (w0, 2) != NULL, "Not found ID=2"); + ck_assert_msg (widget_find_by_id (w0, 3) != NULL, "Not found ID=3"); + ck_assert_msg (widget_find_by_id (w0, 4) != NULL, "Not found ID=4"); + ck_assert_msg (widget_find_by_id (w0, 5) != NULL, "Not found ID=5"); + ck_assert_msg (widget_find_by_id (w0, 6) != NULL, "Not found ID=6"); + ck_assert_msg (widget_find_by_id (w0, 7) != NULL, "Not found ID=7"); + ck_assert_msg (widget_find_by_id (w0, 8) == NULL, "Found ID=8"); + + send_message (g, NULL, MSG_INIT, 0, NULL); + widget_destroy (w0); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + /* Add new tests here: *************** */ + tcase_add_test (tc_core, test_widget_find_by_id); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/widget/widget_make_global_local.c b/tests/lib/widget/widget_make_global_local.c new file mode 100644 index 0000000..9c24bf0 --- /dev/null +++ b/tests/lib/widget/widget_make_global_local.c @@ -0,0 +1,145 @@ +/* + libmc - checks for search widget with requested ID + + Copyright (C) 2021-2022 + The Free Software Foundation, Inc. + + Written by: + Andrew Borodin <aborodin@vmail.ru>, 2021-2022 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "lib/widget" + +#include <config.h> + +#include <check.h> + +#include "lib/widget.h" + +#include "tests/mctest.h" + +/* --------------------------------------------------------------------------------------------- */ + +/* *INDENT-OFF* */ +START_TEST (test_widget_make_global_local) +/* *INDENT-ON* */ +{ + WRect r; + WGroup *g0, *g1, *g2; + Widget *w0, *w1, *w2; + + /* top level group */ + g0 = g_new0 (WGroup, 1); + rect_init (&r, 20, 20, 40, 40); + group_init (g0, &r, NULL, NULL); + + /* g0 child */ + w0 = g_new0 (Widget, 1); + rect_init (&r, 1, 1, 5, 5); + widget_init (w0, &r, widget_default_callback, NULL); + group_add_widget (g0, w0); + + /* g0 child */ + g1 = g_new0 (WGroup, 1); + rect_init (&r, 5, 5, 30, 30); + group_init (g1, &r, NULL, NULL); + + /* g1 child */ + w1 = g_new0 (Widget, 1); + rect_init (&r, 5, 5, 10, 10); + widget_init (w1, &r, widget_default_callback, NULL); + group_add_widget (g1, w1); + + /* g1 child */ + g2 = g_new0 (WGroup, 1); + rect_init (&r, 15, 15, 20, 20); + group_init (g2, &r, NULL, NULL); + group_add_widget (g1, g2); + + /* g2 child */ + w2 = g_new0 (Widget, 1); + rect_init (&r, 15, 15, 5, 5); + widget_init (w2, &r, widget_default_callback, NULL); + group_add_widget (g2, w2); + + /* g0 child */ + group_add_widget (g0, g1); + + /* test global coordinates */ + /* w0 is a member of g0 */ + ck_assert_int_eq (w0->rect.y, 21); + ck_assert_int_eq (w0->rect.x, 21); + /* g1 is a member of g0 */ + ck_assert_int_eq (WIDGET (g1)->rect.y, 25); + ck_assert_int_eq (WIDGET (g1)->rect.x, 25); + /* w1 is a member of g1 */ + ck_assert_int_eq (w1->rect.y, 30); + ck_assert_int_eq (w1->rect.x, 30); + /* g2 is a member of g1 */ + ck_assert_int_eq (WIDGET (g2)->rect.y, 40); + ck_assert_int_eq (WIDGET (g2)->rect.x, 40); + /* w2 is a member of g2 */ + ck_assert_int_eq (w2->rect.y, 55); + ck_assert_int_eq (w2->rect.x, 55); + + group_remove_widget (w0); + group_remove_widget (g1); + + /* test local coordinates */ + /* w0 is not a member of g0 */ + ck_assert_int_eq (w0->rect.y, 1); + ck_assert_int_eq (w0->rect.x, 1); + + /* g1 is not a member of g0 */ + ck_assert_int_eq (WIDGET (g1)->rect.y, 5); + ck_assert_int_eq (WIDGET (g1)->rect.x, 5); + /* w1 is a member of g1 */ + ck_assert_int_eq (w1->rect.y, 10); + ck_assert_int_eq (w1->rect.x, 10); + /* g2 is not a member of g1 */ + ck_assert_int_eq (WIDGET (g2)->rect.y, 20); + ck_assert_int_eq (WIDGET (g2)->rect.x, 20); + /* w2 is a member of g2 */ + ck_assert_int_eq (w2->rect.y, 35); + ck_assert_int_eq (w2->rect.x, 35); + + widget_destroy (w0); + widget_destroy (WIDGET (g1)); + widget_destroy (WIDGET (g0)); +} +/* *INDENT-OFF* */ +END_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + /* Add new tests here: *************** */ + tcase_add_test (tc_core, test_widget_make_global_local); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/tests/lib/x_basename.c b/tests/lib/x_basename.c new file mode 100644 index 0000000..85d7f8f --- /dev/null +++ b/tests/lib/x_basename.c @@ -0,0 +1,128 @@ +/* + lib - x_basename() function testing + + Copyright (C) 2011-2022 + Free Software Foundation, Inc. + + Written by: + Slava Zanko <slavazanko@gmail.com>, 2011, 2013 + + This file is part of the Midnight Commander. + + The Midnight Commander is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#define TEST_SUITE_NAME "/lib" + +#include "tests/mctest.h" + +#include <stdio.h> + +#include "lib/strutil.h" +#include "lib/util.h" + +/* --------------------------------------------------------------------------------------------- */ + +/* @Before */ +static void +setup (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @After */ +static void +teardown (void) +{ +} + +/* --------------------------------------------------------------------------------------------- */ + +/* @DataSource("test_x_basename_ds") */ +/* *INDENT-OFF* */ +static const struct test_x_basename_ds +{ + const char *input_value; + const char *expected_result; +} test_x_basename_ds[] = +{ + { + "/test/path/test2/path2", + "path2" + }, + { + "/test/path/test2/path2#vfsprefix", + "path2#vfsprefix" + }, + { + "/test/path/test2/path2/vfsprefix://", + "path2/vfsprefix://" + }, + { + "/test/path/test2/path2/vfsprefix://subdir", + "subdir" + }, + { + "/test/path/test2/path2/vfsprefix://subdir/", + "subdir/" + }, + { + "/test/path/test2/path2/vfsprefix://subdir/subdir2", + "subdir2" + }, + { + "/test/path/test2/path2/vfsprefix:///", + "/" + }, +}; +/* *INDENT-ON* */ + +/* @Test(dataSource = "test_x_basename_ds") */ +/* *INDENT-OFF* */ +START_PARAMETRIZED_TEST (test_x_basename, test_x_basename_ds) +/* *INDENT-ON* */ +{ + /* given */ + const char *actual_result; + + /* when */ + actual_result = x_basename (data->input_value); + + /* then */ + mctest_assert_str_eq (actual_result, data->expected_result); +} +/* *INDENT-OFF* */ +END_PARAMETRIZED_TEST +/* *INDENT-ON* */ + +/* --------------------------------------------------------------------------------------------- */ + +int +main (void) +{ + TCase *tc_core; + + tc_core = tcase_create ("Core"); + + tcase_add_checked_fixture (tc_core, setup, teardown); + + /* Add new tests here: *************** */ + mctest_add_parameterized_test (tc_core, test_x_basename, test_x_basename_ds); + /* *********************************** */ + + return mctest_run_all (tc_core); +} + +/* --------------------------------------------------------------------------------------------- */ |