2020-06-16 14:39:50 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-06-16 15:25:41 -07:00
|
|
|
#
|
|
|
|
# this one used by github actions
|
|
|
|
# this scripts replaces run_gcov.sh
|
|
|
|
#
|
|
|
|
|
2020-06-16 15:55:18 -07:00
|
|
|
if [ ! "$1" ] || [ ! "$2" ] || [ ! "$3" ]; then
|
|
|
|
echo "No Secrets"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2020-06-16 14:39:50 -07:00
|
|
|
rm -rf gcov_working_area
|
|
|
|
|
|
|
|
mkdir gcov_working_area
|
|
|
|
cd gcov_working_area
|
|
|
|
|
|
|
|
echo "Looking for source code"
|
|
|
|
find .. -name *.c* > source_files.txt
|
|
|
|
find ../../firmware/console/ -name *.c* >> source_files.txt
|
|
|
|
find ../../firmware/controllers/ -name *.c* >> source_files.txt
|
|
|
|
|
|
|
|
wc -l source_files.txt
|
|
|
|
|
|
|
|
xargs -L 1 -I {} cp {} . < source_files.txt
|
|
|
|
|
|
|
|
cp ../build/obj/* .
|
|
|
|
|
|
|
|
echo -e "\nGenerating coverage"
|
|
|
|
gcov *.c* > gcov.log 2>gcov.err
|
|
|
|
|
|
|
|
echo -e "\nCollecting coverage"
|
|
|
|
lcov --capture --directory . --output-file coverage.info
|
|
|
|
|
|
|
|
echo -e "\nGenerating HTML"
|
|
|
|
genhtml coverage.info --output-directory gcov
|
|
|
|
|
2020-07-08 08:10:24 -07:00
|
|
|
if [ -n "$RUSEFI_FTP_SERVER" ]; then
|
|
|
|
echo -e "\nUploading HTML"
|
|
|
|
ncftpput -m -R -v -u "$1" -p "$2" "$3" /unit_tests_coverage gcov/*
|
|
|
|
fi
|