rmbishop / tinycover Goto Github PK
View Code? Open in Web Editor NEWC source MCDC instrumentation and coverage report generation tool
License: Other
C source MCDC instrumentation and coverage report generation tool
License: Other
int f(int n, int a[restrict n]) works fine.
int f(int n, int a[__restrict n]) fails to parse.
int f(int n, int a[__restrict__ n]) fails to parse.
#pragma DISABLE_COVERAGE should prevent parsing of code, which could future-proof the tool against code that doesn't parse well
if (!(idx == 1))
{
}
Should be instrumented to this:
if ((INST_SINGLE(0,1,!(idx == 1))))
{
}
but is currently instrumented to this:
if (!(INST_SINGLE(0,1,(idx == 1))))
{
}
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')
http://www.testcocoon.org/download.html
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
Add support for _Static_assert.
size_t fails to parse correctly. Add support for size_t.
Html reports should be generated, either optionally or by default.
Need support for:
_Alignas
alignas
The parser fails when it sees "__typeof".
"typeof" works fine.
Support for "__typeof" should be added.
Add support for __bf16.
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 "}"
The following code will fail to parse:
__label__ l1, l2;
The >> operator is not properly handled, due to missing
found = true
within the shift_expression function.
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)))
{
}
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.
In tinycover_utils.lua, add
f:close()
after
local c_text = f:read("*all")
In the following example, the Line_Number in the report file is reported as 4, even though the decision starts on line 3.
int f(int a, int b)
{
if(a
&&
b)
{
return 1;
}
}
tinycover is missing support for the _Generic function right now.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.