2011-06-14 18:57:29 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
usage () {
|
2011-12-14 00:16:09 +00:00
|
|
|
printf '%s: usage: %s TEST_DIR OUTPUT_DIR CEPH_BUILD_TARBALL\n' "$(basename "$0")" "$(basename "$0")" 1>&2
|
2011-06-14 18:57:29 +00:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_DIR=$1
|
|
|
|
OUTPUT_DIR=$2
|
2011-12-14 00:16:09 +00:00
|
|
|
CEPH_TARBALL=$3
|
2011-06-14 18:57:29 +00:00
|
|
|
|
2011-12-14 00:16:09 +00:00
|
|
|
if [ -z "$TEST_DIR" ] || [ -z "$OUTPUT_DIR" ] || [ -z "$CEPH_TARBALL" ]; then
|
2011-06-14 18:57:29 +00:00
|
|
|
usage
|
|
|
|
fi
|
|
|
|
|
|
|
|
SHA1=`cat $TEST_DIR/ceph-sha1`
|
|
|
|
|
|
|
|
mkdir -p $OUTPUT_DIR/ceph
|
|
|
|
|
|
|
|
echo "Retrieving source and .gcno files..."
|
2012-03-02 18:55:19 +00:00
|
|
|
wget -q -O- "https://github.com/ceph/ceph/tarball/$SHA1" | tar xzf - --strip-components=1 -C $OUTPUT_DIR/ceph
|
2011-12-14 00:16:09 +00:00
|
|
|
tar zxf $CEPH_TARBALL -C $OUTPUT_DIR
|
2011-06-14 18:57:29 +00:00
|
|
|
cp $OUTPUT_DIR/usr/local/lib/ceph/coverage/*.gcno $OUTPUT_DIR/ceph/src
|
|
|
|
mkdir $OUTPUT_DIR/ceph/src/.libs
|
|
|
|
cp $OUTPUT_DIR/usr/local/lib/ceph/coverage/.libs/*.gcno $OUTPUT_DIR/ceph/src/.libs
|
|
|
|
rm -rf $OUTPUT_DIR/usr
|
2011-10-20 23:28:29 +00:00
|
|
|
# leave ceph tarball around in case we need to inspect core files
|
2011-06-14 18:57:29 +00:00
|
|
|
|
|
|
|
echo "Initializing lcov files..."
|
|
|
|
lcov -d $OUTPUT_DIR/ceph/src -z
|
|
|
|
lcov -d $OUTPUT_DIR/ceph/src -c -i -o $OUTPUT_DIR/base_full.lcov
|
|
|
|
lcov -r $OUTPUT_DIR/base_full.lcov /usr/include\* -o $OUTPUT_DIR/base.lcov
|
|
|
|
rm $OUTPUT_DIR/base_full.lcov
|
|
|
|
echo "Done."
|