Git Product home page Git Product logo

tinycover's People

Contributors

rmbishop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

mrx23dot

tinycover's Issues

a + (b && c) && d does causes tool crash

When the following code is parsed, the tool crashes:

int f(int a, int b, int c, int d)
{
    a + (b && c) && d;
}

The error that the tool generates is:

libtinycover.lua:1181: attempt to concatenate a nil value (local 'offset')

Compare performance to professional tool

http://www.testcocoon.org/download.html

TestCocoon usage.txt

for

#include <stdio.h>

#define DDDD 3
#define DD1DD 2
#define DDD3D 1




int main(int argc, char *argv[])
{

t0tttt(DD1DD);
t0tttt(DDD3D);
return 0;
}

void t0tttt(int i){

if (i == DD1DD || i == DDD3D )
{
i++;
printf("DD1DD\n");
}
}

void ttt1tt(void){

}

void ttt2tt(void){

}

void t3tttt(void){

}

it should report

c:\users\bence\desktop\testcocoon\test\hello.c:29:1 NOT EXECUTED:never executed: '}' 
c:\users\bence\desktop\testcocoon\test\hello.c:33:1 NOT EXECUTED:never executed: '}' 
c:\users\bence\desktop\testcocoon\test\hello.c:37:1 NOT EXECUTED:never executed: '}' 
c:\users\bence\desktop\testcocoon\test\hello.c:20:15 NOT EXECUTED:partially executed: 'i == 1' was not false

Issue handling \ in single statement blocks

The following valid program will be incorrectly instrumented:

int f1()
{
  int x = 0;
  if(1)
    x++;
\
}

This will become

#include <tc_inst_decl.h>
int doit()
{
  unsigned int tc_cov_offset_0, tc_temp_cond_0, tc_temp_dec_0;
  int x = 0;
  COV_STATEMENT(0);
  if(INST_SINGLE(0,1,(1)))
    {COV_STATEMENT(2);
    x++;
\}
}

Notice "\}". The \ is stray, and causes a parser error. Need to a newline before the inserted closing "}"

Boolean expression with cast expression fails to parse.

The following code fails to parse:

    if (a && ((int) (a && b)))
    {
    }

This generates the following error: libtinycover.lua:1181: attempt to concatenate a nil value (local 'offset')

Whereas the following code parses fine:

    if (a && ((a && b)))
    {
    }

Auto-generate a function for saving structural coverage

Basic function for saving structural coverage on a host target:

void dump_coverage(char *data_file_name)
{
    unsigned int i;

    FILE *out_file = fopen(data_file_name,"w");

    for(i = 0; i < TC_COVERAGE_ARRAY_LENGTH; i++)
    {
        fprintf(out_file,"%d\n",tc_coverage[i]);
    }

    fclose(out_file);
}

This will need to change for an embedded target that doesn't using the stdio.

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.