blob: ab89e0331d86289c9c9b52a4f413a11c47ee75c5 [file] [log] [blame]
#!/bin/bash
# Run hidl-gen against errors/syntax/1.0/IEx1.hal to ensure it detects as many
# syntax errors as possible.
if [ ! -d system/tools/hidl/test/errors/syntax/1.0 ] ; then
echo "Where is system/tools/hidl/test/errors/syntax/1.0?";
exit 1;
fi
# TODO(b/33276472)
if [ ! -d system/libhidl/transport ] ; then
echo "Where is system/libhidl/transport?";
exit 1;
fi
COMMAND='hidl-gen -Lc++ -rtests:system/tools/hidl/test -randroid.hidl:system/libhidl/transport -o /tmp tests.errors.syntax@1.0'
EXPECTED='system/tools/hidl/test/errors.output'
if [[ "$@" == "-h" ]]
then
echo "$0 [-h|-u|-n]"
echo " (No options) Run and diff against expected output"
echo " -u Update expected output"
echo " -a Run and show actual output"
echo " -h Show help text"
elif [[ "$@" == "-u" ]]
then
$COMMAND 2>$EXPECTED;
echo Updated.
elif [[ "$@" == "-a" ]]
then
$COMMAND
else
$COMMAND 2>&1 | diff $EXPECTED -
if [ $? -eq 0 ]; then
echo Success.
fi
fi