gcc -o should not include absoulte path under cygwin environment for gcov
-------------------------------------------------------------------------
Key: MOJO-953
URL: http://jira.codehaus.org/browse/MOJO-953
Project: Mojo
Issue Type: Improvement
Components: native
Environment: using gcc under cygwin in Windows for gcov
Reporter: Felix Wu
Priority: Blocker
Attachments: NativeCompileMojo.java
When using gcov, we need to compile and link C code with the following options
"-fprofile-arcs -ftest-coverage", then run the compiled executable to generated
the .gcda files for gcov to perform coverage analysis.
Then problems occurs when running executable compiled with native maven plugin
under cygwin gcc, because maven would insert the full path into -o option when
compiling
"-o c:\workspace\checkExample\unittest\target\checkhello.obj"
This path for some reason is stored in both cygwin unix format and windows
format, so when we run the executable, it tries to construct the path with two
platform and result is the below:
$ target/test.exe
Running suite(s): hello
profiling:/cygdrive/c/workspace/checkExample/unittest/c:\workspace\checkExample\unittest\target\checkhello.gcda:Cannot
open
profiling:/cygdrive/c/workspace/checkExample/unittest/c:\workspace\checkExample\unittest\target\main.gcda:Cannot
open
0%: Checks: 1, Failures: 1, Errors: 0
c:\workspace\checkExample\unittest\checkhello.c:6:F:Core:test_hello:0: returns
98
finished running hello test suite
profiling:/cygdrive/c/workspace/checkExample/unittest/c:\workspace\checkExample\unittest\target\checkhello.gcda:Cannot
open
profiling:/cygdrive/c/workspace/checkExample/unittest/c:\workspace\checkExample\unittest\target\main.gcda:Cannot
open
The workaround for this is to add a cygwin flag to define whether to use
absolute path or output to ./target/
patch is included.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email