1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

Add jq_report_error() function; use it

Put a stop to fprintf(stderr, ...) where we shouldn't.
This commit is contained in:
Nicolas Williams
2014-08-11 17:25:09 -05:00
parent 908c10928b
commit 9f13afa20f
7 changed files with 85 additions and 73 deletions

View File

@@ -129,13 +129,13 @@ if [ -n "$VALGRIND" ] && ! grep 'ERROR SUMMARY: 0 errors from 0 contexts' $d/out
cat $d/out
exit 1
fi
if ! grep '^error: syntax error,' $d/out > /dev/null; then
if ! grep '^jq: error: syntax error,' $d/out > /dev/null; then
echo "Module system not detecting syntax errors in modules correctly" 1>&2
exit 1
fi
if $VALGRIND ./jq -ner -L $d '%::wat' > $d/out 2>&1 ||
! grep '^error: syntax error,' $d/out > /dev/null; then
! grep '^jq: error: syntax error,' $d/out > /dev/null; then
echo "Syntax errors not detected?" 1>&2
exit 1
fi