[PATCH v2] gdb/testsuite: Regenerate the testglue if it is not in path

Simon Marchi simark@simark.ca
Wed Feb 19 03:10:00 GMT 2020


On 2020-02-18 6:51 a.m., Shahab Vahedi wrote:
> From: Shahab Vahedi <shahab@synopsys.com>
> 
> For running the  DejaGnu  tests,  some  esoteric  configurations
> may require a testglue.   This,  for  instance,  is  true  about
> testing ARC  targets  which  uses  its  own  DejaGnu  board  and
> a simulator which does not support returning the  pass  or  fail
> through the exit code.  Therefore,  for  those  tests  that  use

When you say "returning the pass or fail through the exit code", do
you mean the exit codes of the test programs (the value returned
by main)?  If so, it does not really mean "pass" or "fail", in a
testsuite sense.  In which case, it would be clearer to just say
"does not support returning the program's exit code".

I don't know what Tom was referring to when he talked about the cache
directory.  I see that the testsuite Makefile cleans a cache directory,
but I have no idea how things can end up there.  Tom, can you clarify?

It's great if you can manage to have it built only once, but just make
sure it's not racy, like:

1. Test 1 notices testglue.o is not there
2. Test 2 notices testglue.o is not there
3. Test 1 generates testglue.o
4. Test 2 starts to write testglue.o, deleting what was done in step 3,
   gets interrupted half-way
5. Test 1 tries to link the half-baked testglue.o in its executable and fails

An option to have it at a predictable absolute place would be to pass
the result of [standard_output_file testglue.o] to build_wrapper.
It would be rebuilt for each test, but it would make sure that tests
don't interfere with each other.

Simon



More information about the Gdb-patches mailing list