lcov genhtml 'no data found' issue - profiling

I am using the latest version of lcov downloaded from here http://ltp.sourceforge.net/coverage/lcov.php on Windows 10. I am able to generate .gcda, .gcno, and .info files that appear valid. Also, when I run gcov, it outputs a valid .gcov file. However, when I run genhtml on the .info file, I get the following output:
C:\Users\Yuxin Zhou\Documents\work\gcov_test>genhtml.pl coverage.info
Reading data file coverage.info
Found 1 entries.
No common filename prefix found!
Writing .css and .png files.
Generating output.
Writing directory view page.
Overall coverage rate:
lines......: no data found
functions..: no data found
Here is my batch file:
gcc -O0 --coverage test.c -o test.exe
test.exe
gcov test.c
lcov.pl -o coverage.info -c -d "C:\Users\Nick\Documents\work\gcov_test"
genhtml.pl coverage.info --output-directory html
Here's the output from gcov:
-: 0:Source:test.c
-: 0:Graph:test.gcno
-: 0:Data:test.gcda
-: 0:Runs:1
-: 0:Programs:1
-: 1:#include <stdio.h>
-: 2:
1: 3:int happy_now(int x)
-: 4:{
1: 5: return x + 2;
-: 6:}
-: 7:
1: 8:int main()
-: 9:{
1: 10: int x = happy_now(3);
-: 11:
1: 12: if(x == 0)
-: 13: {
#####: 14: printf("hello world\n");
-: 15: }
-: 16: else
-: 17: {
1: 18: printf("goodbye world\n");
-: 19: }
-: 20:}
Why do I get
Overall coverage rate:
lines......: no data found
functions..: no data found
?

Related

Issue with Shotgun Gem in Ruby

I am having an issue connecting to the server using the shotgun GEM in ruby. Here is the error I get.
Can someone identify the issue here? Is it with the command I typed, or possibly something else? I have previously had issues with attempting to install the Ruby Bundle to run this lab. I had had assistance in troubleshooting that issue, but there still seems to be a possible issue with the GEM.
Antonio#MacBook-Pro sinatra-shotgun-server % rackup app.rb
Traceback (most recent call last):
22: from /Users/Antonio/.rvm/gems/ruby-2.6.1/bin/ruby_executable_hooks:24:in <main>' 21: from /Users/Antonio/.rvm/gems/ruby-2.6.1/bin/ruby_executable_hooks:24:in eval'
20: from /Users/Antonio/.rvm/gems/ruby-2.6.1/bin/rackup:23:in <main>' 19: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems.rb:297:in activate_bin_path'
18: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems.rb:297:in synchronize' 17: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems.rb:299:in block in activate_bin_path'
16: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems.rb:236:in finish_resolve' 15: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/request_set.rb:435:in resolve_current'
14: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/request_set.rb:423:in resolve' 13: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver.rb:192:in resolve'
12: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver/molinillo/lib/molinillo/resolver.rb:42:in resolve' 11: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:64:in resolve'
10: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:106:in start_resolution' 9: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:165:in initial_state'
8: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb:51:in sort_dependencies' 7: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb:69:in with_no_such_dependency_error_handling'
6: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb:52:in block in sort_dependencies' 5: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver.rb:279:in sort_dependencies'
4: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver.rb:279:in with_index' 3: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver.rb:279:in sort_by'
2: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver.rb:279:in each' 1: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver.rb:285:in block in sort_dependencies'
/Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver.rb:235:in `search_for': Unable to resolve dependency: user requested 'did_you_mean (= 1.3.0)' (Gem::UnsatisfiableDependencyError)
Antonio#MacBook-Pro sinatra-shotgun-server %

Permission denied # rb_sysopen - /home/david/geofly/config/initializers/sorcery.rb (Errno::EACCES)

I am trying to install omniauth for sorcery. When I run:
rails g sorcery:install external --migrations
gsub config/initializers/sorcery.rb
Traceback (most recent call last):
24: from bin/rails:4:in <main>'
23: from bin/rails:4:inrequire'
22: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-4.2.10/lib/rails/commands.rb:17:in <top (required)>'
21: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:39:inrun_command!'
20: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:50:in generate'
19: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:130:ingenerate_or_destroy'
18: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:123:in require_command!'
17: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:274:inrequire'
16: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:240:in load_dependency'
15: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:274:inblock in require'
14: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:274:in require'
13: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-4.2.10/lib/rails/commands/generate.rb:13:in'
12: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-4.2.10/lib/rails/generators.rb:157:in invoke'
11: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/base.rb:466:instart'
10: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/group.rb:232:in dispatch'
9: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:ininvoke_all'
8: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in map'
7: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:ineach'
6: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in block in invoke_all'
5: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:ininvoke_command'
4: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in run'
3: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sorcery-0.8.6/lib/generators/sorcery/install_generator.rb:31:inconfigure_initializer_file'
2: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/actions/file_manipulation.rb:265:in gsub_file'
1: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/actions/file_manipulation.rb:265:inopen'
/home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/actions/file_manipulation.rb:265:in `initialize': Permission denied # rb_sysopen - /home/david/geofly/config/initializers/sorcery.rb (Errno::EACCES)
I rolled back all migrations and deleted files in db/migrate.
Started fresh with sorcery install guide on wiki.
When migrating, I tried to overwrite files, which resulted in (Errno::EACCES), so I simply manualually deleted these files.
i ran rake db:drop, rake: db:create rake db:migrate.
The production database failed to drop, so I dropped it from termianl with mysql. So far the migrations are working and I successfully migrated SorceryExternal.

