I'm using Eclipse CDT and Boost.Test(with Boost.Build).
I would like Eclipse to parse output of Boost.Test generated during by run of test suites during build.
Does anybody know how to achieve this?
Thanks in advance
Go to Window > Preferences. In the preferences dialog, choose C/C++ > Build from the options tree. Under error parsers, click "Add..." In the new dialog, replace "Regex Error Parser" with something like "Boost Unit Test Error Parser".
In the Error Parser Options pane, add the following lines. I can't guarantee that these rules catch all possible output from boost unit tests, but so far they work for me, and we can always add more later:
Severity | Pattern | File | Line | Description
Error | (.*)\((\d*)\): ((fatal )?error in ".*":.*) | $1 | $2 | $3
Error | \*\*\* (\d* failures detected in test suite ".*")| | | $1
Info | (.*)\((\d*)\): (last checkpoint) | $1 | $2 | $3
Note that the new parser will not automatically be used in existing projects. To enable the parser for an existing project, go to Project > Properties, C/C++ Make Project, Error Parsers tab. If the newly added parser is not in the list, click "Restore Defaults", and it should now be available.
There is also a nice plugin called cdt c/c++ tests runner, which supports Google test, boost test, and qt test.
You can find instructions at the following link:
https://github.com/xgsa/cdt-tests-runner/wiki/Tutorial
I have been using it for a while, and found it efficient and nice. It has features like a JUnit plugin for Java.
I had the same problem of my IDE (gedit) not recognizing the output format of Boost.Test (which is not compatible with gnu and clang output for some reason).
You can change the output format programmatically by sticking this in your test(s):
#include<boost/test/output/compiler_log_formatter.hpp>
struct gedit_config{
struct formatter : boost::unit_test::output::compiler_log_formatter{
void print_prefix(std::ostream& out, boost::unit_test::const_string file, std::size_t line){
out<< file <<':'<< line <<": ";
}
};
gedit_config(){boost::unit_test::unit_test_log.set_formatter(new formatter);}
};
BOOST_GLOBAL_FIXTURE(gedit_config);
(original answer here: https://stackoverflow.com/a/64619245/225186)
Related
Eclipse expert help needed! I have set up a makefile project to compile and link HCS12 code using the free codewarrior tools. It all seems to work well, but the only error/warning/information output I can get is to the console, with nothing being scanned from the console into the Problems window. I set up a regular expression error parser(Window -> Preferences -> C/C++ -> Build -> Settings -> Error Parsers) to scan the console for the appropriate information. If I search the console output (click in output and F) using find/replace with "regular expressions" checked, I find the warnings and errors--they just never get to the Problems tab.
I have enabled the error parser in (Project->Properties->C/C++ Build->Settings->ErrorParsers).
Somewhere I read that I need to enable this in C/C++ Makfile settings--but I cannot fine any settings which include the name "Makefile"; did I set up my project wrong??
Any suggestions or ideas on how to get my parsed errors into the problems window?
Eclipse Luna, Windows 7 professional.
It seems that the Regex parser for Eclipse (at least the older version I am currently using) assumes you start at the beginning of a line of text and end at the end of a line of text. My compiler errors were spanning multiple lines; I found a switch in the compiler which allowed it to output the errors in "microsoft format", which was then on a single line.
the new warning line looks like
.\CODE\LIBCODE\CodeLibraries\Drivers\CI2C1.C(312): WARNING C1801: Implicit parameter declaration for 'CI2C1_OnMasterBlockSent'
regex that works is now
[^"\n]\([^"(])((\d+)): WARNING C(\d+):([^\n]*)
of particular note is the [^"\n]*\ at the beginning of the regex expression, which matches all characters from the beginning of the line until the last \ is found--this is the piece I was missing. Eclipse Kepler is rather unforgiving about the regex it requires.
and we have
File $1 (just the file name--eclipse adds the path mysteriously if the file is in a code directory of the project)
Line $2 (gathers the line number of the error)
Descrioption $4 ( I ignore WARNING and the warning number, and capture the description of the error to the end of the line)
I now have a useful and somewhat more modern IDE to work with ancient code which grew from the assembly code over many years and was never parsed out into libraries or restructured into modern levels of abstraction.
WebStorm is showing the following error message:
JSHint: 'let' is available in ES6 (use 'esversion': 6) ...
In the Preferences -> Languages & Framework -> JavaScript menu I've selected the ECMAScript 6 option and my .jshintrc file does contain the "esversion": 6, line.
I've tried the two most recent versions of the app (which are now 2016.3.6 and 2017.1.2) but to no avail.
I've also deleted the files in ~/Library/Application Support/WebStormXX and
~/Library/Preferences/WebStormXX but nothing seems to have changed.
I'm using OS X 10.10.5.
Thanks to #lena's comment I was able to figure out what was wrong. The Use config file checkbox of the Preferences | Languages & Frameworks | JavaScript | Code Quality Tools | JSHint was not checked so my .jshintrc was just being ignored.
If you don't have your own config file, you can enable EcmaScript.next in Relaxing options in in
Settings | Languages & Frameworks | JavaScript | Code Quality Tools |
JSHint
See this question How-do-I-resolve-these-JSHint-ES6-errors
I'd probably recommend a more feature rich editor like vim
I am using WebStorm 2017.1.3 on Fedora 25.
I have fish set up as my default shell and installed oh-my-fish so in
Terminal I see my git branch and other information by default. omf update runs as expected.
In the WebStorm terminal emulator I still get fish, but not omf:
user#host ~> omf
fish: omf: command not found...
I'm a noob fish and omf user, can anyone help?
Thanks.
I have fish set up as my default shell and installed oh-my-fish so in Terminal I see my git branch and other information by default.
Note that you don't need omf for this. Fish ships a number of prompts that include vcs information. You can pick one with fish_config or add the __fish_vcs_prompt function to your fish_prompt.
In the WebStorm terminal emulator I still get fish, but not omf:
user#host ~> omf
fish: omf: command not found...
The "omf" function is stored in a file named "omf.fish" in a directory in $fish_function_path. This means that directory isn't included there.
The way omf works in a reasonably current (> 2.3.0) fish is that it has a bootstrap file (~/.config/fish/conf.d/omf.fish) that then sources the rest. It seems this isn't run.
I'd suggest you compare the values of $fish_function_path, $OMF_PATH and possibly $XDG_DATA_HOME in webstorm and outside of it.
An answer was given here: IntelliJ's embedded terminal does not load fish functions. I.e, add some lines of code to the app for the time being (until Jetbrains makes a fix).
I fixed this by going to Settings | Terminal then turning off Shell integration.
This allowed me to run omf and also have the bobthefish theme work with powerline/nerd fonts (after updating the terminal font at Settings | Editor | Color Scheme | Font Console)
I was using phpStorm 2017.3.4 but I assume this will also work in any IntelliJ embedded terminal.
we're using xcodebuild for some Jenkins CI tasks.
We have an error that stops the build, but can't see what it is because xcodebuild limits the log length to the first 200 notices:
Showing first 200 notices only
** TEST FAILED **
Is there a way to remove the 200 notice limit? We know we can do this in Xcode using the UI, but need to be able to do it from the command line with xcodebuild
Just use xcodebuild cli.
In Jenkins set "invoke script" step with following content:
xcodebuild clean test -project SOMEPROJECT.xcodeproj -scheme SOMECHEME -destination 'name=iPhone 6,OS=9.1'
You can basically do this in one of the following ways:
a. Add this in your configuration files. OTHER_CFLAGS (Other C Flags)
e.g. OTHER_CFLAGS=-ferror-limit=0
b. GCC_PREPROCESSOR_DEFINITIONS (Preprocessor Macros)
c. INFOPLIST_PREPROCESSOR_DEFINITIONS (Info.plist Preprocessor Definitions)
If in Xcode you want to try, Select Show the issue navigator in left side pane ,select the target, if you have any linker warning or Dsymutil Warning , click anyone of that, you should be able to see the list of all the warning, filter it with by selecting "ALL" and "ALL Issues" in right side pane. You will now be able to see total warnings with details.
So, I'm using Xcode to program with C++. I want to access the C++ tool but I'm having this problem.
This is what it looks like when opening a new project. Only for me, I don't have the 'Command Line Utility' option at the end.
alt text http://img.skitch.com/20100305-gsab76ef7bkx5ihwwj94cui39t.jpg
How can I get the 'Command Line Utility' option to be available. I need it to access the C++ tool.
Please and thank you!
If you're on a reasonably current version of Xcode (e.g. 3.2.2) then the selection process is slightly different - you need Application -> Command Line Tool and then select C++ stdc++ from the popup menu.
I have Xcode v3.2
I find the command line utility under File > New Project > (Mac OS X) Application > Command Line Tool (in right pane). When you click on Command Line Tool in right pane you will see a drop down box that lets you select the language you want to use. Mine defaults to C but there is an option for "C++ stdc++".