Rob Bocchino c7723d1de0 Revise fpp-to-cpp test scripts
Remove PROTECTED and PRIVATE from build config
2025-07-22 15:54:13 -07:00

48 lines
932 B
Bash
Executable File

#!/bin/sh
cd `dirname $0`
fprime_gcc=../../../../../scripts/fprime-gcc
export FPRIME_GCC_FLAGS="-I../../fprime"
warning_flags="
-Wno-return-type
-Wno-unused-parameter
"
include_flags="
-I$FPRIME/googletest/googletest/include/
-I..
-I../../../..
-I../base
-I../impl
-I../test-base
-I../../fprime
"
define_flags="-DBUILD_UT=1"
../../fprime/generate_cpp
# Generate headers in base and test-base
for dir in base test-base
do
echo "running the tests in ../$dir to generate the header files"
(cd ../$dir; ./run)
done
echo "copying base headers to test-base"
cp ../base/*Ac.hpp ../test-base
# Generate impl headers in impl
(cd ../impl; ../gen_ref_headers)
# Generate header files
../gen_ref_headers
# Compile cpp files
for file in `find . -name '*.ref.cpp' | sort`
do
base=`basename $file .ref.cpp`
cp $file $base.cpp
echo "compiling $base.cpp"
$fprime_gcc $include_flags $define_flags $warning_flags -c $base.cpp
done