parser: make equality.sh honor env variable VERBOSE

- make the verbose output of equality.sh honor whether or not
  the environment variable VERBOSE is set

- thereby making the output verbose when 'make check V=1' or 'make
  check VERBOSE=1' is given from within the parser/ directory. This
  will make distribution packagers happy when diagnosing build
  failures caused by test failures.

- if verbose output is not emitted and the tests were successful, emit
  a newline before printing PASS.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
Steve Beattie 2015-03-23 11:45:45 -07:00
parent 0bfad115cd
commit cecbcb0912
2 changed files with 4 additions and 1 deletions

View file

@ -9,6 +9,8 @@ PROVE_ARG=-f
ifeq ($(VERBOSE),1)
PROVE_ARG+=-v
PYTEST_ARG = -v
else
undefine VERBOSE
endif
all: tests

View file

@ -27,7 +27,7 @@ _SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}" )
APPARMOR_PARSER="${APPARMOR_PARSER:-${_SCRIPTDIR}/../apparmor_parser}"
fails=0
errors=0
verbose=
verbose="${VERBOSE:-}"
hash_binary_policy()
{
@ -430,5 +430,6 @@ then
exit $(($fails + $errors))
fi
[ -z "${verbose}" ] && printf "\n"
printf "PASS\n"
exit 0