Git Product home page Git Product logo

luacodecoverage's Introduction

LuaCodeCoverage

Lua 代码覆盖率运行时统计工具

使用方法

  1. 导入模块
require "CodeCoverage" 
  1. 执行Hook
-- Jeff_CodeCoverage.LINE_COVERAGE_MODE 行覆盖率统计
-- Jeff_CodeCoverage.FUNC_COVERAGE_MODE 函数覆盖率统计
-- StartHook 第二个参数设置为true将实时输出行或函数覆盖的执行流数据
Jeff_CodeCoverage.StartHook(Jeff_CodeCoverage.FUNC_COVERAGE_MODE)
  1. 必要的时候调用停止结束统计
Jeff_CodeCoverage.StopHook()
  1. 这样就会生成一个xxx.luacoverage.txt的统计文件。注意此文件仅记录了执行过的代码。
  2. 通过写一个脚本工具获取总代码行数或者函数总数,然后通过已执行/总数得到覆盖率。

luacodecoverage's People

Contributors

memolp avatar

Stargazers

hoopa avatar  avatar 超级大蘑菇头 avatar  avatar  avatar Jack avatar wuzhang avatar  avatar

Watchers

 avatar

Forkers

hengle dragonlau

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.