Solution is while building the test in which directory you were, you should be in the same directory while running gcov later, then all the .gcov
files will be created successfully.
For example:
Project directory : android/frameworks/Myproj
In this you have test.cpp
and Android.mk
Then say suppose from android directory you'll build the app
or test.cpp
, i.e. android$
Then the *.gcno
files will be present in android/out/Myproj_Intermediates/
You will get the *.gcda
files by running app
in device, you will bring that *.gcda
files from device to folder android/out/Myproj_intermediates/
Now to run gcov
on these:
You should be in the android directory (since you built app from there)
android$ ./prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-gcov \
-o out/Myproj_intermediates/ -a frameworks/Myproj/test.cpp -b -c