From: Simon Marchi Date: Wed, 10 Jun 2020 03:14:46 +0000 (-0400) Subject: gdb/testsuite: fix duplicate test names in gdb.base/index-cache.exp X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cab5c3b707871395d1d1a8962c41ec05db1aeba8;p=binutils-gdb.git gdb/testsuite: fix duplicate test names in gdb.base/index-cache.exp Fix: DUPLICATE: gdb.base/index-cache.exp: test_cache_disabled: no files were created DUPLICATE: gdb.base/index-cache.exp: test_cache_disabled: check index-cache stats We use `proc_with_prefix` for test_cache_disabled, but we call it twice. So we need an additional prefix to identify the specific call. This patch adds that. gdb/testsuite/ChangeLog: * gdb.base/index-cache.exp (test_cache_disabled): Add test_prefix parameter, update callers. Change-Id: Idf382fd380c77a654e8a7aa236af50b65c96b1d2 --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 2a7779b4490..dd003656d14 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-06-09 Simon Marchi + + * gdb.base/index-cache.exp (test_cache_disabled): Add test_prefix + parameter, update callers. + 2020-06-04 Simon Marchi * gdb.dwarf2/share-psymtabs-bt.exp: New file. diff --git a/gdb/testsuite/gdb.base/index-cache.exp b/gdb/testsuite/gdb.base/index-cache.exp index 742983b19d4..29803902f04 100644 --- a/gdb/testsuite/gdb.base/index-cache.exp +++ b/gdb/testsuite/gdb.base/index-cache.exp @@ -119,16 +119,18 @@ proc_with_prefix test_basic_stuff { } { # Test loading a binary with the cache disabled. No file should be created. -proc_with_prefix test_cache_disabled { cache_dir } { - lassign [ls_host $cache_dir] ret files_before +proc_with_prefix test_cache_disabled { cache_dir test_prefix } { + with_test_prefix $test_prefix { + lassign [ls_host $cache_dir] ret files_before - run_test_with_flags $cache_dir off { - lassign [ls_host $cache_dir] ret files_after + run_test_with_flags $cache_dir off { + lassign [ls_host $cache_dir] ret files_after - set nfiles_created [expr [llength $files_after] - [llength $files_before]] - gdb_assert "$nfiles_created == 0" "no files were created" + set nfiles_created [expr [llength $files_after] - [llength $files_before]] + gdb_assert "$nfiles_created == 0" "no files were created" - check_cache_stats 0 0 + check_cache_stats 0 0 + } } } @@ -217,10 +219,10 @@ if { $ret != 0 } { # The ouput of mktemp contains an end of line, remove it. set cache_dir [string trimright $cache_dir \r\n] -test_cache_disabled $cache_dir +test_cache_disabled $cache_dir "before populate" test_cache_enabled_miss $cache_dir test_cache_enabled_hit $cache_dir # Test again with the cache disabled, now that it is populated. -test_cache_disabled $cache_dir +test_cache_disabled $cache_dir "after populate"