Sierra, cpp command throwing 'iostream' file not found

I'm following a tutorial on my macbook pro with Sierra and Xcode9.0.1
I compiled the following hello world code with g++ without problems.
#include <iostream>
main() {
using namespace std;
cout << "Hello, World!" << endl;
}
But when I execute
cpp hello.cxx | more
as required by the tutorial, I got the following error message:
hello.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
^~~~~~~~~~
1 error generated.
# 1 "hello.cpp"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 330 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "hello.cpp" 2
Since you have a working g++ compiler, you may use the following command line for getting the preprocessed output:
g++ -E hello.cxx | more
The -E option instructs the compiler driver to execute the preprocessor and emit the preprocessed output.

Installing RLdev tools on Linux

When installing Haeleth's RLdev I got the error:
$ ./configure && omake
........
File "pa_matches.ml", line 24, characters 2-6:
Parse error: Deprecated syntax, the grammar module is expected
Error while running external preprocessor
Command line: camlp4 pa_o.cmo pa_op.cmo pa_extend.cmo q_MLast.cmo pr_dump.cmo 'pa_matches.ml' > /home/.../tmp/ocamlpp4e8738
*** omake error:
File rlc/OMakefile: lines 26:4-27:88
command terminated with code 2: ocamlc -c -pp 'camlp4 pa_o.cmo pa_op.cmo pa_extend.cmo q_MLast.cmo pr_dump.cmo' -I /usr/lib/ocaml/camlp4 gramlib.cma pa_matches.ml -o pa_matches.cmo
File pa_matches.ml contains only following code:
Line 22: open Pcaml
Line 23: EXTEND
Line 24: expr: LEVEL "expr1"
Line 25: [[ v = expr; "matches"; p = patt -> <:expr< match $v$ with [ $p$ -> True | _ -> False ] >> ]];
Line 26: END
In the INSTALL file specified OCaml version 3.09 but 4.01 installed.
OCaml 3.09 is incompatible to OCaml 4.01. This especially applies to camlp4. With OCaml 3.10 a new, backward incompatible version of camlp4 was introduced.
That's probably the reason, why pa_matches.ml doesn't compile. It uses the old camlp4.

Could not open include file error

