When the SCons build is running the current directory is the directory where
scons is executed. This can be overridden using the -C option which changes
current directory before searching for the SConstruct file.
Regards,
Søren

On Wed, Dec 17, 2008 at 12:05 PM, <[email protected]> wrote:

>
> Hi,
>
> I tried this and it works, gcda files are being generated.
>
> Could you tell me if when the Scons is executed are all gcc compile
> commands executed from the same directory from where the Scons file
> is. Essentially gcov must be called from the same directory as it
> mantains traces of relative paths to source files and object files
>
> Thanks
> Nipun
>
> On Dec 15, 4:50 am, Søren Gjesse <[email protected]> wrote:
> > Hi,
> >
> > It looks like it is the SAMPLE_FLAGS which are missing the options.
> Applying
> > the patch below caused my building of the sample shell (scons
> sample=shell)
> > to do
> >
> >   g++ -o obj/sample/shell/release/shell.o -c -fprofile-arcs
> > -ftest-coverage-O2 -m32 -Iinclude samples/shell.cc
> >   g++ -o shell -m32 obj/sample/shell/release/shell.o -L. -lv8 -lpthread
> > -lgcov
> >
> > ===================================================================
> > --- SConstruct  (revision 947)
> > +++ SConstruct  (working copy)
> > @@ -198,7 +198,8 @@
> >    },
> >    'gcc': {
> >      'all': {
> > -      'LIBS': ['pthread'],
> > +      'CCFLAGS': ['-fprofile-arcs', '-ftest-coverage'],
> > +      'LIBS': ['pthread', 'gcov'],
> >        'LIBPATH': ['.']
> >      },
> >      'os:freebsd': {
> >
> > Regards,Søren
> >
> > On Mon, Dec 15, 2008 at 10:33 AM, <[email protected]> wrote:
> >
> > > also there are 2 types of files generated for gcov these are .gcno
> > > while compiling and .gcda while running the tests.
> > > I already have .gcno compile time files... the problem is that a
> > > linker flag is not set some place...
> >
> > > -Nipun
> >
> > > On Dec 15, 4:15 am, [email protected] wrote:
> > > > Hi Soren
> >
> > > > Thanks for the quick response. This is the problem I am having. I am
> > > > probably missing out putting my coverage option some place.
> > > > Although most of the files are being executed with the-fprofile-arcs
> -
> > > > ftest-coverage option. Some of the files are not: each g++ option
> > > > should be executed with these options: -fprofile-arcs -ftest-coverage
> >
> > > > I can't find them in the output given by Scons starting from the
> > > > following lines....
> > > > g++ -o shell obj/sample/shell/release/shell.o -L. -lv8 -lpthread
> > > > obj/sample/shell/release/shell.o: In function `global constructors
> > > > keyed to 0_main':
> > > > shell.cc:(.text+0x2c06): undefined reference to `__gcov_init'
> > > > obj/sample/shell/release/shell.o:(.data+0x204): undefined reference
> to
> > > > `__gcov_merge_add'
> > > > ./libv8.a(api.o): In function `global constructors keyed to
> > > > 0__ZN2v88internal2V823FatalProcessOutOfMemoryEPKc':
> > > > api.cc:(.text+0x293ab): undefined reference to `__gcov_init'
> >
> > > > This is resulting in a build error.
> >
> > > > Could you help me out? I have my flags set in all the 3 u mentioned
> > > > earlier. which flags are used for these shells and libv8.a?
> >
> > > > Thanks
> > > > Nipun
> >
> > > > On Dec 15, 2:39 am, Søren Gjesse <[email protected]> wrote:
> >
> > > > > Hi,
> >
> > > > > All the flags for the different configurations are in the
> SConstruct
> > > file.
> > > > > There are different sections of flags, and the ones you are
> interested
> > > in
> > > > > are probably LIBRARY_FLAGS, CCTEST_EXTRA_FLAGS and SAMPLE_FLAGS.
> What
> > > is
> > > > > in LIBRARY_FLAGS is used to build the V8 library.
> CCTEST_EXTRA_FLAGS
> > > are
> > > > > used to build and link the cctest executable used to run all the
> tests
> > > > > written in C++. SAMPLE_FLAGS are used to build and link the shell
> > > sample
> > > > > used to run all the tests written in JavaScript.
> > > > > You should think of adding a new flag to the SCons build to control
> > > > > this (e.g scons coverage=on). Look for the SIMPLE_OPTIONS
> definition in
> > > the
> > > > > SConstruct file, and see how the flags are used to control the
> compiler
> > > and
> > > > > linker options.
> >
> > > > > When looking at coverage you should think of including the Mozilla
> > > tests.
> > > > > Seehttp://code.google.com/p/v8/wiki/Testingforhowto run them.
> >
> > > > > Please share your findings when done.
> >
> > > > > Regards,
> > > > > Søren
> >
> > > > > On Mon, Dec 15, 2008 at 3:39 AM, <[email protected]> wrote:
> >
> > > > > > Hi
> >
> > > > > > I was planning to use gcov for showing coverage using the tests
> > > > > > provided in V8 source code repository for a project I am doing. I
> was
> > > > > > wondering if someone could help me out? I need to change
> > > > > > configurations in the SConstruct file. The following arguments
> are
> > > > > > required for executing gcov.
> >
> > > > > > // The source files need to be compiled with the following
> arguments
> > > > > > gcc -fprofile-arcs -ftest-coverage
> >
> > > > > > and linked with -lgcov argument.....
> >
> > > > > > Could someone tell me what arguments do i need change in the
> > > > > > Sconstruct file to add these arguments.
> >
> > > > > > Thanks
> > > > > > Nipun Arora
> > > > > > Research Student
> > > > > > Columbia University
> >
> > > > > > PS. I would also appreciate if someone could direct me to
> > > instructions
> > > > > > on running the test cases, and any prerequisites for that... is
> there
> > > > > > any page with the testing documentation?
> >
>

--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to