fixed err.sh to produce the expected line upon failure.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
updated t/Makefile.am to use $(SHELL) intead of sh
This commit is contained in:
parent
4d5f2266b4
commit
ded917711e
@ -31,8 +31,8 @@ TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(check_ERRORS)
|
||||
|
||||
TEST_EXTENSIONS = .hcl .err
|
||||
|
||||
HCL_LOG_COMPILER = sh $(abs_srcdir)/run.sh ../bin/hcl --modlibdirs="@abs_top_builddir@/mod:@abs_top_builddir@/mod/.libs" --heapsize=0 -b -n
|
||||
HCL_LOG_COMPILER = $(SHELL) $(abs_srcdir)/run.sh ../bin/hcl --modlibdirs="@abs_top_builddir@/mod:@abs_top_builddir@/mod/.libs" --heapsize=0 -b -n
|
||||
AM_HCL_LOG_FLAGS =
|
||||
|
||||
ERR_LOG_COMPILER = sh $(abs_srcdir)/err.sh ../bin/hcl --modlibdirs="@abs_top_builddir@/mod:@abs_top_builddir@/mod/.libs" --heapsize=0 -b -n
|
||||
ERR_LOG_COMPILER = $(SHELL) $(abs_srcdir)/err.sh ../bin/hcl --modlibdirs="@abs_top_builddir@/mod:@abs_top_builddir@/mod/.libs" --heapsize=0 -b -n
|
||||
AM_ERR_LOG_FLAGS =
|
||||
|
@ -495,9 +495,9 @@ check_ERRORS = \
|
||||
|
||||
EXTRA_DIST = $(check_SCRIPTS) $(check_ERRORS)
|
||||
TEST_EXTENSIONS = .hcl .err
|
||||
HCL_LOG_COMPILER = sh $(abs_srcdir)/run.sh ../bin/hcl --modlibdirs="@abs_top_builddir@/mod:@abs_top_builddir@/mod/.libs" --heapsize=0 -b -n
|
||||
HCL_LOG_COMPILER = $(SHELL) $(abs_srcdir)/run.sh ../bin/hcl --modlibdirs="@abs_top_builddir@/mod:@abs_top_builddir@/mod/.libs" --heapsize=0 -b -n
|
||||
AM_HCL_LOG_FLAGS =
|
||||
ERR_LOG_COMPILER = sh $(abs_srcdir)/err.sh ../bin/hcl --modlibdirs="@abs_top_builddir@/mod:@abs_top_builddir@/mod/.libs" --heapsize=0 -b -n
|
||||
ERR_LOG_COMPILER = $(SHELL) $(abs_srcdir)/err.sh ../bin/hcl --modlibdirs="@abs_top_builddir@/mod:@abs_top_builddir@/mod/.libs" --heapsize=0 -b -n
|
||||
AM_ERR_LOG_FLAGS =
|
||||
all: all-am
|
||||
|
||||
|
6
t/err.sh
6
t/err.sh
@ -35,7 +35,7 @@ run_partfile() {
|
||||
## the regular expression is not escaped properly. the error information must not
|
||||
## include specifial regex characters to avoid problems.
|
||||
echo "$l_output" | grep -E "ERROR:.+${l_partfile}\[${l_expected_errline},[[:digit:]]+\] ${l_expected_errmsg}" >/dev/null 2>&1 || {
|
||||
echo "ERROR: error not raised - $l_script($l_partno) - $l_output"
|
||||
echo "ERROR: error not raised at line $l_expected_errline - $l_script($l_partno) - $l_output"
|
||||
return 1
|
||||
}
|
||||
|
||||
@ -50,7 +50,8 @@ partno=0
|
||||
partlines=0
|
||||
> "$partfile"
|
||||
|
||||
## TODO: don't use while read line..
|
||||
## dash behaves differently for read -r.
|
||||
## while \n is read in literally by bash or other shells, dash converts it to a new-line
|
||||
while IFS= read -r line
|
||||
do
|
||||
if [ "$line" = "---" ]
|
||||
@ -73,3 +74,4 @@ done < "$script"
|
||||
|
||||
rm -f "$partfile"
|
||||
exit $ever_failed
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user