dongmeng9048 2014-01-14 23:10
浏览 13
已采纳

是否可以将多个包裹的承保范围发布到Coveralls?

I want to track test coverage on a go project using Coveralls, the instructions for the integration reference using https://github.com/mattn/goveralls

cd $GOPATH/src/github.com/yourusername/yourpackage
$ goveralls your_repos_coveralls_token

However, this only posts the results for one package and running for packages in turn does not work as the final run overwrites all other runs. Has anyone figured out how to get coverage for multiple packages?

  • 写回答

5条回答 默认 最新

  • dqm4977 2014-01-15 16:02
    关注

    I ended up using this script:

    echo "mode: set" > acc.out
    for Dir in $(find ./* -maxdepth 10 -type d );
    do
            if ls $Dir/*.go &> /dev/null;
            then
                go test -coverprofile=profile.out $Dir
                if [ -f profile.out ]
                then
                    cat profile.out | grep -v "mode: set" >> acc.out
                fi
    fi
    done
    goveralls -coverprofile=acc.out $COVERALLS
    rm -rf ./profile.out
    rm -rf ./acc.out
    

    It basically finds all the directories in the path and prints a coverage profile for them separately. It then concatenates the files into one big profile and ships them off to coveralls.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类