Skip to content

Commit

Permalink
Run unit tests in isolation to avoid side-effects
Browse files Browse the repository at this point in the history
  • Loading branch information
jansorg committed Feb 13, 2024
1 parent b97e098 commit ca5c7a4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ AC_PREREQ([2.71])
# See if --prefix was set. If not, set it to a reasonable default
# based on where bash thinks bashdb is supposed to be installed.
##################################################################
AM_INIT_AUTOMAKE([foreign])
AM_INIT_AUTOMAKE([foreign serial-tests])
AM_MAINTAINER_MODE


Expand Down
37 changes: 33 additions & 4 deletions test/unit/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,19 +1,48 @@
## 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-logging.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)"
builddir="$(abs_builddir)" \
$(SH_PROG) $(abs_srcdir)/shunit \
$(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
Expand Down

0 comments on commit ca5c7a4

Please sign in to comment.