+2020-08-13 Colin Watson <cjwatson@debian.org>
+
+ Version: 1.5.3
+
+ * lib/Makefile.am (libpipeline_la_LDFLAGS): Bump -version-info to 6:3:5.
+
+2020-08-03 Colin Watson <cjwatson@debian.org>
+
+ Port tests to the modern Check API
+
+ Fixes Savannah bug #58883.
+
+ * configure.ac: Test for check >= 0.9.10.
+ * tests/argstr.c, tests/basic.c, tests/exec.c, tests/inspect.c,
+ tests/pump.c, tests/read.c, tests/redirect.c: Replace uses of
+ fail_unless and fail_if with appropriate ck_assert_* calls. In most
+ cases these now use more specific equality etc. tests rather than just
+ passing arbitrary predicates.
+ * README: Document updated dependency.
+ * NEWS: Document this.
+
+2020-07-05 Colin Watson <cjwatson@debian.org>
+
+ Fix handling of read/write errors
+
+ safe_read and safe_write return size_t and define SAFE_READ_ERROR and
+ SAFE_WRITE_ERROR as error return values. We had previously been
+ assigning their result to a signed value. As a result, whether
+ passthrough, pipeline_pump, and get_block would detect read/write errors
+ was implementation-defined.
+
+ * lib/pipeline.c (passthrough, get_block): Assign safe_read return value
+ to a size_t rather than a signed integer type, and check for
+ SAFE_READ_ERROR rather than negative values.
+ (pipeline_pump): Assign safe_write return value to a size_t rather than
+ an ssize_t, and check for SAFE_WRITE_ERROR rather than negative values.
+ * NEWS: Document this.
+
2020-01-01 Colin Watson <cjwatson@debian.org>
Version: 1.5.2
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir distdir-am dist dist-all distcheck
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
- $(LISP)config.h.in
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
+ config.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
+dist-zstd: distdir
+ tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
+ $(am__post_remove_distdir)
+
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
+ *.tar.zst*) \
+ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
am--refresh check check-am clean clean-cscope clean-generic \
clean-libtool cscope cscopelist-am ctags ctags-am dist \
dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \
- dist-tarZ dist-xz dist-zip distcheck distclean \
+ dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \
distclean-generic distclean-hdr distclean-libtool \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
+libpipeline 1.5.3 (13 August 2020)
+==================================
+
+Fix implementation-defined behaviour while handling read/write errors.
+
+Port tests to the modern Check API.
+
libpipeline 1.5.2 (1 January 2020)
==================================
order to run its test suite:
pkg-config (http://www.freedesktop.org/wiki/Software/pkg-config)
- check (http://check.sourceforge.net/)
+ check >= 0.9.10 (http://check.sourceforge.net/)
See the INSTALL file for general installation instructions.
-# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.2 -*- Autoconf -*-
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-dnl serial 11 (pkg-config-0.29)
-dnl
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 12 (pkg-config-0.29.2)
+
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
-[m4_define([PKG_MACROS_VERSION], [0.29])
+[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
-AC_MSG_CHECKING([for $1])
+AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
- AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
- else
+ else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
- AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
])
-# Copyright (C) 2002-2018 Free Software Foundation, Inc.
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.16.1], [],
+m4_if([$1], [1.16.2], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.16.1])dnl
+[AM_AUTOMAKE_VERSION([1.16.2])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-# Copyright (C) 2011-2018 Free Software Foundation, Inc.
+# Copyright (C) 2011-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+# Copyright (C) 1997-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
done
if test $am_rc -ne 0; then
AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
- for automatic dependency tracking. Try re-running configure with the
+ for automatic dependency tracking. If GNU make was not used, consider
+ re-running the configure script with MAKE="gmake" (or whatever is
+ necessary). You can also try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).])
fi
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2018 Free Software Foundation, Inc.
+# Copyright (C) 2003-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+# Copyright (C) 1997-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
rm -f conftest.file
])
-# Copyright (C) 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2009-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2018 Free Software Foundation, Inc.
+# Copyright (C) 2006-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2018 Free Software Foundation, Inc.
+# Copyright (C) 2004-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# Wrapper for Microsoft lib.exe
me=ar-lib
-scriptversion=2012-03-01.08; # UTC
+scriptversion=2019-07-04.01; # UTC
-# Copyright (C) 2010-2018 Free Software Foundation, Inc.
+# Copyright (C) 2010-2020 Free Software Foundation, Inc.
# Written by Peter Rosin <peda@lysator.liu.se>.
#
# This program is free software; you can redistribute it and/or modify
MINGW*)
file_conv=mingw
;;
- CYGWIN*)
+ CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
mingw)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin)
+ cygwin | msys)
file=`cygpath -m "$file" || echo "$file"`
;;
wine)
esac
done
else
- $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
- do
- $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
- done
+ $AR -NOLOGO -LIST "$archive" | tr -d '\r' | sed -e 's/\\/\\\\/g' \
+ | while read member
+ do
+ $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
+ done
fi
elif test -n "$quick$replace"; then
scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
MINGW*)
file_conv=mingw
;;
- CYGWIN*)
+ CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin/*)
+ cygwin/* | msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 2011-2018 Free Software Foundation, Inc.
+# Copyright (C) 2011-2020 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libpipeline 1.5.2.
+# Generated by GNU Autoconf 2.69 for libpipeline 1.5.3.
#
# Report bugs to <cjwatson@debian.org>.
#
# Identity of this package.
PACKAGE_NAME='libpipeline'
PACKAGE_TARNAME='libpipeline'
-PACKAGE_VERSION='1.5.2'
-PACKAGE_STRING='libpipeline 1.5.2'
+PACKAGE_VERSION='1.5.3'
+PACKAGE_STRING='libpipeline 1.5.3'
PACKAGE_BUGREPORT='cjwatson@debian.org'
PACKAGE_URL=''
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libpipeline 1.5.2 to adapt to many kinds of systems.
+\`configure' configures libpipeline 1.5.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libpipeline 1.5.2:";;
+ short | recursive ) echo "Configuration of libpipeline 1.5.3:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libpipeline configure 1.5.2
+libpipeline configure 1.5.3
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libpipeline $as_me 1.5.2, which was
+It was created by libpipeline $as_me 1.5.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='libpipeline'
- VERSION='1.5.2'
+ VERSION='1.5.3'
cat >>confdefs.h <<_ACEOF
fi
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CHECK" >&5
-$as_echo_n "checking for CHECK... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for check >= 0.9.10" >&5
+$as_echo_n "checking for check >= 0.9.10... " >&6; }
if test -n "$CHECK_CFLAGS"; then
pkg_cv_CHECK_CFLAGS="$CHECK_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.9.4\""; } >&5
- ($PKG_CONFIG --exists --print-errors "check >= 0.9.4") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.9.10\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "check >= 0.9.10") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_CHECK_CFLAGS=`$PKG_CONFIG --cflags "check >= 0.9.4" 2>/dev/null`
+ pkg_cv_CHECK_CFLAGS=`$PKG_CONFIG --cflags "check >= 0.9.10" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
pkg_cv_CHECK_LIBS="$CHECK_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.9.4\""; } >&5
- ($PKG_CONFIG --exists --print-errors "check >= 0.9.4") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.9.10\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "check >= 0.9.10") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_CHECK_LIBS=`$PKG_CONFIG --libs "check >= 0.9.4" 2>/dev/null`
+ pkg_cv_CHECK_LIBS=`$PKG_CONFIG --libs "check >= 0.9.10" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- CHECK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "check >= 0.9.4" 2>&1`
+ CHECK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "check >= 0.9.10" 2>&1`
else
- CHECK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "check >= 0.9.4" 2>&1`
+ CHECK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "check >= 0.9.10" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$CHECK_PKG_ERRORS" >&5
run_tests=no
elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
run_tests=no
else
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libpipeline $as_me 1.5.2, which was
+This file was extended by libpipeline $as_me 1.5.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libpipeline config.status 1.5.2
+libpipeline config.status 1.5.3
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Something went wrong bootstrapping makefile fragments
- for automatic dependency tracking. Try re-running configure with the
+ for automatic dependency tracking. If GNU make was not used, consider
+ re-running the configure script with MAKE=\"gmake\" (or whatever is
+ necessary). You can also try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).
See \`config.log' for more details" "$LINENO" 5; }
m4_pattern_forbid([^PIPELINE_])
# Initialise and check we're in the correct directory.
-AC_INIT([libpipeline], [1.5.2], [cjwatson@debian.org])
+AC_INIT([libpipeline], [1.5.3], [cjwatson@debian.org])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign])
AM_MAINTAINER_MODE
AM_PROG_AR
LT_INIT([disable-static])
AC_DEFINE_UNQUOTED([SHELL], ["$SHELL"], [A POSIX shell interpreter.])
-PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], [run_tests=yes], [run_tests=no])
+PKG_CHECK_MODULES([CHECK], [check >= 0.9.10], [run_tests=yes], [run_tests=no])
AM_CONDITIONAL([RUN_TESTS], [test "x$run_tests" = xyes])
# Check for various header files and associated libraries.
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
libpipeline_la_LDFLAGS = \
-export-symbols-regex '^(pipecmd|pipeline)_' \
-no-undefined \
- -version-info 6:2:5
+ -version-info 6:3:5
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libpipeline.pc
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
libpipeline_la_LDFLAGS = \
-export-symbols-regex '^(pipecmd|pipeline)_' \
-no-undefined \
- -version-info 6:2:5
+ -version-info 6:3:5
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libpipeline.pc
{
for (;;) {
char buffer[4096];
- int r = safe_read (STDIN_FILENO, buffer, 4096);
- if (r <= 0)
+ size_t r = safe_read (STDIN_FILENO, buffer, 4096);
+ if (r == SAFE_READ_ERROR)
+ /* TODO: Function commands have no way to signal
+ * errors.
+ */
+ break;
+ if (r == 0)
break;
if (full_write (STDOUT_FILENO, buffer,
(size_t) r) < (size_t) r)
for (i = 0; i < argc; ++i) {
const char *block;
size_t peek_size;
- ssize_t w;
+ size_t w;
size_t minpos;
if (!pieces[i]->source || pieces[i]->infd == -1)
w = safe_write (pieces[i]->infd,
block + pos[i],
peek_size - pos[i]);
- if (w >= 0)
+ if (w != SAFE_WRITE_ERROR)
break;
if (errno == EAGAIN) {
w = 0;
size_t readstart = 0, retstart = 0;
size_t space = p->bufmax;
size_t toread = *len;
- ssize_t r;
+ size_t r;
if (p->buffer && p->peek_offset) {
if (p->peek_offset >= toread) {
assert (p->outfd != -1);
r = safe_read (p->outfd, p->buffer + readstart, toread);
- if (r == -1)
+ if (r == SAFE_READ_ERROR)
return NULL;
p->buflen = readstart + r;
if (peek)
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
pipecmd *cmd;
cmd = pipecmd_new_argstr ("/bin/simple");
- fail_unless (!strcmp (cmd->name, "/bin/simple"));
- fail_unless (cmd->u.process.argc == 1);
- fail_unless (!strcmp (cmd->u.process.argv[0], "simple"));
+ ck_assert_str_eq (cmd->name, "/bin/simple");
+ ck_assert_int_eq (cmd->u.process.argc, 1);
+ ck_assert_str_eq (cmd->u.process.argv[0], "simple");
pipecmd_free (cmd);
}
END_TEST
cmd = pipecmd_new_argstr
("x' \\' \\$\\'\\\"\" \\'\\$\\\"\\\\ \" \\\"");
- fail_unless (!strcmp (cmd->name, "x \\"));
- fail_unless (cmd->u.process.argc == 3);
- fail_unless (!strcmp (cmd->u.process.argv[0], "x \\"));
- fail_unless (!strcmp (cmd->u.process.argv[1], "$'\" \\'$\"\\ "));
- fail_unless (!strcmp (cmd->u.process.argv[2], "\""));
+ ck_assert_str_eq (cmd->name, "x \\");
+ ck_assert_int_eq (cmd->u.process.argc, 3);
+ ck_assert_str_eq (cmd->u.process.argv[0], "x \\");
+ ck_assert_str_eq (cmd->u.process.argv[1], "$'\" \\'$\"\\ ");
+ ck_assert_str_eq (cmd->u.process.argv[2], "\"");
pipecmd_free (cmd);
}
END_TEST
pipecmd *cmd;
cmd = pipecmd_new_argstr ("exec /bin/foo bar");
- fail_unless (!strcmp (cmd->name, "/bin/foo"));
- fail_unless (cmd->u.process.argc == 2);
- fail_unless (!strcmp (cmd->u.process.argv[0], "foo"));
- fail_unless (!strcmp (cmd->u.process.argv[1], "bar"));
+ ck_assert_str_eq (cmd->name, "/bin/foo");
+ ck_assert_int_eq (cmd->u.process.argc, 2);
+ ck_assert_str_eq (cmd->u.process.argv[0], "foo");
+ ck_assert_str_eq (cmd->u.process.argv[1], "bar");
pipecmd_free (cmd);
}
END_TEST
pipeline *p;
p = pipeline_new_command_args ("true", (void *) 0);
- fail_unless (pipeline_run (p) == 0, "true did not return 0");
+ ck_assert_msg (pipeline_run (p) == 0, "true did not return 0");
p = pipeline_new_command_args ("false", (void *) 0);
- fail_if (pipeline_run (p) == 0, "false returned 0");
+ ck_assert_msg (pipeline_run (p) != 0, "false returned 0");
}
END_TEST
p = pipeline_new_command_args ("echo", "foo", (void *) 0);
pipeline_want_out (p, -1);
- fail_unless (pipecmd_get_nargs (pipeline_get_command (p, 0)) == 2,
- "Number of arguments != 2");
+ ck_assert_msg (pipecmd_get_nargs (pipeline_get_command (p, 0)) == 2,
+ "Number of arguments != 2");
pipeline_start (p);
line = pipeline_readline (p);
- fail_unless (line != NULL);
- fail_unless (!strcmp (line, "foo\n"),
- "Incorrect output from 'echo foo': '%s'", line);
- fail_unless (pipeline_wait (p) == 0, "'echo foo' did not return 0");
+ ck_assert_ptr_ne (line, NULL);
+ ck_assert_msg (!strcmp (line, "foo\n"),
+ "Incorrect output from 'echo foo': '%s'", line);
+ ck_assert_msg (pipeline_wait (p) == 0, "'echo foo' did not return 0");
pipeline_free (p);
p = pipeline_new_command_args ("echo", "foo", "bar", (void *) 0);
pipeline_want_out (p, -1);
- fail_unless (pipecmd_get_nargs (pipeline_get_command (p, 0)) == 3,
- "Number of arguments != 3");
+ ck_assert_msg (pipecmd_get_nargs (pipeline_get_command (p, 0)) == 3,
+ "Number of arguments != 3");
pipeline_start (p);
line = pipeline_readline (p);
- fail_unless (line != NULL);
- fail_unless (!strcmp (line, "foo bar\n"),
- "Incorrect output from 'echo foo bar': '%s'", line);
- fail_unless (pipeline_wait (p) == 0,
- "'echo foo bar' did not return 0");
+ ck_assert_ptr_ne (line, NULL);
+ ck_assert_msg (!strcmp (line, "foo bar\n"),
+ "Incorrect output from 'echo foo bar': '%s'", line);
+ ck_assert_msg (pipeline_wait (p) == 0,
+ "'echo foo bar' did not return 0");
pipeline_free (p);
}
END_TEST
pipeline_want_out (p, -1);
pipeline_start (p);
line = pipeline_readline (p);
- fail_unless (line != NULL);
- fail_unless (!strcmp (line, "bar\n"),
- "Incorrect output from 'echo foo | sed -e s/foo/bar/': "
- "'%s'", line);
- fail_unless (pipeline_wait (p) == 0,
- "'echo foo | sed -e 's/foo/bar/' did not return 0");
+ ck_assert_ptr_ne (line, NULL);
+ ck_assert_msg (!strcmp (line, "bar\n"),
+ "Incorrect output from 'echo foo | sed -e s/foo/bar/': "
+ "'%s'", line);
+ ck_assert_msg (pipeline_wait (p) == 0,
+ "'echo foo | sed -e 's/foo/bar/' did not return 0");
pipeline_free (p);
}
END_TEST
pipeline_command_args (p, SHELL, "-c", "exit 3", (void *) 0);
pipeline_command_args (p, "true", (void *) 0);
pipeline_start (p);
- fail_unless (pipeline_wait_all (p, &statuses, &n_statuses) == 127);
- fail_unless (n_statuses == 3);
- fail_unless (statuses[0] == 2 * 256);
- fail_unless (statuses[1] == 3 * 256);
- fail_unless (statuses[2] == 0);
+ ck_assert_int_eq (pipeline_wait_all (p, &statuses, &n_statuses), 127);
+ ck_assert_int_eq (n_statuses, 3);
+ ck_assert_int_eq (statuses[0], 2 * 256);
+ ck_assert_int_eq (statuses[1], 3 * 256);
+ ck_assert_int_eq (statuses[2], 0);
pipeline_free (p);
free (statuses);
}
p = pipeline_new_command_args (SHELL, "-c", "exit $TEST1", (void *) 0);
pipecmd_setenv (pipeline_get_command (p, 0), "TEST1", "10");
- fail_unless (pipeline_run (p) == 10, "TEST1 not set properly");
+ ck_assert_int_eq (pipeline_run (p), 10);
}
END_TEST
START_TEST (test_basic_unsetenv)
{
pipeline *p;
- const char *line;
setenv ("TEST2", "foo", 1);
p = pipeline_new_command_args (SHELL, "-c", "echo $TEST2", (void *) 0);
pipeline_want_out (p, -1);
pipeline_start (p);
- line = pipeline_readline (p);
- fail_unless (line != NULL);
- fail_unless (!strcmp (line, "foo\n"),
- "control returned '%s', expected 'foo\n'", line);
+ ck_assert_str_eq (pipeline_readline (p), "foo\n");
pipeline_wait (p);
pipeline_free (p);
pipecmd_unsetenv (pipeline_get_command (p, 0), "TEST2");
pipeline_want_out (p, -1);
pipeline_start (p);
- line = pipeline_readline (p);
- fail_unless (line != NULL);
- fail_unless (!strcmp (line, "\n"),
- "unsetenv failed: returned '%s', expected '\n'", line);
+ ck_assert_str_eq (pipeline_readline (p), "\n");
pipeline_wait (p);
pipeline_free (p);
}
START_TEST (test_basic_clearenv)
{
pipeline *p, *p2;
- const char *line1, *line2;
setenv ("TEST3", "foo", 1);
(void *) 0);
pipeline_want_out (p, -1);
pipeline_start (p);
- line1 = pipeline_readline (p);
- fail_unless (line1 != NULL);
- fail_unless (!strcmp (line1, "foo\n"),
- "control returned first line '%s', expected 'foo\n'",
- line1);
- line2 = pipeline_readline (p);
- fail_unless (line2 != NULL);
- fail_unless (!strcmp (line2, "\n"),
- "control returned second line '%s', expected '\n'",
- line2);
+ ck_assert_str_eq (pipeline_readline (p), "foo\n");
+ ck_assert_str_eq (pipeline_readline (p), "\n");
pipeline_wait (p);
pipecmd_clearenv (pipeline_get_command (p, 0));
pipeline_start (p);
- line1 = pipeline_readline (p);
- fail_unless (line1 != NULL);
- fail_unless (!strcmp (line1, "\n"),
- "clearenv failed: returned first line '%s', expected '\n'",
- line1);
- line2 = pipeline_readline (p);
- fail_unless (line2 != NULL);
- fail_unless (!strcmp (line2, "\n"),
- "clearenv returned second line '%s', expected '\n'",
- line2);
+ ck_assert_str_eq (pipeline_readline (p), "\n");
+ ck_assert_str_eq (pipeline_readline (p), "\n");
pipeline_wait (p);
pipecmd_setenv (pipeline_get_command (p, 0), "TEST4", "bar");
pipeline_start (p);
- line1 = pipeline_readline (p);
- fail_unless (line1 != NULL);
- fail_unless (!strcmp (line1, "\n"),
- "clearenv+setenv failed: returned first line '%s', expected '\n'",
- line1);
- line2 = pipeline_readline (p);
- fail_unless (line2 != NULL);
- fail_unless (!strcmp (line2, "bar\n"),
- "clearenv+setenv returned second line '%s', expected 'bar\n'",
- line2);
+ ck_assert_str_eq (pipeline_readline (p), "\n");
+ ck_assert_str_eq (pipeline_readline (p), "bar\n");
pipeline_wait (p);
p2 = pipeline_new ();
pipeline_command (p2, pipecmd_dup (pipeline_get_command (p, 0)));
pipeline_want_out (p2, -1);
pipeline_start (p2);
- line1 = pipeline_readline (p2);
- fail_unless (line1 != NULL);
- fail_unless (!strcmp (line1, "\n"),
- "clearenv+setenv+dup failed: returned first line '%s', expected '\n'",
- line1);
- line2 = pipeline_readline (p2);
- fail_unless (line2 != NULL);
- fail_unless (!strcmp (line2, "bar\n"),
- "clearenv+setenv+dup returned second line '%s', expected 'bar\n'",
- line2);
+ ck_assert_str_eq (pipeline_readline (p2), "\n");
+ ck_assert_str_eq (pipeline_readline (p2), "bar\n");
pipeline_wait (p2);
pipeline_free (p2);
pipeline_free (p);
pipeline_want_out (p, -1);
pipeline_start (p);
raw_line = xstrdup (pipeline_readline (p));
- fail_unless (raw_line != NULL);
+ ck_assert_ptr_ne (raw_line, NULL);
line = xstrdup (raw_line);
end = line + strlen (line);
if (end > line && *(end - 1) == '\n')
*(end - 1) = '\0';
child_base = base_name (line);
expected_base = base_name (temp_dir);
- fail_unless (!strcmp (child_base, expected_base),
- "child base name was '%s', expected '%s'",
- child_base, expected_base);
+ ck_assert_str_eq (child_base, expected_base);
free (expected_base);
free (child_base);
free (line);
p = pipeline_new_command_args ("pwd", (void *) 0);
temp_dir_fd = open (temp_dir, O_RDONLY | O_DIRECTORY);
- fail_unless (temp_dir_fd >= 0);
+ ck_assert_int_ge (temp_dir_fd, 0);
pipecmd_fchdir (pipeline_get_command (p, 0), temp_dir_fd);
pipeline_want_out (p, -1);
pipeline_start (p);
raw_line = xstrdup (pipeline_readline (p));
- fail_unless (raw_line != NULL);
+ ck_assert_ptr_ne (raw_line, NULL);
line = xstrdup (raw_line);
end = line + strlen (line);
if (end > line && *(end - 1) == '\n')
*(end - 1) = '\0';
child_base = base_name (line);
expected_base = base_name (temp_dir);
- fail_unless (!strcmp (child_base, expected_base),
- "child base name was '%s', expected '%s'",
- child_base, expected_base);
+ ck_assert_str_eq (child_base, expected_base);
free (expected_base);
free (child_base);
free (line);
p = pipeline_new_command_args (SHELL, "-c", "exit $TEST1", (void *) 0);
pipecmd_pre_exec (pipeline_get_command (p, 0), pre_exec, NULL, NULL);
- fail_unless (pipeline_run (p) == 10, "TEST1 not set properly");
+ ck_assert_msg (pipeline_run (p) == 10, "TEST1 not set properly");
}
END_TEST
{
pipeline *p;
pipecmd *cmd1, *cmd2, *cmd3, *seq;
- const char *line;
p = pipeline_new ();
cmd1 = pipecmd_new_args ("echo", "foo", (void *) 0);
pipeline_command_args (p, "xargs", (void *) 0);
pipeline_want_out (p, -1);
pipeline_start (p);
- line = pipeline_readline (p);
- fail_unless (line != NULL);
- fail_unless (!strcmp (line, "foo bar baz\n"));
+ ck_assert_str_eq (pipeline_readline (p), "foo bar baz\n");
pipeline_wait (p);
pipeline_free (p);
}
return;
}
- fail_unless (WIFEXITED (status));
+ ck_assert_int_ne (WIFEXITED (status), 0);
if (i < 2)
- fail_unless (WEXITSTATUS (status) == i);
+ ck_assert_int_eq (WEXITSTATUS (status), i);
else
- fail_if (WEXITSTATUS (status) == 0);
+ ck_assert_int_ne (WEXITSTATUS (status), 0);
pipecmd_free (cmd);
}
return;
}
- fail_unless (WIFEXITED (status));
- fail_unless (WEXITSTATUS (status) == i);
+ ck_assert_int_ne (WIFEXITED (status), 0);
+ ck_assert_int_eq (WEXITSTATUS (status), i);
pipecmd_free (cmd);
}
cmd = pipecmd_new ("foo");
str = pipecmd_tostring (cmd);
- fail_unless (!strcmp (str, "foo"));
+ ck_assert_str_eq (str, "foo");
free (str);
pipecmd_free (cmd);
cmd = pipecmd_new_args ("foo", "bar", "baz quux", (void *) 0);
str = pipecmd_tostring (cmd);
/* TODO: not ideal representation of commands with metacharacters */
- fail_unless (!strcmp (str, "foo bar baz quux"));
+ ck_assert_str_eq (str, "foo bar baz quux");
free (str);
pipecmd_free (cmd);
}
p = pipeline_new ();
pipeline_command_args (p, "foo", "bar", (void *) 0);
pipeline_command_args (p, "grep", "baz", "quux", (void *) 0);
- fail_unless (pipeline_get_ncommands (p) == 2);
+ ck_assert_int_eq (pipeline_get_ncommands (p), 2);
pipecmd_setenv (pipeline_get_command (p, 1), "KEY", "value");
str = pipeline_tostring (p);
- fail_unless (!strcmp (str, "foo bar | KEY=value grep baz quux"));
+ ck_assert_str_eq (str, "foo bar | KEY=value grep baz quux");
free (str);
pipeline_free (p);
}
pipeline_want_out (p, -1);
pipeline_start (p);
line = pipeline_readline (p);
- fail_unless (line != NULL);
+ ck_assert_ptr_ne (line, NULL);
pid = (pid_t) atol (line);
- fail_unless (pid == pipeline_get_pid (p, 0), "pids match");
+ ck_assert_msg (pid == pipeline_get_pid (p, 0), "pids match");
/* Note that this test may hang if pipeline_get_pid does not work.
* We might be able to fix this by calling setsid at the start of
* the test and then killing the process group, but I'm not sure if
kill (pid, SIGTERM);
status = pipeline_wait (p);
- fail_unless (status == 128 + SIGTERM,
- "pid_helper did not indicate SIGTERM");
+ ck_assert_msg (status == 128 + SIGTERM,
+ "pid_helper did not indicate SIGTERM");
}
pipeline_free (p);
}
const char *program_name = "pump";
-static void fail_unless_files_equal (const char *left, const char *right)
+static void assert_files_equal (const char *left, const char *right)
{
pipeline *diff = pipeline_new_command_args
("diff", "-u", left, right, (void *) 0);
- int ret = pipeline_run (diff);
- fail_unless (ret == 0);
+ ck_assert_int_eq (pipeline_run (diff), 0);
}
START_TEST (test_pump_connect_attaches_correctly)
pipeline *three = pipeline_new ();
pipeline_connect (one, two, three, (void *) 0);
- fail_unless (one->redirect_out == REDIRECT_FD);
- fail_unless (one->want_out < 0);
- fail_unless (one->want_outfile == NULL);
- fail_unless (two->source == one);
- fail_unless (two->redirect_in == REDIRECT_FD);
- fail_unless (two->want_in < 0);
- fail_unless (two->want_infile == NULL);
- fail_unless (three->source == one);
- fail_unless (three->redirect_in == REDIRECT_FD);
- fail_unless (three->want_in < 0);
- fail_unless (three->want_infile == NULL);
+ ck_assert_int_eq (one->redirect_out, REDIRECT_FD);
+ ck_assert_int_le (one->want_out, 0);
+ ck_assert_ptr_eq (one->want_outfile, NULL);
+ ck_assert_ptr_eq (two->source, one);
+ ck_assert_int_eq (two->redirect_in, REDIRECT_FD);
+ ck_assert_int_le (two->want_in, 0);
+ ck_assert_ptr_eq (two->want_infile, NULL);
+ ck_assert_ptr_eq (three->source, one);
+ ck_assert_int_eq (three->redirect_in, REDIRECT_FD);
+ ck_assert_int_le (three->want_in, 0);
+ ck_assert_ptr_eq (three->want_infile, NULL);
pipeline_free (three);
pipeline_free (two);
pipeline_want_outfile (sink_function, function_outfile);
pipeline_connect (source, sink_process, sink_function, (void *) 0);
pipeline_pump (source, sink_process, sink_function, (void *) 0);
- fail_unless (pipeline_wait (source) == 0, "source did not return 0");
- fail_unless (pipeline_wait (sink_process) == 0,
- "process sink did not return 0");
- fail_unless (pipeline_wait (sink_function) == 0,
- "function sink did not return 0");
- fail_unless_files_equal (process_outfile, function_outfile);
+ ck_assert_int_eq (pipeline_wait (source), 0);
+ ck_assert_int_eq (pipeline_wait (sink_process), 0);
+ ck_assert_int_eq (pipeline_wait (sink_function), 0);
+ assert_files_equal (process_outfile, function_outfile);
free (function_outfile);
free (process_outfile);
}
}
pipeline_free (p);
- fail_unless (!strcmp (read_result, expected_output),
- "Returned string doesn't match the input.");
+ ck_assert_str_eq (read_result, expected_output);
free (read_result);
read_result = NULL;
}
}
pipeline_free (p);
- fail_unless (!strcmp (read_result, expected_output),
- "Returned string doesn't match the input.");
+ ck_assert_str_eq (read_result, expected_output);
free (testfile);
free (expected_output);
{
pipeline *p;
pipecmd *cmd;
- const char *line;
p = pipeline_new ();
cmd = pipecmd_new_function ("slow_line_helper", slow_line_helper,
pipeline_command (p, cmd);
pipeline_want_out (p, -1);
pipeline_start (p);
- line = pipeline_readline (p);
- fail_unless (!strcmp (line, "a line\n"));
+ ck_assert_str_eq (pipeline_readline (p), "a line\n");
pipeline_free (p);
}
END_TEST
int fd;
FILE *fh;
pipeline *p;
- const char *line;
fd = mkstemp (template);
if (fd < 0) {
pipeline_want_infile (p, template);
pipeline_want_out (p, -1);
pipeline_start (p);
- line = pipeline_readline (p);
- fail_unless (line != NULL);
- fail_unless (!strcmp (line, "test data out\n"));
+ ck_assert_str_eq (pipeline_readline (p), "test data out\n");
fclose (fh);
unlink (template);
p = pipeline_new_command_args ("echo", "test", (void *) 0);
outfile = xasprintf ("%s/test", temp_dir);
pipeline_want_outfile (p, outfile);
- fail_unless (pipeline_run (p) == 0);
+ ck_assert_int_eq (pipeline_run (p), 0);
fh = fopen (outfile, "r");
- fail_unless (fh != NULL);
- fail_unless (fgets (line, 5, fh) != NULL);
- fail_unless (!strcmp (line, "test"));
+ ck_assert_ptr_ne (fh, NULL);
+ ck_assert_ptr_ne (fgets (line, 5, fh), NULL);
+ ck_assert_str_eq (line, "test");
fclose (fh);
free (outfile);