Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Bernd Edlinger <bernd.edlinger@hotmail.de>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [PATCH] testsuite: Cleanup some temp dirs with gdb-index files
Date: Fri, 14 May 2021 15:20:10 +0200	[thread overview]
Message-ID: <AM8PR10MB4708C1B2AA338675E5E9B2F1E4509@AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM> (raw)

[-- Attachment #1: Type: text/plain, Size: 611 bytes --]

Hi,

I'd like to cleanup some files/directories which
remain after the gdb testsute runs.

I want to avoid using "rm -rf ..." since that can be dangerous.
Therefore I remove the *.gdb-index files, if any, and use
rmdir instead.  I am not sure if there is a better way,
instead of using "remote_exec host sh -c" to do the globbing.

Tested on x86_64-pc-linux-gnu.
Is it OK for trunk?


gdb/testsuite:
2021-05-14  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * gdb.base/index-cache.exp: Cleanup $cache_dir/*.gdb-index and
        remove the directory.
        * gdb.dwarf2/per-bfd-sharing.exp: Likewise.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-testsuite-Cleanup-some-temp-dirs-with-gdb-index-file.patch --]
[-- Type: text/x-patch; name="0001-testsuite-Cleanup-some-temp-dirs-with-gdb-index-file.patch", Size: 1624 bytes --]

From 044dafce200d87e5b0546111714f723e99a59594 Mon Sep 17 00:00:00 2001
From: Bernd Edlinger <bernd.edlinger@hotmail.de>
Date: Fri, 14 May 2021 14:53:19 +0200
Subject: [PATCH] testsuite: Cleanup some temp dirs with gdb-index files

After the gdb test-suite runs there are some files
left in /tmp/tmp*/*.gdb-index, remove those files
and the directory at the end of the test case.

gdb/testsuite:
2021-05-14  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* gdb.base/index-cache.exp: Cleanup $cache_dir/*.gdb-index and
	remove the directory.
	* gdb.dwarf2/per-bfd-sharing.exp: Likewise.
---
 gdb/testsuite/gdb.base/index-cache.exp       | 2 ++
 gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/gdb/testsuite/gdb.base/index-cache.exp b/gdb/testsuite/gdb.base/index-cache.exp
index 13d5532..1ae8252 100644
--- a/gdb/testsuite/gdb.base/index-cache.exp
+++ b/gdb/testsuite/gdb.base/index-cache.exp
@@ -226,3 +226,5 @@ test_cache_enabled_hit $cache_dir
 # Test again with the cache disabled, now that it is populated.
 test_cache_disabled $cache_dir "after populate"
 
+remote_exec host sh "-c \"rm -f $cache_dir/*.gdb-index\""
+remote_exec host rmdir "$cache_dir"
diff --git a/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp b/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp
index 22ab91f..bc0d2eb 100644
--- a/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp
+++ b/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp
@@ -91,3 +91,6 @@ foreach_with_prefix first $methods {
 	}
     }
 }
+
+remote_exec host sh "-c \"rm -f $cache_dir/*.gdb-index\""
+remote_exec host rmdir "$cache_dir"
-- 
1.9.1


             reply	other threads:[~2021-05-14 13:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 13:20 Bernd Edlinger [this message]
2021-05-14 13:26 ` [PP?] " Simon Marchi via Gdb-patches
2021-05-14 15:03   ` Bernd Edlinger
2021-05-14 15:23     ` Simon Marchi via Gdb-patches
2021-05-14 15:39       ` Bernd Edlinger
2021-05-14 15:45         ` Simon Marchi via Gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM8PR10MB4708C1B2AA338675E5E9B2F1E4509@AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM \
    --to=bernd.edlinger@hotmail.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox