gdb/testsuite: fix duplicate test names in gdb.base/index-cache.exp
authorSimon Marchi <simon.marchi@polymtl.ca>
Wed, 10 Jun 2020 03:14:46 +0000 (23:14 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Wed, 10 Jun 2020 03:14:46 +0000 (23:14 -0400)
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

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/index-cache.exp

index 2a7779b449020c280d624bb0650ced71d8f61fdf..dd003656d14d2db9fb017c8d54fb96d8e925e55e 100644 (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.
index 742983b19d416ec43140d356aa817c6ebea2cf84..29803902f0448954ae7872ac5d84f9463488c379 100644 (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"
 
This page took 0.032204 seconds and 4 git commands to generate.