Output color code of Gcov with Cobertura - jenkins

I have set gcov code coverage tools on Jenkins.
This works fine, but I have troubles undertanding the ouput color code.
The number of 'hits' of each line is corect, but some line are green when others are red, and I can't tell why.
Example :
Note that the setYear method is all green, and called 13 times (ctor + 12 times in setDateAAMMJJ as you can see on the screen cap)

If you look at the source code for the cobertura-plugin on github you will see that:
table.source tr.coverPart td.hits, table.source tr.coverNone td.hits {
background-color: #fdd;
font-weight: bold;
}
and
table.source tr.coverPart {
background-color: #ffd;
}
#fdd is the red color,
#ffd is the yellow color
You should be able to use your browser 'developer tools' or 'inspector' function to see which class is applied.
What does it mean?
The yellow on the far left means the source code is covered partly, that means you probably don't have 100% coverage in the functions that are being called.
Another case I can think of (pure speculation at this point) is that some optimization is mangling your statement coverage; check your compilation flags.
If you kept the data (lcov files), you should be able to use genhtml to generate a report and compare.

Don't know if this applies for you but it seems relevant.
In my case it is red because branch cover is not 100%.
When generating an xml with gcovr it also adds branch cover data.
It is possible to cover all the lines but not cover all the branches.
Im having all kinds of problems with the branch cover.
Some are described in these posts.
Why gcc 4.1 + gcov reports 100% branch coverage and newer (4.4, 4.6, 4.8) reports 50% for "p = new class;" line?
What is the branch in the destructor reported by gcov?
Still looking for a way to solve issues like these..

Related

Why Cocos Creator engine file is not called on the browser?

Non-Latin characters are not truncated properly so I modified the fragmentText() function to truncate on white space. file is in:
"C:\CocosCreator\resources\engine\cocos2d\core\label\CCTextUtils.js"
fragmentText: function (stringToken, allWidth, maxWidth, measureText) {
return "function called";
}
The problem is that I see the changes in Cocos Creator editor and the text is truncated as I want, but I see no effect on the browser as the function is never called.
Why the function is not called when I build?
P.S: I use Cocos Creator 1.10 but also have 2.1.1 installed in C:\CocosCreator_2.1.1
I guess you forget to recompile the engine.
Check the step 1.3 on the website and try again.
1.3 Change and Build

Why does the search results change after PDF optimization in Ghostscript?

