This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch]: Improve spu-info testcase


Markus Deuling wrote:

> 	* gdb.arch/spu-info.exp (tmp_file): Introduce temporary file and set
> 	it as command line argument for test binary.  Delete after usage.
> 	* gdb.arch/spu-info.c (main): Receive command line arguments.
> 	(do_dma_test): Add file paramater.

Sorry for the late reply ...

> @@ -221,7 +218,10 @@ main (unsigned long long speid, unsigned
>    res = do_event_test ();
>  
>    /* info spu dma  */
> -  res = do_dma_test ();
> +  if (argc == 2)
> +    res = do_dma_test (argv[1]);
> +  else
> +    res = do_dma_test ("/var/tmp/tmp_buf");

I'd prefer this gets passed *always* as argument, and the .exp script
chooses the name ...

> +set tmp_file ""
> +if { [info exists env(PWD)] &&
> +     [info exists env(USER)] } then {
> +  set tmp_file $env(PWD)/gdb_spu_info_$env(USER)
> +  gdb_test "set args $tmp_file" "" ""
> +}

... because I think we should just use a name in the directory where
the tests execute anyway.  Other tests do it likewise (e.g. the corefile
tests).

>  gdb_test "info spu dma" \
> -	 "Tag-Group Status.*0x00000000.*Tag-Group Mask.*0x00000000.*Stall-and-Notify.*0x00000000.*Atomic Cmd Status.*0x00000000.*Opcode.*Tag.*TId.*RId.*EA.*LSA.*Size.*LstAddr.*LstSize.*E.*0.*0.*0.*0.*0x00000 0x00000.*" \
> +	 "Tag-Group Status.*0x00000001.*Tag-Group Mask.*0x00000001.*Stall-and-Notify.*0x00000000.*Atomic Cmd Status.*0x00000000.*Opcode.*Tag.*TId.*RId.*EA.*LSA.*Size.*LstAddr.*LstSize.*E.*0.*0.*0.*0.*0x00000 0x00000.*" \
>  	 "info spu dma (empty)"

> -	 "Tag-Group Status.*0x00000000.*Tag-Group Mask.*0x00000020.*Stall-and-Notify.*0x00000000.*Atomic Cmd Status.*0x00000000.*Opcode.*Tag.*TId.*RId.*EA.*LSA.*Size.*LstAddr.*LstSize.*E.*getl.*putllc.*get.*mfcsync.*get.*0.*0.*0.*0.*0x00000 0x00000.*" \
> +	 "Tag-Group Status.*0x00000001.*Tag-Group Mask.*0x00000020.*Stall-and-Notify.*0x00000000.*Atomic Cmd Status.*0x00000000.*Opcode.*Tag.*TId.*RId.*EA.*LSA.*Size.*LstAddr.*LstSize.*E.*getl.*putllc.*get.*mfcsync.*get.*0.*0.*0.*0.*0x00000 0x00000.*" \
>  	 "info spu dma (non-empty)"

This seem to be unrelated changes;  are they deliberate?
If so, they need to be mentioned in the ChangeLog.

> +if { [file exists $tmp_file] } then {
> +  file delete $tmp_file
> +}

This will not work for remote tests; you should use 
remote_file build delete
like e.g. corefile.exp does.


Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]