diff options
Diffstat (limited to 'scripts/code_cov_gather_on_build.sh')
-rwxr-xr-x | scripts/code_cov_gather_on_build.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/code_cov_gather_on_build.sh b/scripts/code_cov_gather_on_build.sh new file mode 100755 index 00000000..99c436f7 --- /dev/null +++ b/scripts/code_cov_gather_on_build.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +KSRC=$1 +KOBJ=$2 +DEST=$3 + +if [ -z "$KSRC" ] || [ -z "$KOBJ" ] || [ -z "$DEST" ]; then + echo "Usage: $0 <ksrc directory> <kobj directory> <output.tar.gz>" >&2 + exit 1 +fi + +KSRC=$(cd $KSRC; printf "all:\n\t@echo \${CURDIR}\n" | make -f -) +KOBJ=$(cd $KOBJ; printf "all:\n\t@echo \${CURDIR}\n" | make -f -) + +find $KSRC $KOBJ \( -name '*.gcno' -o -name '*.[ch]' -o -type l \) -a \ + -perm /u+r,g+r | tar cfz $DEST -P -T - + +if [ $? -eq 0 ] ; then + echo "$DEST successfully created, copy to test system and unpack with:" + echo " tar xfz $DEST -P" +else + echo "Could not create file $DEST" +fi |