Skip to content

Commit afd825f

Browse files
committed
Run unit tests in isolation to avoid side-effects
1 parent b97e098 commit afd825f

File tree

2 files changed

+34
-5
lines changed

2 files changed

+34
-5
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ AC_PREREQ([2.71])
3535
# See if --prefix was set. If not, set it to a reasonable default
3636
# based on where bash thinks bashdb is supposed to be installed.
3737
##################################################################
38-
AM_INIT_AUTOMAKE([foreign])
38+
AM_INIT_AUTOMAKE([foreign serial-tests])
3939
AM_MAINTAINER_MODE
4040

4141

test/unit/Makefile.am

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,48 @@
11
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
2-
COMBINED_TESTS = $(wildcard test-*.sh)
3-
tests_sources = $(notdir $(COMBINED_TESTS:=.in))
2+
3+
# Don't forget to add the *.in files of new tests to configure.ac in the root folder
4+
TESTS = test-action.sh \
5+
test-alias.sh \
6+
test-bashdb-trace.sh \
7+
test-break.sh \
8+
test-cmd-complete.sh \
9+
test-cmd-eval.sh \
10+
test-cmd-info-variables.sh \
11+
test-columns.sh \
12+
test-filecache.sh \
13+
test-file.sh \
14+
test-fns.sh \
15+
test-frame.sh \
16+
test-get-sourceline.sh \
17+
test-io.sh \
18+
test-lib-eval.sh \
19+
test-lib-list.sh \
20+
test-logging.sh \
21+
test-msg.sh \
22+
test-pre.sh \
23+
test-require.sh \
24+
test-run.sh \
25+
test-save-restore.sh \
26+
test-sort.sh \
27+
test-validate.sh
28+
29+
tests_sources = $(notdir $(TESTS:=.in))
430

531
abs_srcdir=@abs_srcdir@
632
abs_builddir=@abs_builddir@
733

834
TESTS_ENVIRONMENT = \
935
srcdir="$(abs_srcdir)" \
10-
builddir="$(abs_builddir)"
36+
builddir="$(abs_builddir)" \
37+
$(SH_PROG) $(abs_srcdir)/shunit2 \
38+
$(abs_srcdir)/helper.sh $(abs_srcdir)/mock-cmd.sh \
39+
$(abs_srcdir)/require_me.sh
1140

1241
EXTRA_DIST = \
1342
helper.sh \
1443
mock-cmd.sh \
1544
require_me.sh \
16-
require_me.sh.in $(COMBINED_TESTS) shunit2 $(tests_sources)
45+
require_me.sh.in $(TESTS) shunit2 $(tests_sources)
1746

1847
test: check
1948
test-unit: check

0 commit comments

Comments
 (0)