When searching for the word find in the PDF file in this Link before Ghostscript optimization the results will give pages number 4,7 and 13 but after the optimization it gives only pages 4 and 13 ignoring page number 7, the script im using for the optimization :
D:/gswin64c -sDEVICE=pdfwrite -dMaxSubsetPct=100 -dAutoRotatePages=/None -dMaxInlineImageSize=0 -dPDFSETTINGS=/ebook -dColorImageResolution=96 -dDetectDuplicateImages=true -dColorImageDownsampleThreshold=1.1 -dDOPDFMARKS -dUseTrimBox -sOutputFile="D:/temp/search_text.pdf" -dNOPAUSE -dNOGC -dBATCH -dNumRenderingThreads=8 -c 50000000 setvmthreshold -f "D:/temp/iphone_user_guide.pdf"
I've tried to add several fonts related parameters to the script such as -dEmbedAllFonts=true and pointing to fonts path also I've tried to play with the parameters by eliminating some but with no result
what could be the cause of this problem?
Ghostscript doesn't do 'optimization'. See my answer here:
GhostScript issues with a CropBox
for some details on what it does do.
Wihtout seeing your file I cannot tell you for certain what the difference is, but most likely the missing text has been drawn as images instead of text for some reason.
By the way, a lot of the options you are sending have absolutely no effect (eg NumRenderingThreads, for a device which doesn't do rendering). You should NOT select -dNOGC, that's a really bad idea, -dDOPDFMARKS is already set for the pdfwrite device.

setting font-size in jquery-mobile

I am developing an app with jquery-mobile. (yes, and app, it'll run within cordova(aka phone gap))
On the nexus 7 (the target device for the app), The font displays for many things are way too small. I can barely read it and I'm young. Many of the users of this app will have poor eyesight.
Is there any simple way to change the font-size with jquery-mobile?
When I try to add entries in a custom css file, there are unexpected results (Formatting goes out, etc) I have also tried theme-roller, but that only allows you to change the font-family, not the font-size.
eg:
body p {
font-size: 1.5em;
}
Even just a general explanation about how to write a css file for jquery-mobile would be very helpful.
OK, I've worked it out.
In the jquery-mobile-1.2.0.css file is the styling for query-mobile. You modify this stuff.
There's some cryptic info on the jquery-mobile website that will make sense once you've read this.
So, to change the font-size for within all you go to the jquery-mobile-1.2.0.css file and add:
.ui-li p {
font-size: 1.5em;
}
It seams that most of the jquery-mobile elements have .ui- in from of their normal html tags. They have a special class or something. (If anyone wants to elaborate on this it'd be great.)
Setting global <body>'s font-size should be enough:
body {
font-size: 15px; // You can even use !important
}

Mantis bugnotes formatting

Is it possible to format bugnotes(comments) entered in Mantis bug tracker for an issue ?
I am using Mantis v1.0.8
e.g.
"sample mantis bug notes"
which appears as plain text.
I would like to make it bold or to display in different color
e.g. similar to https://stackoverflow.com/editing-help
does any other bug tracking system allow such feature ?
As it was said by Gawcio and mhu, the list is limited and in current mantis 1.2.15 use of following tags is allowed in description and other multi-line fields: <p>, <li>, <ul>, <ol>, <br>, <pre>, <i>, <b>, <u>, <em>, <strong>.
Additionally, following tags are allowed in summary and other single-line fields (e.g. OS or Platform): <i>, <b>, <u>, <em>, <strong>. That's funny to have some emphasis in issue summary, right? :)
What is not explicitly said, is that these lists are customizable. Unfortunately, they are so-called global settings, so they can't be set using web interface, but if you have a possibility of tweaking the installed mantis code, you can modify the <mantis-doc-root>/config_inc.php file (which is purposed to be modified locally) and add following options there:
/**
* These are the valid html tags for multi-line fields (e.g. description)
* [...]
*/
$g_html_valid_tags = 'p, li, ul, ol, br, pre, i, b, u, em, strong, code';
/**
* These are the valid html tags for single line fields (e.g. issue summary).
* [...]
*/
$g_html_valid_tags_single_line = 'i, b, u, em, strong, code';
After server restart, you should be able to use the <code> tag in summary and description of your issues.
Unfortunately, mantis tags filters seem to disallow any tag attributes, so it won't be easy to allow free formatting. Personally, I have adjusted its style sheet to tweak the colour in which content of <pre> and <code> tags is displayed. To achieve it, you can edit the <mantis-doc-root>/css/default.css` file and add/adjust following rules:
pre { margin-top: 0px; margin-bottom: 0px; color: #0000CC; }
code { color: #0000CC; }
em > strong { color: #CC0000; }
This way your report may gain some colours :)
In Mantis one can use some of HTML tags (unfortunately not all are supported). From my experience (as I remember well) I've successfully used: <B>, <I>, <U>, <S> and lists, both ordered <OL><LI> and unordered (bullets): <UL><LI>. It makes notes and descriptions more readable.
Currently I'm using 1.1.8 version of Mantis but I was successfully using it in older version (prior to 1.0) - so yours should also handle that.
Overwrite Mantis (ver.<1.3) default configuration by using your personal config_inc.php file under <mantis-doc-root>/config/config_inc.php
You can overwrite all default settings in this config file. E.g. $g_html_valid_tags, $g_bug_view_page_fields, ... Just copy/paste the default values from <mantis-doc-root>/config_defaults_inc.php to your <mantis-doc-root>/config/config_inc.php file.

Looking for a more flexible tool than GNU indent

When I run indent with various options I want against my source, it does what I want but also messes with the placement of *s in pointer types:
-int send_pkt(tpkt_t* pkt, void* opt_data);
-void dump(tpkt_t* bp);
+int send_pkt(tpkt_t * pkt, void *opt_data);
+void dump(tpkt * bp);
I know my placement of *s next to the type not the variable is unconventional but how can I get indent to just leave them alone? Or is there another tool that will do what I want? I've looked in the man page, the info page, and visited a half a dozen pages that Google suggested and I can't find an option to do this.
I tried Artistic Style (a.k.a. AStyle) but can't seem to figure out how to make it indent in multiples of 4 but make every 8 a tab. That is:
if ( ... ) {
<4spaces>if ( ... ) {
<tab>...some code here...
<4spaces>}
}
Uncrustify
Uncrustify has several options on how to indent your files.
From the config file:
indent_with_tabs
How to use tabs when indenting code
0=spaces only
1=indent with tabs, align with spaces
2=indent and align with tabs
You can find it here.
BCPP
From the website: "bcpp indents C/C++ source programs, replacing tabs with spaces or the reverse. Unlike indent, it does (by design) not attempt to wrap long statements."
Find it here.
UniversalIndentGUI
It's a tool which supports several beautifiers / formatters. It could lead you to even more alternatives.
Find it here.
Artistic Style
You could try Artistic Style aka AStyle instead (even though it doesn't do what you need it to do, I'll leave it here in case someone else finds it useful).
Hack around and change its behavior editing the code. It's GNU after all. ;-)
As it's probably not the answer you wanted, here's another link: http://www.fnal.gov/docs/working-groups/c++wg/indenting.html.

Resources