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
This commit is contained in:
Simon Marchi 2020-06-09 23:14:46 -04:00
parent f5163fdc3c
commit cab5c3b707
2 changed files with 16 additions and 9 deletions

View File

@ -1,3 +1,8 @@
2020-06-09 Simon Marchi <simon.marchi@polymtl.ca>
* gdb.base/index-cache.exp (test_cache_disabled): Add test_prefix
parameter, update callers.
2020-06-04 Simon Marchi <simon.marchi@efficios.com>
* gdb.dwarf2/share-psymtabs-bt.exp: New file.

View File

@ -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"