Re: How to use test-nlist

2019-05-24 Thread Mark Wielaard
On Fri, May 24, 2019 at 02:45:21PM +0800, Yu, Mingli wrote:
> And I noticed the source code and already run as "./test-nlist", but Seems
> it doesn't work as expected.
> # ./test-nlist
> # echo $?
> 1
> # ./test-nlist -d
> nl[0].n_name = "var"
> nl[0].n_value = 0
> nl[0].n_scnum = 0
> nl[0].n_type = 0
> nl[0].n_sclass = 0
> nl[0].n_numaux = 0
> [...]

Right. And that is because...

> > > For some reason your test-nlist doesn't have an .symtab.
> > > Make sure that when you build the tests CLFAGS contains -g.
> > > And the that test binary isn't accidentially stripped afterwards.

Make sure you fix that and the test will pass.

Cheers,

Mark


Re: [PATCH v2] skip the test when gcc not deployed

2019-05-24 Thread Mark Wielaard
Hi,

On Fri, May 24, 2019 at 02:47:25PM +0800, Yu, Mingli wrote:
> > On Tue, May 21, 2019 at 03:33:06PM +0800, mingli...@windriver.com wrote:
> > > Skip the tests which depend on gcc when
> > > gcc not deployed.
> > 
> > What exactly are you trying to do?
> > When would you run make check without having gcc installed?
> 
> Thanks Mark!
> I just run the check without having gcc installed, and of cource no compiler
> installed in my test env.

I don't think that is a realistic test environment for testing the
elfutils libraries. You have to have the tools to create various ELF
files and DWARF data to properly test things work correctly.

Cheers,

Mark


Re: [PATCH v2] skip the test when gcc not deployed

2019-05-24 Thread Yu, Mingli




On 2019年05月24日 15:03, Mark Wielaard wrote:

Hi,

On Fri, May 24, 2019 at 02:47:25PM +0800, Yu, Mingli wrote:

On Tue, May 21, 2019 at 03:33:06PM +0800, mingli...@windriver.com wrote:

Skip the tests which depend on gcc when
gcc not deployed.


What exactly are you trying to do?
When would you run make check without having gcc installed?


Thanks Mark!
I just run the check without having gcc installed, and of cource no compiler
installed in my test env.


I don't think that is a realistic test environment for testing the
elfutils libraries. You have to have the tools to create various ELF
files and DWARF data to properly test things work correctly.


Yes, we use elfutils in cross compile env, one works as build host which 
we build all the packages and of course gcc installed on the build host 
and another as target which only deployed the necessary packages which 
we have build on the build host.

And this is the case we just run the test on the target.

I think it make sense to check the gcc and make it skip if the cases 
depends on gcc.


Thanks,



Cheers,

Mark