mirror of
https://github.com/nasa/fpp.git
synced 2025-12-15 12:58:25 -06:00
72 lines
1.4 KiB
Bash
Executable File
72 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
. ../../../scripts/test-utils.sh
|
|
|
|
fpp_to_cpp=../../../bin/fpp-to-cpp
|
|
|
|
update()
|
|
{
|
|
args=$1
|
|
infile=$2
|
|
if test -n "$3"
|
|
then
|
|
outfile=$3
|
|
else
|
|
outfile=$infile
|
|
fi
|
|
$fpp_to_cpp $args $infile.fpp 2>&1 | remove_path_prefix > $outfile.ref.txt
|
|
}
|
|
|
|
for file in `find . -name '*.ref.txt'`
|
|
do
|
|
rm $file
|
|
done
|
|
|
|
. ./tests.sh
|
|
|
|
# Default update ref
|
|
for t in $tests
|
|
do
|
|
echo "
|
|
$t()
|
|
{
|
|
update '' $t
|
|
}"
|
|
done > default-update-ref.sh
|
|
. ./default-update-ref.sh
|
|
|
|
constants()
|
|
{
|
|
update "-n constants.names.txt -p $PWD" constants
|
|
mv constants.names.txt constants.names.ref.txt
|
|
remove_year < FppConstants.hpp > FppConstants_constants.ref.hpp
|
|
remove_year < FppConstants.cpp > FppConstants_constants.ref.cpp
|
|
}
|
|
|
|
constants_guard()
|
|
{
|
|
update "-g GUARD_PREFIX -p $PWD" constants
|
|
remove_year < FppConstants.hpp > FppConstants_constants_guard.ref.hpp
|
|
remove_year < FppConstants.cpp > FppConstants_constants_guard.ref.cpp
|
|
}
|
|
|
|
constants_output_dir()
|
|
{
|
|
update "-d output_dir -p $PWD" constants output_dir/constants
|
|
remove_year < output_dir/FppConstants.hpp > output_dir/FppConstants.ref.hpp
|
|
remove_year < output_dir/FppConstants.cpp > output_dir/FppConstants.ref.cpp
|
|
}
|
|
|
|
constants_string()
|
|
{
|
|
update "-p $PWD" constants_string
|
|
remove_year < FppConstants.hpp > FppConstants_constants_string.ref.hpp
|
|
remove_year < FppConstants.cpp > FppConstants_constants_string.ref.cpp
|
|
}
|
|
|
|
for t in $tests
|
|
do
|
|
echo "updating ref output for $t"
|
|
$t
|
|
done
|