From 088b8d17a01e740149f1cef18aa5ddc2e6b2a089 Mon Sep 17 00:00:00 2001 From: David Seifert Date: Mon, 26 Apr 2021 00:06:05 +0200 Subject: [PATCH 1/4] Use POSIX-compatible `test` operators * `==` is not compatible with stricter POSIX shells such as the dash shell. Bug: https://bugs.gentoo.org/773955 --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 4d8b4d11..66932758 100644 --- a/configure.ac +++ b/configure.ac @@ -133,7 +133,7 @@ AC_ARG_ENABLE([legacy], AS_IF([test "x$enable_legacy" = "xyes"], [AC_DEFINE([ENABLE_LEGACY])]) -AM_CONDITIONAL([ENABLE_LEGACY], [test "x$enable_legacy" == "xyes"]) +AM_CONDITIONAL([ENABLE_LEGACY], [test "x$enable_legacy" = "xyes"]) AC_ARG_ENABLE([dsd], AS_HELP_STRING([--disable-dsd], [disable support for WavPack DSD files])) @@ -146,12 +146,12 @@ AM_CONDITIONAL([ENABLE_DSD], [test "x$enable_dsd" != "xno"]) AC_ARG_ENABLE([rpath], AS_HELP_STRING([--enable-rpath], [hardcode library path in executables])) -AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" == "xyes"]) +AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"]) AC_ARG_ENABLE([tests], AS_HELP_STRING([--enable-tests], [build libwavpack test program (requires Pthreads)])) -AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" == "xyes"]) +AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"]) AC_ARG_ENABLE([asm], [AS_HELP_STRING([--disable-asm], [disable assembly optimizations])],, From eb51e465c3baaaf23519586db7fa7a29e175ce97 Mon Sep 17 00:00:00 2001 From: David Seifert Date: Mon, 26 Apr 2021 00:06:08 +0200 Subject: [PATCH 2/4] man/Makefile.am: Use POSIX suffix rules * These work with `bmake`/`pmake` --- man/Makefile.am | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/man/Makefile.am b/man/Makefile.am index 33c661aa..0359ea6a 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1,11 +1,13 @@ -man_MANS = wavpack.1 wvgain.1 wvunpack.1 wvtag.1 +dist_man_MANS = wavpack.1 wvgain.1 wvunpack.1 wvtag.1 if ENABLE_MAN -%.1: %.xml +.xml.1: $(XSLTPROC) -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< + +SUFFIXES = .1 .xml endif -EXTRA_DIST = $(man_MANS) $(patsubst %.1,%.xml,$(man_MANS)) +EXTRA_DIST = wavpack.xml wvgain.xml wvunpack.xml wvtag.xml MAINTAINERCLEANFILES = \ $(man_MANS) \ From 3a22dba15594a78e8781699b20d9d86cae3d16c2 Mon Sep 17 00:00:00 2001 From: David Seifert Date: Mon, 26 Apr 2021 00:06:11 +0200 Subject: [PATCH 3/4] Makefile.am: expand globs * Globs don't work in Automake --- Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 0e76c1c2..f41d732a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,7 +21,9 @@ MAINTAINERCLEANFILES = \ missing \ install-sh -EXTRA_DIST = README.md doc/*.pdf doc/*.html doc/*.css \ +EXTRA_DIST = README.md \ + doc/WavPack5FileFormat.pdf doc/WavPack5LibraryDoc.pdf doc/WavPack5PortingGuide.pdf \ + doc/wavpack_doc.html doc/style.css \ CMakeLists.txt cmake/CheckCLinkerFlag.cmake cmake/modules/FindIconv.cmake \ cmake/TestLargeFiles.cmake From e771b35e25daf97a25f5ad7295275b363583ec1a Mon Sep 17 00:00:00 2001 From: David Seifert Date: Mon, 26 Apr 2021 00:06:14 +0200 Subject: [PATCH 4/4] Use canonical Automake test harness * To run the full test suite: make check TESTS=all-tests --- .travis.yml | 2 +- cli/Makefile.am | 7 ++++--- cli/all-tests | 2 ++ cli/fast-tests | 2 ++ configure.ac | 11 +++++------ 5 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 cli/all-tests create mode 100644 cli/fast-tests diff --git a/.travis.yml b/.travis.yml index 04d6e771..886cf940 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,4 +27,4 @@ before_install: script: - if [[ "${BUILD_SYSTEM}" == "cmake" ]]; then mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON && cmake --build . && cpack -G ZIP && ctest -V; fi - if [[ "${BUILD_SYSTEM}" == "autotools" && "${TRAVIS_OS_NAME}" == "linux" && "${CC_FOR_BUILD}" == "clang" ]]; then ./build-regressors.sh && ./run-regressors.sh; fi - - if [[ "${BUILD_SYSTEM}" == "autotools" && ( "${TRAVIS_OS_NAME}" != "linux" || "${CC_FOR_BUILD}" != "clang" ) ]]; then ./autogen.sh --enable-tests && make && cli/wvtest --exhaustive --short --no-extras; fi + - if [[ "${BUILD_SYSTEM}" == "autotools" && ( "${TRAVIS_OS_NAME}" != "linux" || "${CC_FOR_BUILD}" != "clang" ) ]]; then ./autogen.sh && make distcheck; fi diff --git a/cli/Makefile.am b/cli/Makefile.am index 39aafc2e..a532a19a 100644 --- a/cli/Makefile.am +++ b/cli/Makefile.am @@ -40,15 +40,16 @@ wvtag_LDFLAGS = -rpath $(libdir) endif wvtag_LDADD = $(AM_LDADD) $(top_builddir)/src/libwavpack.la $(LIBM) $(ICONV_LIBS) -if ENABLE_TESTS -bin_PROGRAMS += wvtest +check_PROGRAMS = wvtest wvtest_SOURCES = wvtest.c md5.c wvtest_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/include if ENABLE_RPATH wvtest_LDFLAGS = -rpath $(libdir) endif wvtest_LDADD = $(AM_LDADD) $(top_builddir)/src/libwavpack.la $(LIBM) -lpthread -endif + +TESTS = fast-tests +TESTS_ENVIRONMENT = $(SHELL) noinst_HEADERS = \ win32_unicode_support.h \ diff --git a/cli/all-tests b/cli/all-tests new file mode 100644 index 00000000..9c074f8d --- /dev/null +++ b/cli/all-tests @@ -0,0 +1,2 @@ +set -e +./wvtest --default diff --git a/cli/fast-tests b/cli/fast-tests new file mode 100644 index 00000000..299b89dd --- /dev/null +++ b/cli/fast-tests @@ -0,0 +1,2 @@ +set -e +./wvtest --exhaustive --short --no-extras diff --git a/configure.ac b/configure.ac index 66932758..a4780c42 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_INIT(wavpack, 5.4.0, bryant@wavpack.com) AC_CONFIG_SRCDIR([src/pack.c]) -AM_INIT_AUTOMAKE +AM_INIT_AUTOMAKE([serial-tests]) AM_MAINTAINER_MODE LIBWAVPACK_MAJOR=5 @@ -148,11 +148,6 @@ AC_ARG_ENABLE([rpath], AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"]) -AC_ARG_ENABLE([tests], - AS_HELP_STRING([--enable-tests], [build libwavpack test program (requires Pthreads)])) - -AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"]) - AC_ARG_ENABLE([asm], [AS_HELP_STRING([--disable-asm], [disable assembly optimizations])],, [enable_asm=check]) @@ -216,6 +211,10 @@ fi AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno) +AC_CONFIG_LINKS([ + cli/all-tests:cli/all-tests + cli/fast-tests:cli/fast-tests +]) AC_CONFIG_FILES( Makefile wavpack.pc