Refactor runtests to allow to specify files on command line (#4609)
This commit is contained in:
parent
0854fda28a
commit
9427fa3c66
|
@ -406,9 +406,8 @@ function cppunit_fn {
|
|||
fi
|
||||
}
|
||||
|
||||
for f in "${DIR}"*.{c,cpp}
|
||||
do
|
||||
f=$(basename $f)
|
||||
function check_file {
|
||||
f=$(basename $1)
|
||||
case $f in
|
||||
boost.cpp)
|
||||
boost_fn
|
||||
|
@ -506,9 +505,19 @@ do
|
|||
echo "Unhandled file $f"
|
||||
exit_if_strict
|
||||
esac
|
||||
}
|
||||
|
||||
function check_files
|
||||
{
|
||||
for f in "$@"
|
||||
do
|
||||
check_file $f
|
||||
done
|
||||
}
|
||||
|
||||
# Check the syntax of the defines in the configuration files
|
||||
function check_defines_syntax
|
||||
{
|
||||
if ! xmlstarlet --version; then
|
||||
echo "xmlstarlet needed to extract defines, skipping defines check."
|
||||
exit_if_strict
|
||||
|
@ -523,5 +532,14 @@ else
|
|||
echo "$EXTRACTED_DEFINES" | gcc -fsyntax-only -xc -Werror -
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
check_files "${DIR}"*.{c,cpp}
|
||||
check_defines_syntax
|
||||
else
|
||||
check_files "$@"
|
||||
fi
|
||||
|
||||
echo SUCCESS
|
||||
|
|
Loading…
Reference in New Issue