I am trying to compile a C++ application on SUN server using the compiler Sun C++ 5.9 SunOS_sparc Patch 124863-01.However i am getting an compilation errror saying that the compiler could not include header file.However the header file exist on the same folder and on the specified path/
CC -Dbcc9 -Dsun10 -I/export/home/bcc/bb1/bccprod/bb/compilation/bh/bh_xx_1_70_1 -DENV_OPT -DENV_OPT -D_XOPEN_SOURCE -D_XOPEN_VERSION=4 -D__SUN -Dsun -Dsparc -DSunOS53 -DCONFIG_64BIT -DNEW_ANSI -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS -I/export/home/bcc/bb1/bccprod/bb/compilation/opt_nc/hpux11.x/generic/include -DSHARED_EXT=\"so\" -DF257054 -I/export/home/bcc/bb1/bccprod/bb/LHS_TOOLS/product/JTG/prod/bcc/batch/src/dxlib/include -I/export/home/bcc/bb1/bccprod/bb/LHS_TOOLS/product/JTG/prod/bcc/batch/src/udrlib/include -I/export/home/bcc/bb1/bccprod/bb/LHS_TOOLS/product/JTG/prod/bcc/batch/src/bat++/include -Dbcc_CONFIG -I/export/home/bcc/bb1/bccprod/bb/LHS_TOOLS/product/JTG/prod/bcc/batch/src/bat/include -DF227344_CR102 -DF267107 -DF267107_d -DF268560 -DG_SUN -DG_EH -I/export/home/bcc/bb1/bccprod/bb/compilation/opt_nc/hpux11.x/generic/include -DDEBUG -DORACLE_DB_BRAND -I/u01/app/oracle/product/10.2.0/db_1/precomp/public -I/u01/app/oracle/product/10.2.0/db_1/rdbms/public -I/u01/app/oracle/product/10.2.0/db_1/rdbms/demo -I/u01/app/oracle/product/10.2.0/db_1/plsql/public -I/u01/app/oracle/product/10.2.0/db_1/network/public -DF_TAP_311 -DF_LCS_310 -DF_RAP_103 -g -DCONTRACT_DETAILS -DCREDIT_DISPLAY -DSORT_BILLS -DSPLIT_BILL -DD_ROAMING -DSWAP_DATES -DFIXLASADDR -DFIXUSERID -DFIXBIGAMT -DNOPRINTZEROINV -DFIXIPBXDISP -DARABTRANS -DFIX_MKRTTEXT -DOCCDESC -DFIXBARCODE -DNEWTAX8 -DCARRY_OVER -I./include -I/export/home/bcc/bb1/bccprod/bb/LHS_TOOLS/product/JTG/prod/bcc/batch/src/bh/include -I/export/home/bcc/bb1/bccprod/bb/LHS_TOOLS/product/JTG/prod/bcc/batch/src/bat/include -I/export/home/bcc/bb1/bccprod/bb/LHS_TOOLS/product/JTG/prod/bcc/batch/src/bat++/include -I/export/home/bcc/bb1/bccprod/bb/compilation/opt_nc/hpux11.x/generic/include -I/export/home/bcc/bb1/bccprod/bb/compilation/opt_nc/hpux11.x/xalan/include -I/export/home/bcc/bb1/bccprod/bb/compilation/opt_nc/hpux11.x/xerces/include -I/usr/include -DSOLARIS -D_XOPEN_SOURCE -D_XOPEN_VERSION=4 -D__SUN -Dsun -Dsparc -DSunOS53 -DCONFIG_64BIT -DNEW_ANSI -D__EXTENSIONS__ -DF_TAP_311 -DF_LCS_310 -DF_RAP_103 -m64 -DNEW_ANSI -DG_ANSICPP -DG_LONGSIZE=64 -DGEN_INCIMP -w -KPIC -g -xs -c bhComponentController.cpp -o bhComponentController.o
"**./include/bhComponentController.hpp", line 20: Error: Could not open include file "ComponentController.hpp"**
"./include/bhComponentController.hpp", line 183: Error: ComponentController is not defined.
"./include/bhTerminationHandler.hpp", line 107: Error: Could not open include file "TerminationHandler.hpp".
"./include/bhTerminationHandler.hpp", line 113: Error: TerminationHandler is not defined.
"bhComponentController.cpp", line 47: Error: The function "setTerminationHandler" must have a prototype.
"bhComponentController.cpp", line 70: Error: The function "strcat" must have a prototype.
"bhComponentController.cpp", line 73: Error: The function "strcat" must have a prototype.
"bhComponentController.cpp", line 76: Error: The function "strcat" must have a prototype.
"bhComponentController.cpp", line 79: Error: The function "strcat" must have a prototype.
9 Error(s) detected.
gmake: *** [bhComponentController.o] Error 9
The error is saying
"Error:l Could not open include file "ComponentController.hpp"
however the file ./include/bhComponentController.hpp is there and readable on the specified location.
Any idea please?
add this one too -I/export/home/bcc/bb1/bccprod/bb/compilation/bh/bh_xx_1_70_1/include assumin g your sources are there.
or
I/pathtoyoursources/ #this is where bhComponentController.hpp is.
SO that you can include"bhComponentController.hpp" directly.