From 4d51e2b7864cff2c8352edb787f855e7513617c8 Mon Sep 17 00:00:00 2001 From: AN12345 Date: Mon, 21 Nov 2022 20:58:18 -0500 Subject: [PATCH] build: add coverage script --- combine_coverage.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 combine_coverage.sh diff --git a/combine_coverage.sh b/combine_coverage.sh new file mode 100755 index 00000000..00ba80b7 --- /dev/null +++ b/combine_coverage.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +escapedPath="$(echo `pwd` | sed 's/\//\\\//g')" + +if grep flutter pubspec.yaml > /dev/null; then + if [ -d "coverage" ]; then + # combine line coverage info from package tests to a common file + if [ ! -d "$MELOS_ROOT_PATH/coverage" ]; then + mkdir "$MELOS_ROOT_PATH/coverage" + fi + sed "s/^SF:lib/SF:$escapedPath\/lib/g" coverage/lcov.info >> "$MELOS_ROOT_PATH/coverage/lcov.info" + rm -rf "coverage" + fi +fi \ No newline at end of file