From 13c3743fa58c3e5e508b9fbba06afe61a164f1e2 Mon Sep 17 00:00:00 2001 From: Joachim Ansorg Date: Tue, 18 Jun 2024 16:44:47 +0200 Subject: [PATCH] 4.4: sync unit test setup with bash-5.2 --- test/unit/.gitignore | 2 ++ test/unit/Makefile.am | 48 ++++++++++++++++++++++++++++++++----------- 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/test/unit/.gitignore b/test/unit/.gitignore index 93642ec3..f023666f 100644 --- a/test/unit/.gitignore +++ b/test/unit/.gitignore @@ -1,4 +1,6 @@ /*~ +/*.trs +/*.log /Makefile /Makefile.in /require_me.sh diff --git a/test/unit/Makefile.am b/test/unit/Makefile.am index d450c401..3fa681b1 100644 --- a/test/unit/Makefile.am +++ b/test/unit/Makefile.am @@ -1,27 +1,51 @@ ## Process this file with automake to produce Makefile.in -*-Makefile-*-. -COMBINED_TESTS = $(wildcard test-*.sh) -tests_sources = $(notdir $(COMBINED_TESTS:=.in)) + +# Don't forget to add the *.in files of new tests to configure.ac in the root folder +TESTS = test-action.sh \ + test-alias.sh \ + test-bashdb-trace.sh \ + test-break.sh \ + test-cmd-complete.sh \ + test-cmd-eval.sh \ + test-cmd-info-variables.sh \ + test-columns.sh \ + test-filecache.sh \ + test-file.sh \ + test-fns.sh \ + test-frame.sh \ + test-get-sourceline.sh \ + test-io.sh \ + test-lib-eval.sh \ + test-lib-list.sh \ + test-msg.sh \ + test-pre.sh \ + test-require.sh \ + test-run.sh \ + test-save-restore.sh \ + test-sort.sh \ + test-validate.sh + +tests_sources = $(notdir $(TESTS:=.in)) abs_srcdir=@abs_srcdir@ abs_builddir=@abs_builddir@ -TESTS_ENVIRONMENT = \ - srcdir="$(abs_srcdir)" \ - builddir="$(abs_builddir)" +AM_TESTS_ENVIRONMENT = \ + srcdir="$(abs_srcdir)"; \ + builddir="$(abs_builddir)"; \ + export srcdir builddir; +LOG_COMPILER = $(SH_PROG) +AM_LOG_FLAGS = $(abs_srcdir)/shunit2 \ + $(abs_srcdir)/helper.sh $(abs_srcdir)/mock-cmd.sh \ + $(abs_srcdir)/require_me.sh EXTRA_DIST = \ helper.sh \ mock-cmd.sh \ require_me.sh \ - require_me.sh.in $(COMBINED_TESTS) shunit2 $(tests_sources) + require_me.sh.in $(TESTS) shunit2 $(tests_sources) test: check test-unit: check -check: $(COMBINED_TESTS) - $(SH_PROG) $(abs_srcdir)/shunit2 \ - $(abs_srcdir)/helper.sh $(abs_srcdir)/mock-cmd.sh \ - $(abs_srcdir)/require_me.sh \ - $(COMBINED_TESTS) - MOSTLYCLEANFILES = *.orig *.rej