check_configtool.sh: comment on comment stripping.
This commit is contained in:
parent
b3f77a89b2
commit
fdf9534ed9
|
|
@ -4,10 +4,10 @@
|
||||||
# are made in the GUI. This requires that the distributed config files match
|
# are made in the GUI. This requires that the distributed config files match
|
||||||
# the format of the configtool template files, but this is desired anyway.
|
# the format of the configtool template files, but this is desired anyway.
|
||||||
|
|
||||||
# Stop on error
|
# Stop on error.
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Create an output directory for verification
|
# Create an output directory for verification.
|
||||||
OUTDIR="build/test"
|
OUTDIR="build/test"
|
||||||
rm -rf "${OUTDIR}"
|
rm -rf "${OUTDIR}"
|
||||||
mkdir -p "${OUTDIR}"
|
mkdir -p "${OUTDIR}"
|
||||||
|
|
@ -15,15 +15,18 @@ mkdir -p "${OUTDIR}"
|
||||||
# Check board and printer configurations.
|
# Check board and printer configurations.
|
||||||
git ls-files "config/*.h" | while read IN; do
|
git ls-files "config/*.h" | while read IN; do
|
||||||
|
|
||||||
# Use configtool.py to regenerate headers for comparison
|
# Use configtool.py to regenerate headers for comparison.
|
||||||
OUT="${OUTDIR}"/$(basename "${IN}")
|
OUT="${OUTDIR}"/$(basename "${IN}")
|
||||||
./configtool.py --load="${IN}" --save="${OUT}" --quit
|
./configtool.py --load="${IN}" --save="${OUT}" --quit
|
||||||
|
|
||||||
# Strip the "help text" comments from the source and output files
|
# Strip the "help text" comments from the source and output files.
|
||||||
|
#
|
||||||
|
# This should go away one day, but currently it avoids failures on the only
|
||||||
|
# partially handled CANNED_CYCLE #define.
|
||||||
perl -p0i -e 's#/\*.*?\*/##sg' "${OUT}"
|
perl -p0i -e 's#/\*.*?\*/##sg' "${OUT}"
|
||||||
perl -p0 -e 's#/\*.*?\*/##sg' "${IN}" > "${OUT}.cmp"
|
perl -p0 -e 's#/\*.*?\*/##sg' "${IN}" > "${OUT}.cmp"
|
||||||
|
|
||||||
# Fail if the result is different except in whitespace
|
# Fail if the result is different except in whitespace.
|
||||||
if ! diff -qBbw "${OUT}" "${OUT}.cmp" ; then
|
if ! diff -qBbw "${OUT}" "${OUT}.cmp" ; then
|
||||||
echo "Configtool integrity test failed on file ${IN}"
|
echo "Configtool integrity test failed on file ${IN}"
|
||||||
echo " Executed: ./configtool.py --load=\"${IN}\" --save=\"${OUT}\" --quit"
|
echo " Executed: ./configtool.py --load=\"${IN}\" --save=\"${OUT}\" --quit"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue