[apparmor] [PATCH 03/10] make equality.sh honor env variable VERBOSE
John Johansen
john.johansen at canonical.com
Fri Mar 20 12:02:27 UTC 2015
- 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 at nxnw.org>
Acked-by: John Johansen <john.johansen at canonical.com>
---
parser/tst/Makefile | 2 ++
parser/tst/equality.sh | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/parser/tst/Makefile b/parser/tst/Makefile
index d254809..76609d2 100644
--- a/parser/tst/Makefile
+++ b/parser/tst/Makefile
@@ -9,6 +9,8 @@ PROVE_ARG=-f
ifeq ($(VERBOSE),1)
PROVE_ARG+=-v
PYTEST_ARG = -v
+else
+ undefine VERBOSE
endif
all: tests
diff --git a/parser/tst/equality.sh b/parser/tst/equality.sh
index a66e739..c04dd4d 100755
--- a/parser/tst/equality.sh
+++ b/parser/tst/equality.sh
@@ -25,7 +25,7 @@ set -o pipefail
APPARMOR_PARSER="${APPARMOR_PARSER:-../apparmor_parser}"
fails=0
errors=0
-verbose=
+verbose="${VERBOSE:-}"
hash_binary_policy()
{
@@ -428,5 +428,6 @@ then
exit $(($fails + $errors))
fi
+[ -z "${verbose}" ] && printf "\n"
printf "PASS\n"
exit 0
--
2.1.4
More information about the AppArmor
mailing list