rusefi-1/unit_tests/ci_gcov.sh

42 lines
1.0 KiB
Bash
Raw Normal View History

#!/bin/bash
2020-06-16 15:25:41 -07:00
#
# this one used by github actions
# this scripts replaces run_gcov.sh
#
if [ ! "$1" ] || [ ! "$2" ] || [ ! "$3" ]; then
2020-11-19 18:32:14 -08:00
echo "No FTP Secrets, not even generating coverage"
exit 0
fi
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/* .
2020-11-19 18:32:14 -08:00
echo -e "\nGenerating rusEFI unit test coverage"
gcov *.c* > gcov.log 2>gcov.err
2020-11-19 18:32:14 -08:00
echo -e "\nCollecting rusEFI unit test coverage"
lcov --capture --directory . --output-file coverage.info
2020-11-19 18:32:14 -08:00
echo -e "\nGenerating rusEFI unit test HTML"
genhtml coverage.info --output-directory gcov
2020-11-19 18:32:14 -08:00
echo -e "\nGenerating rusEFI unit test HTML"
2020-11-19 18:32:14 -08:00
echo -e "\nUploading HTML"
ncftpput -m -R -v -u "$1" -p "$2" "$3" /unit_tests_coverage gcov/*
2020-11-19 18:57:18 -08:00
echo -e "\nHappy End."