From f5a1646ba63fbe813a917e2ecfd892ae1bdc14d1 Mon Sep 17 00:00:00 2001 From: Daniel Markstedt Date: Sat, 1 Nov 2025 14:09:54 +0100 Subject: [PATCH] remove autotools macros and supporting files The meson build system capabilities in this project have now met or surpassed autotools, so to avoid the maintenance overhead and/or bitrot of the latter, we will remove it and make meson the only option moving forward --- .gitignore | 61 ----------------------- Makefile.am | 55 --------------------- README.md | 45 +++++++---------- bstring.pc.in | 12 ----- configure.ac | 85 -------------------------------- m4/cflags.m4 | 46 ------------------ m4/check.mk | 16 ------- m4/doxygen.m4 | 24 ---------- m4/doxygen.mk | 28 ----------- m4/gdb.m4 | 27 ----------- m4/gdb.mk | 22 --------- m4/ldflags.m4 | 49 ------------------- m4/valgrind.m4 | 27 ----------- m4/valgrind.mk | 128 ------------------------------------------------- 14 files changed, 17 insertions(+), 608 deletions(-) delete mode 100644 .gitignore delete mode 100644 Makefile.am delete mode 100644 bstring.pc.in delete mode 100644 configure.ac delete mode 100644 m4/cflags.m4 delete mode 100644 m4/check.mk delete mode 100644 m4/doxygen.m4 delete mode 100644 m4/doxygen.mk delete mode 100644 m4/gdb.m4 delete mode 100644 m4/gdb.mk delete mode 100644 m4/ldflags.m4 delete mode 100644 m4/valgrind.m4 delete mode 100644 m4/valgrind.mk diff --git a/.gitignore b/.gitignore deleted file mode 100644 index ca3f3f9..0000000 --- a/.gitignore +++ /dev/null @@ -1,61 +0,0 @@ -*.Plo -*.Po -*.[oa] -*.la -*.lai -*.lo -*.pc -*.pyc -*.so* -*.swo -*.swp -*~ -.deps -.dirstamp -.libs -/compile -/config.h.in -Doxyfile -Makefile -Makefile.in -_build -aclocal.m4 -autom4te.cache -bstring-*.sha256sum -bstring-*.tar.gz -build -config.cache -config.guess -config.h -config.log -config.status -config.sub -configure -cscope.files -cscope.out -depcomp -doc/html -install-sh -libtool -ltmain.sh -m4/libtool.m4 -m4/lt*.m4 -missing -stamp-h1 -tags -test-driver -test-suite.log -tests/bstest -tests/bstest.log -tests/bstest.trs -tests/cpptest -tests/cpptest.log -tests/cpptest.trs -tests/test -tests/test-suite.log -tests/test.log -tests/test.trs -tests/testaux -tests/testaux.log -tests/testaux.trs -vgcore.* diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 83b03bc..0000000 --- a/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ -# -*- Automake -*- -# Process this file with automake to produce Makefile.in. - -ACLOCAL_AMFLAGS = -I m4 - -AM_CFLAGS = -I$(top_srcdir)/bstring - -lib_LTLIBRARIES = bstring/libbstring.la - -bstring_libbstring_la_SOURCES = \ - bstring/bstraux.c \ - bstring/bstrlib.c -bstring_libbstring_la_LDFLAGS = \ - -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) - -# install development headers -pkgincludedir = $(includedir)/bstring -pkginclude_HEADERS = \ - bstring/bstraux.h \ - bstring/bstrlib.h - -if HAVE_CHECK -TESTS = $(check_PROGRAMS) -check_PROGRAMS = \ - tests/bstest \ - tests/testaux - -tests_bstest_SOURCES = tests/bstest.c -tests_bstest_CFLAGS = -I$(top_srcdir)/bstring $(CHECK_CFLAGS) -tests_bstest_LDFLAGS = $(CHECK_LIBS) -tests_bstest_LDADD = bstring/libbstring.la - -tests_testaux_SOURCES = tests/testaux.c -tests_testaux_CFLAGS = -I$(top_srcdir)/bstring $(CHECK_CFLAGS) -tests_testaux_LDFLAGS = $(CHECK_LIBS) -tests_testaux_LDADD = bstring/libbstring.la -endif - -# Documentation setup -DOXYGEN_DOXYFILE = $(top_srcdir)/doc/Doxyfile -include $(top_srcdir)/m4/doxygen.mk - -# Test targets -include $(top_srcdir)/m4/valgrind.mk -include $(top_srcdir)/m4/check.mk -include $(top_srcdir)/m4/gdb.mk - -# Install pkg-config scripts -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = bstring.pc - -release: dist - $(AM_V_GEN)sha256sum $(DIST_ARCHIVES) > $(PACKAGE)-$(VERSION).sha256sum - -EXTRA_DIST = doc README.md diff --git a/README.md b/README.md index 0fbe6c3..f42374a 100644 --- a/README.md +++ b/README.md @@ -11,20 +11,24 @@ as a memory safe alternative to null terminated buffers. This is a fork of Paul Hsieh's [Better String Library][]. The following features (or mis-features, depending on your point of view) are included: -1. Build system (Meson and Autotools) +1. Build system ([Meson][]+[Ninja][]) 2. Updated test suite based on [Check][] 3. Add memory profiling with [Valgrind][] to the workflow 4. Add continuous integration via GitHub Actions 5. Remove C++ wrapper code, returning this to a pure C library -6. Other various improvements +6. Documentation generation with [Doxygen][] +7. Other various code quality and reliability improvements Currently this fork should be binary-compatible with the original code. The only source incompatibility is the removal of the `const_bstring` type. Just use `const bstring` instead. [Better String Library]: http://bstring.sourceforge.net/ +[Meson]: https://mesonbuild.com/ +[Ninja]: https://ninja-build.org/ [Check]: https://github.com/libcheck/check [Valgrind]: http://valgrind.org/ +[Doxygen]: https://www.doxygen.nl/ ## Get bstring @@ -39,20 +43,22 @@ The current packaging status as reported by repology.org: ## Building -The repository currently includes [Meson][]+[Ninja][] and Autotools ([Autoconf][], -[Automake][], and [Libtool][]) build systems. +The repository currently includes a [Meson][]+[Ninja][] build system. -[Meson]: https://mesonbuild.com/ -[Ninja]: https://ninja-build.org/ -[Autoconf]: https://www.gnu.org/software/autoconf/ -[Automake]: https://www.gnu.org/software/automake/ -[Libtool]: https://www.gnu.org/software/libtool/ +The library itself doesn't have any dependencies beyond a C compiler, +but the test suite requires the [Check][] unit testing framework, +while the documentation generation requires [Doxygen][]. -### Meson +Configure the `build` directory with Meson. -To build with Meson: + $ meson setup build + +Alternatively, enable building the documentation and test suite. $ meson setup build -Denable-docs=true -Denable-tests=true + +Then compile and install. + $ meson compile -C build $ sudo meson install -C build @@ -64,23 +70,6 @@ If Valgrind is installed the test suite can be checked for memory leaks. $ meson test --wrapper='valgrind --leak-check=full --error-exitcode=1' -C build -### Autotools - -To build with Autotools: - - $ autoreconf -i - $ ./configure - $ make - $ make install - -A test suite is available if Check is is installed. - - $ make check - -If Valgrind is installed the test suite can be checked for memory leaks. - - $ make memcheck - ## Documentation The original documentation has been migrated into the header files and diff --git a/bstring.pc.in b/bstring.pc.in deleted file mode 100644 index 79e96c4..0000000 --- a/bstring.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/bstring - -Name: Bstring -Description: The Better String Library -Version: @VERSION@ -Requires: -Requires.private: -Libs: -L${libdir} -lbstring -CFlags: -I${includedir} diff --git a/configure.ac b/configure.ac deleted file mode 100644 index a581e08..0000000 --- a/configure.ac +++ /dev/null @@ -1,85 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - -# Initialize autoconf -AC_PREREQ([2.72]) - -# Library versioning -# Making releases: -# micro_version += 1 -# interface_age += 1 -# If functions have been added or backward-compatibility has been broken: -# interface_age = 0 -m4_define([major_version], [1]) -m4_define([minor_version], [0]) -m4_define([micro_version], [3]) -m4_define([interface_age], [1]) - -# Initialize autoconf & automake -AC_INIT([Bstring], [major_version.minor_version.micro_version], - [https://github.com/msteinert/bstring/issues], [bstring]) -AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([1.9 subdir-objects foreign -Wno-portability]) -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -AC_CONFIG_SRCDIR([bstring/bstrlib.h]) - -# Initialize Libtool -LT_PREREQ([2.2]) -LT_INIT - -# Check the build environment -AC_PROG_CC -AX_PROG_VALGRIND -AX_PROG_DOXYGEN -AX_PROG_GDB - -# OS-specific settings -AS_CASE([$host_os], -[darwin*], - [VALGRIND_FLAGS="--dsymutil=yes"] -) - -# Enable C compiler flags -AX_TRY_CFLAGS([-Wall], [AX_CFLAGS([-Wall])]) -AX_TRY_CFLAGS([-Wextra], [AX_CFLAGS([-Wextra])]) -AX_TRY_CFLAGS([-pedantic], [AX_CFLAGS([-pedantic])]) -AX_TRY_CFLAGS([-Wstrict-prototypes], [AX_CFLAGS([-Wstrict-prototypes])]) -AX_TRY_CFLAGS([-Wcast-align], [AX_CFLAGS([-Wcast-align])]) -AX_TRY_CFLAGS([-fno-common], [AX_CFLAGS([-fno-common])]) -AX_TRY_CFLAGS([-fvisibility=hidden], [AX_CFLAGS([-fvisibility=hidden])]) -AX_TRY_LDFLAGS([-Wl,--no-undefined], [AX_LDFLAGS([-Wl,--no-undefined])]) - -# Libtool versioning -LT_CURRENT=m4_eval(100 * minor_version + micro_version - interface_age) -LT_REVISION=interface_age -LT_AGE=m4_eval(m4_eval(100 * minor_version + micro_version) - interface_age) -AC_SUBST([LT_CURRENT]) -AC_SUBST([LT_REVISION]) -AC_SUBST([LT_AGE]) - -# Setup unit-test environment -PKG_CHECK_MODULES([CHECK], [check >= 0.9], - [have_check=yes - VALGRIND_ENVIRONMENT="CK_FORK=no" - GDB_ENVIRONMENT="CK_FORK=no" - # Some versions of the Check header file use - # GNU-style token pasting. - AX_TRY_CFLAGS([-Wno-gnu], - [CHECK_CFLAGS="$CHECK_CFLAGS -Wno-gnu"])], - [have_check=no - AC_MSG_WARN([Unable to run unit tests.])]) -AM_CONDITIONAL([HAVE_CHECK], [test "x$have_check" = "xyes"]) - -# Output files & status -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([ - bstring.pc - doc/Doxyfile - Makefile -]) -AC_OUTPUT -AC_MSG_RESULT([ -$PACKAGE_NAME build options: - Host: $host - Version: $VERSION -]) diff --git a/m4/cflags.m4 b/m4/cflags.m4 deleted file mode 100644 index 96cdff8..0000000 --- a/m4/cflags.m4 +++ /dev/null @@ -1,46 +0,0 @@ -# cflags.m4 - Test and set compiler flags -# -# Copyright 2011 Michael Steinert -# -# This file is free software; the copyright holder(s) give unlimited -# permission to copy and/or distribute it, with or without modifications, -# as long as this notice is preserved. - -#serial 1 - -# AX_TRY_CFLAGS(FLAG, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# -------------------------------------------------------- -# Test a compiler flag is supported. -# FLAG: a compiler flag to try -# ACTION-IF-TRUE: commands to execute if FLAG is supported -# ACTION-IF-FALSE: commands to execute if FLAG is not supported -AC_DEFUN([AX_TRY_CFLAGS], -[dnl -AC_REQUIRE([AC_PROG_CC]) -_ax_cflags=$CFLAGS -CFLAGS="$1 $CFLAGS" -AC_MSG_CHECKING([if compiler accepts '$1']) -AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([int main(int,char**){return 0;}])], - [AC_MSG_RESULT([yes]) - CFLAGS=$_ax_cflags - $2], - [AC_MSG_RESULT([no]) - CFLAGS=$_ax_cflags - $3]) -])dnl - -# AX_CFLAGS(FLAGS) -# ---------------- -# Enable compiler flags. -# FLAGS: a whitespace-separated list of compiler flags to set -AC_DEFUN([AX_CFLAGS], -[dnl -m4_foreach_w([_ax_flag], [$1], - [AS_CASE([" $CFLAGS "], - [*[[\ \ ]]_ax_flag[[\ \ ]]*], - [], - [*], - [CFLAGS="$CFLAGS _ax_flag"]) - ])dnl -])dnl diff --git a/m4/check.mk b/m4/check.mk deleted file mode 100644 index 2527de7..0000000 --- a/m4/check.mk +++ /dev/null @@ -1,16 +0,0 @@ -# check.mk - Provides the "%.check" target -# -# Copyright 1994-2012 Free Software Foundation, Inc. -# Copyright 2012 Michael Steinert -# -# This file is free software; the copyright holder 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. - -%.check: % - $(AM_V_at)$(TESTS_ENVIRONMENT) $* diff --git a/m4/doxygen.m4 b/m4/doxygen.m4 deleted file mode 100644 index 0766286..0000000 --- a/m4/doxygen.m4 +++ /dev/null @@ -1,24 +0,0 @@ -# gdb.m4 - Check for Doxygen. -# -# Copyright 2013 Michael Steinert -# -# This file is free software; the copyright holder 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. - -#serial 1 - -# AX_PROG_DOXYGEN -# --------------- -# Setup Doxygen and the "html" target. -AC_DEFUN([AX_PROG_DOXYGEN], -[dnl - AC_ARG_VAR([DOXYGEN_PATH], [Path to the Doxygen executable.]) - AC_CHECK_PROGS([DOXYGEN_PATH], [doxygen], [:]) - AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$DOXYGEN_PATH" != "x:"]) -])dnl diff --git a/m4/doxygen.mk b/m4/doxygen.mk deleted file mode 100644 index f9f8e35..0000000 --- a/m4/doxygen.mk +++ /dev/null @@ -1,28 +0,0 @@ -# doxygen.mk - Provides the "html" target -# -# Copyright 2013 Michael Steinert -# -# This file is free software; the copyright holder 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. - -if HAVE_DOXYGEN - -DOXYGEN_DOXYFILE ?= Doxyfile - -AX_V_doxygen = $(ax__v_doxygen_$(V)) -ax__v_doxygen_ = $(ax__v_doxygen_$(AM_DEFAULT_VERBOSITY)) -ax__v_doxygen_0 = @echo " DOX " $<; -ax__v_doxygen_1 = - -DOXYGEN = $(DOXYGEN_PATH) $(DOXYGEN_DOXYFILE) - -html-local: $(DOXYGEN_DOXYFILE) - $(AX_V_doxygen)$(DOXYGEN) - -endif diff --git a/m4/gdb.m4 b/m4/gdb.m4 deleted file mode 100644 index 0443b12..0000000 --- a/m4/gdb.m4 +++ /dev/null @@ -1,27 +0,0 @@ -# gdb.m4 - Check for GDB. -# -# Copyright 2012 Michael Steinert -# -# This file is free software; the copyright holder 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. - -#serial 1 - -# AX_PROG_GDB -# ----------- -# Setup GDB and the "%.debug" target. -AC_DEFUN([AX_PROG_GDB], -[dnl - AC_ARG_VAR([GDB_PATH], [Path to the GDB executable.]) - AC_ARG_VAR([GDB_FLAGS], [Flags for GDB.]) - AC_ARG_VAR([GDB_ENVIRONMENT], - [Environment variables for GDB.]) - AC_CHECK_PROGS([GDB_PATH], [gdb], [:]) - AM_CONDITIONAL([HAVE_GDB], [test "x$GDB_PATH" != "x:"]) -])dnl diff --git a/m4/gdb.mk b/m4/gdb.mk deleted file mode 100644 index ecf1bce..0000000 --- a/m4/gdb.mk +++ /dev/null @@ -1,22 +0,0 @@ -# gdb.mk - Provides the "%.debug" target(s) -# -# Copyright 2012 Michael Steinert -# -# This file is free software; the copyright holder 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. - -if HAVE_GDB - -GDB = $(GDB_ENVIRONMENT) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=execute $(GDB_PATH) $(GDB_FLAGS) - -%.debug: % - $(AM_V_at)$(GDB) $* - -endif diff --git a/m4/ldflags.m4 b/m4/ldflags.m4 deleted file mode 100644 index 6085b37..0000000 --- a/m4/ldflags.m4 +++ /dev/null @@ -1,49 +0,0 @@ -# ldflags.m4 - Test and set linker flags -# -# Copyright 2011, 2012 Michael Steinert -# -# This file is free software; the copyright holder 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. - -#serial 1 - -# AX_TRY_LDFLAGS(FLAG, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# --------------------------------------------------------- -# Test if a linker flag is supported. -# FLAG: a linker flag to try -# ACTION-IF-TRUE: commands to execute if FLAG is supported -# ACTION-IF-FALSE: commands to execute if FLAG is not supported -AC_DEFUN([AX_TRY_LDFLAGS], -[dnl -_ax_ldflags=$LDFLAGS -LDFLAGS="$1 $LDFLAGS" -AC_MSG_CHECKING([if linker accepts '$1']) -AC_LINK_IFELSE( - [AC_LANG_SOURCE([int main(int,char**){return 0;}])], - [AC_MSG_RESULT([yes]) - LDFLAGS=$_ax_ldflags - $2], - [AC_MSG_RESULT([no]) - LDFLAGS=$_ax_ldflags - $3]) -])dnl - -# AX_LDFLAGS(flags) -# ----------------- -# Enable linker flags. -# FLAGS: a whitespace-separated list of linker flags to set -AC_DEFUN([AX_LDFLAGS], -[dnl -m4_foreach_w([_ax_flag], [$1], - [AS_CASE([" $LDFLAGS "], - [*[[\ \ ]]_ax_flag[[\ \ ]]*], - [], - [*], - [LDFLAGS="$LDFLAGS _ax_flag"])]) -])dnl diff --git a/m4/valgrind.m4 b/m4/valgrind.m4 deleted file mode 100644 index 0f3f044..0000000 --- a/m4/valgrind.m4 +++ /dev/null @@ -1,27 +0,0 @@ -# valgrind.m4 - Check for Valgrind. -# -# Copyright 2012, 2013 Michael Steinert -# -# This file is free software; the copyright holder 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. - -#serial 1 - -# AX_PROG_VALGRIND -# ---------------- -# Setup Valgrind and the "memcheck" target(s). -AC_DEFUN([AX_PROG_VALGRIND], -[dnl - AC_ARG_VAR([VALGRIND_PATH], [Path to the Valgrind executable.]) - AC_ARG_VAR([VALGRIND_FLAGS], [Flags for Valgrind.]) - AC_ARG_VAR([VALGRIND_ENVIRONMENT], - [Environment variables for Valgrind.]) - AC_CHECK_PROGS([VALGRIND_PATH], [valgrind], [:]) - AM_CONDITIONAL([HAVE_VALGRIND], [test "x$VALGRIND_PATH" != "x:"]) -])dnl diff --git a/m4/valgrind.mk b/m4/valgrind.mk deleted file mode 100644 index 7686b53..0000000 --- a/m4/valgrind.mk +++ /dev/null @@ -1,128 +0,0 @@ -# valgrind.mk - Provides the "memcheck" target(s) -# -# Copyright 1994-2012 Free Software Foundation, Inc. -# Copyright 2012 Michael Steinert -# -# This file is free software; the copyright holder 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. - -if HAVE_VALGRIND - -AX_V_valgrind = $(ax__v_valgrind_$(V)) -ax__v_valgrind_ = $(ax__v_valgrind_$(AM_DEFAULT_VERBOSITY)) -ax__v_valgrind_0 = -q -ax__v_valgrind_1 = - -VALGRIND = $(VALGRIND_ENVIRONMENT) $(LIBTOOL) $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=execute \ - $(VALGRIND_PATH) $(AX_V_valgrind) $(VALGRIND_FLAGS) \ - $(foreach supp,$(VALRGIND_SUPPRESSIONS),--suppressions=$(supp)) \ - --leak-check=full --error-exitcode=1 - -memcheck-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) - $(MAKE) $(AM_MAKEFLAGS) memcheck-TESTS -memcheck: memcheck-am -%.memcheck: % - $(AM_V_at)$(TESTS_ENVIRONMENT) $(VALGRIND) $* - -memcheck-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; \ - srcdir=$(srcdir); export srcdir; \ - list=' $(TESTS) '; \ - $(am__tty_colors); \ - if test -n "$$list"; then \ - for tst in $$list; do \ - if test -f ./$$tst; then dir=./; \ - elif test -f $$tst; then dir=; \ - else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $(VALGRIND) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xpass=`expr $$xpass + 1`; \ - failed=`expr $$failed + 1`; \ - col=$$red; res=XPASS; \ - ;; \ - *) \ - col=$$grn; res=PASS; \ - ;; \ - esac; \ - elif test $$? -ne 77; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xfail=`expr $$xfail + 1`; \ - col=$$lgn; res=XFAIL; \ - ;; \ - *) \ - failed=`expr $$failed + 1`; \ - col=$$red; res=FAIL; \ - ;; \ - esac; \ - else \ - skip=`expr $$skip + 1`; \ - col=$$blu; res=SKIP; \ - fi; \ - echo "$${col}$$res$${std}: $$tst"; \ - done; \ - if test "$$all" -eq 1; then \ - tests="test"; \ - All=""; \ - else \ - tests="tests"; \ - All="All "; \ - fi; \ - if test "$$failed" -eq 0; then \ - if test "$$xfail" -eq 0; then \ - banner="$$All$$all $$tests passed"; \ - else \ - if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ - banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ - fi; \ - else \ - if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all $$tests failed"; \ - else \ - if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ - banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ - fi; \ - fi; \ - dashes="$$banner"; \ - skipped=""; \ - if test "$$skip" -ne 0; then \ - if test "$$skip" -eq 1; then \ - skipped="($$skip test was not run)"; \ - else \ - skipped="($$skip tests were not run)"; \ - fi; \ - test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$skipped"; \ - fi; \ - report=""; \ - if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ - report="Please report to $(PACKAGE_BUGREPORT)"; \ - test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$report"; \ - fi; \ - dashes=`echo "$$dashes" | sed s/./=/g`; \ - if test "$$failed" -eq 0; then \ - col="$$grn"; \ - else \ - col="$$red"; \ - fi; \ - echo "$${col}$$dashes$${std}"; \ - echo "$${col}$$banner$${std}"; \ - test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ - test -z "$$report" || echo "$${col}$$report$${std}"; \ - echo "$${col}$$dashes$${std}"; \ - test "$$failed" -eq 0; \ - else :; fi - -endif