aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.testsuite')
-rw-r--r--gdb/testsuite/gdb.testsuite/board-sanity.exp2
-rw-r--r--gdb/testsuite/gdb.testsuite/capture-command-output.exp2
-rw-r--r--gdb/testsuite/gdb.testsuite/cond-wrap.exp2
-rw-r--r--gdb/testsuite/gdb.testsuite/dump-system-info.exp2
-rw-r--r--gdb/testsuite/gdb.testsuite/foreach_with_prefix.exp2
-rw-r--r--gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp2
-rw-r--r--gdb/testsuite/gdb.testsuite/gdb-caching-proc.exp2
-rw-r--r--gdb/testsuite/gdb.testsuite/gdb-test.exp2
-rw-r--r--gdb/testsuite/gdb.testsuite/lmap.exp2
-rw-r--r--gdb/testsuite/gdb.testsuite/parse_options_args.exp2
-rw-r--r--gdb/testsuite/gdb.testsuite/string-cat.exp2
-rw-r--r--gdb/testsuite/gdb.testsuite/string_to_regexp.exp2
-rw-r--r--gdb/testsuite/gdb.testsuite/version-compare.exp74
-rw-r--r--gdb/testsuite/gdb.testsuite/with-override.exp2
14 files changed, 87 insertions, 13 deletions
diff --git a/gdb/testsuite/gdb.testsuite/board-sanity.exp b/gdb/testsuite/gdb.testsuite/board-sanity.exp
index acf37df..9c80282 100644
--- a/gdb/testsuite/gdb.testsuite/board-sanity.exp
+++ b/gdb/testsuite/gdb.testsuite/board-sanity.exp
@@ -1,4 +1,4 @@
-# Copyright 2023-2024 Free Software Foundation, Inc.
+# Copyright 2023-2025 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
diff --git a/gdb/testsuite/gdb.testsuite/capture-command-output.exp b/gdb/testsuite/gdb.testsuite/capture-command-output.exp
index 6828291..67d7b18 100644
--- a/gdb/testsuite/gdb.testsuite/capture-command-output.exp
+++ b/gdb/testsuite/gdb.testsuite/capture-command-output.exp
@@ -1,4 +1,4 @@
-# Copyright 2022-2024 Free Software Foundation, Inc.
+# Copyright 2022-2025 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
diff --git a/gdb/testsuite/gdb.testsuite/cond-wrap.exp b/gdb/testsuite/gdb.testsuite/cond-wrap.exp
index 3005b36..bc29c5a 100644
--- a/gdb/testsuite/gdb.testsuite/cond-wrap.exp
+++ b/gdb/testsuite/gdb.testsuite/cond-wrap.exp
@@ -1,4 +1,4 @@
-# Copyright 2022-2024 Free Software Foundation, Inc.
+# Copyright 2022-2025 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
diff --git a/gdb/testsuite/gdb.testsuite/dump-system-info.exp b/gdb/testsuite/gdb.testsuite/dump-system-info.exp
index 353f366..143f363 100644
--- a/gdb/testsuite/gdb.testsuite/dump-system-info.exp
+++ b/gdb/testsuite/gdb.testsuite/dump-system-info.exp
@@ -1,4 +1,4 @@
-# Copyright 2021-2024 Free Software Foundation, Inc.
+# Copyright 2021-2025 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
diff --git a/gdb/testsuite/gdb.testsuite/foreach_with_prefix.exp b/gdb/testsuite/gdb.testsuite/foreach_with_prefix.exp
index 2944273..03a2f68 100644
--- a/gdb/testsuite/gdb.testsuite/foreach_with_prefix.exp
+++ b/gdb/testsuite/gdb.testsuite/foreach_with_prefix.exp
@@ -1,4 +1,4 @@
-# Copyright 2019-2024 Free Software Foundation, Inc.
+# Copyright 2019-2025 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
diff --git a/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp b/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp
index 572ffb5..0957dbd 100644
--- a/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp
+++ b/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp
@@ -1,4 +1,4 @@
-# Copyright 2018-2024 Free Software Foundation, Inc.
+# Copyright 2018-2025 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
diff --git a/gdb/testsuite/gdb.testsuite/gdb-caching-proc.exp b/gdb/testsuite/gdb.testsuite/gdb-caching-proc.exp
index 0b7cfae..f9610af 100644
--- a/gdb/testsuite/gdb.testsuite/gdb-caching-proc.exp
+++ b/gdb/testsuite/gdb.testsuite/gdb-caching-proc.exp
@@ -1,4 +1,4 @@
-# Copyright 2023-2024 Free Software Foundation, Inc.
+# Copyright 2023-2025 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
diff --git a/gdb/testsuite/gdb.testsuite/gdb-test.exp b/gdb/testsuite/gdb.testsuite/gdb-test.exp
index a8aa53c..95555f8 100644
--- a/gdb/testsuite/gdb.testsuite/gdb-test.exp
+++ b/gdb/testsuite/gdb.testsuite/gdb-test.exp
@@ -1,4 +1,4 @@
-# Copyright 2022-2024 Free Software Foundation, Inc.
+# Copyright 2022-2025 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
diff --git a/gdb/testsuite/gdb.testsuite/lmap.exp b/gdb/testsuite/gdb.testsuite/lmap.exp
index 736f670..da03722 100644
--- a/gdb/testsuite/gdb.testsuite/lmap.exp
+++ b/gdb/testsuite/gdb.testsuite/lmap.exp
@@ -1,4 +1,4 @@
-# Copyright 2023-2024 Free Software Foundation, Inc.
+# Copyright 2023-2025 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
diff --git a/gdb/testsuite/gdb.testsuite/parse_options_args.exp b/gdb/testsuite/gdb.testsuite/parse_options_args.exp
index 7239ef7..22a54a7 100644
--- a/gdb/testsuite/gdb.testsuite/parse_options_args.exp
+++ b/gdb/testsuite/gdb.testsuite/parse_options_args.exp
@@ -1,4 +1,4 @@
-# Copyright 2021-2024 Free Software Foundation, Inc.
+# Copyright 2021-2025 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
diff --git a/gdb/testsuite/gdb.testsuite/string-cat.exp b/gdb/testsuite/gdb.testsuite/string-cat.exp
index 057aeb2..94136e3 100644
--- a/gdb/testsuite/gdb.testsuite/string-cat.exp
+++ b/gdb/testsuite/gdb.testsuite/string-cat.exp
@@ -1,4 +1,4 @@
-# Copyright 2024 Free Software Foundation, Inc.
+# Copyright 2024-2025 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
diff --git a/gdb/testsuite/gdb.testsuite/string_to_regexp.exp b/gdb/testsuite/gdb.testsuite/string_to_regexp.exp
index 4cafce3..0cb5296 100644
--- a/gdb/testsuite/gdb.testsuite/string_to_regexp.exp
+++ b/gdb/testsuite/gdb.testsuite/string_to_regexp.exp
@@ -1,4 +1,4 @@
-# Copyright 2021-2024 Free Software Foundation, Inc.
+# Copyright 2021-2025 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
diff --git a/gdb/testsuite/gdb.testsuite/version-compare.exp b/gdb/testsuite/gdb.testsuite/version-compare.exp
new file mode 100644
index 0000000..8f2573e
--- /dev/null
+++ b/gdb/testsuite/gdb.testsuite/version-compare.exp
@@ -0,0 +1,74 @@
+# Copyright 2025 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/>.
+
+# Check version_compare proc.
+
+proc eq { a b } {
+ with_test_prefix "$a == $b" {
+ gdb_assert { [version_compare $a == $b] }
+ gdb_assert { [version_compare $a <= $b] }
+ gdb_assert { [version_compare $a >= $b] }
+ gdb_assert { ![version_compare $a < $b] }
+ gdb_assert { ![version_compare $a > $b] }
+ }
+}
+
+proc lt { a b } {
+ with_test_prefix "$a < $b" {
+ gdb_assert { [version_compare $a < $b] }
+ gdb_assert { [version_compare $a <= $b] }
+ gdb_assert { [version_compare $b > $a] }
+ gdb_assert { [version_compare $b >= $a] }
+ gdb_assert { ![version_compare $a == $b] }
+ gdb_assert { ![version_compare $b == $a] }
+ gdb_assert { ![version_compare $a > $b] }
+ gdb_assert { ![version_compare $a >= $b] }
+ gdb_assert { ![version_compare $b < $a] }
+ gdb_assert { ![version_compare $b <= $a] }
+ }
+}
+
+# Equal, same length.
+eq {1 0} {1 0}
+
+# Smaller than, same length.
+lt {1 0} {1 1}
+lt {1 1} {2 0}
+
+# Smaller than, different length.
+lt {1 3} {2}
+lt {1} {2 0}
+
+# The question how v1 and v1.0 relate to each other is not a trivial one.
+#
+# For instance, Python considers v1 == v1.0:
+# $ test.py
+# #!/usr/bin/python3
+# from packaging.version import parse
+# v1_0 = parse("1.0")
+# v1 = parse("1")
+# print (v1 == v1_0)
+# $ ./test.py
+# True
+#
+# OTOH, version sort from coreutils considers v1 < v1.0:
+# $ cat bla.txt
+# 1.0
+# 1
+# $ sort -V bla.txt
+# 1
+# 1.0
+#
+# Proc version_compare seems to have taken the latter approach.
+lt {1} {1 0}
diff --git a/gdb/testsuite/gdb.testsuite/with-override.exp b/gdb/testsuite/gdb.testsuite/with-override.exp
index a0a4962..9180150 100644
--- a/gdb/testsuite/gdb.testsuite/with-override.exp
+++ b/gdb/testsuite/gdb.testsuite/with-override.exp
@@ -1,4 +1,4 @@
-# Copyright 2023-2024 Free Software Foundation, Inc.
+# Copyright 2023-2025 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