Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v2 1/6] [gdb/testsuite] Add gdb.testsuite/lock.exp
@ 2026-09-29 11:09 Tom de Vries
  2026-09-29 11:09 ` [PATCH v2 2/6] [gdb/testsuite] Improve variable names in lock_file_{acquire, release} Tom de Vries
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Tom de Vries @ 2026-09-29 11:09 UTC (permalink / raw)
  To: gdb-patches

I noticed there's no test-case for lock_file_{acquire,release}.

Add gdb.testsuite/lock.exp.
---
 gdb/testsuite/gdb.testsuite/lock.exp | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 gdb/testsuite/gdb.testsuite/lock.exp

diff --git a/gdb/testsuite/gdb.testsuite/lock.exp b/gdb/testsuite/gdb.testsuite/lock.exp
new file mode 100644
index 00000000000..67ea09390ac
--- /dev/null
+++ b/gdb/testsuite/gdb.testsuite/lock.exp
@@ -0,0 +1,28 @@
+# Copyright 2026 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set lockfile [build_standard_output_file "lock.txt"]
+gdb_assert {![file exists $lockfile]} "Initial"
+
+# Scenario 1:
+# - acquire 1
+# - release 1
+with_test_prefix "simple" {
+    set res [lock_file_acquire $lockfile]
+    gdb_assert {[file exists $lockfile]} "Acquire lock"
+
+    lock_file_release $res
+    gdb_assert {![file exists $lockfile]} "Release lock"
+}

base-commit: 4ba6bd8393418b63dc3efa0ec6f934903a10f140
-- 
2.51.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-09-29 11:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-29 11:09 [PATCH v2 1/6] [gdb/testsuite] Add gdb.testsuite/lock.exp Tom de Vries
2026-09-29 11:09 ` [PATCH v2 2/6] [gdb/testsuite] Improve variable names in lock_file_{acquire, release} Tom de Vries
2026-09-29 11:09 ` [PATCH v2 3/6] [gdb/testsuite] Simplify lock_file_acquire Tom de Vries
2026-09-29 11:09 ` [PATCH v2 4/6] [gdb/testsuite] Only retry on EEXIST in lock_file_acquire Tom de Vries
2026-09-29 11:09 ` [PATCH v2 5/6] [gdb/testsuite] Extend gdb.testsuite/lock.exp Tom de Vries
2026-09-29 11:09 ` [PATCH v2 6/6] [gdb/testsuite] Extend gdb.testsuite/lock.exp a bit more Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox