diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2021-04-04 19:20:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-04 19:20:02 +0200 |
| commit | 3cbed892a717dfc92845017b2f6c11d43fe48c0d (patch) | |
| tree | a6055a47151f6e3e42e885c0af27ae237eb5fc0b /src/tools/compiletest | |
| parent | a89eab9bca8b7efc37d386ff38d663035a5192de (diff) | |
| parent | 4f73d2153c4a8c71e5fa9c03b6b9f3af39491319 (diff) | |
| download | rust-3cbed892a717dfc92845017b2f6c11d43fe48c0d.tar.gz rust-3cbed892a717dfc92845017b2f6c11d43fe48c0d.zip | |
Rollup merge of #83532 - asomers:gdb-fbsd, r=Mark-Simulacrum
Fix compiletest on FreeBSD Recent FreeBSD gdb packages have a different format for the version string.
Diffstat (limited to 'src/tools/compiletest')
| -rw-r--r-- | src/tools/compiletest/src/main.rs | 3 | ||||
| -rw-r--r-- | src/tools/compiletest/src/tests.rs | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index 1d4b5e1247d..48091601861 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -909,7 +909,8 @@ fn extract_gdb_version(full_version_line: &str) -> Option<u32> { // This particular form is documented in the GNU coding standards: // https://www.gnu.org/prep/standards/html_node/_002d_002dversion.html#g_t_002d_002dversion - let mut splits = full_version_line.rsplit(' '); + let unbracketed_part = full_version_line.split('[').next().unwrap(); + let mut splits = unbracketed_part.trim_end().rsplit(' '); let version_string = splits.next().unwrap(); let mut splits = version_string.split('.'); diff --git a/src/tools/compiletest/src/tests.rs b/src/tools/compiletest/src/tests.rs index 233f2e648dc..e6725dba260 100644 --- a/src/tools/compiletest/src/tests.rs +++ b/src/tools/compiletest/src/tests.rs @@ -39,6 +39,9 @@ fn test_extract_gdb_version() { 7012000: "GNU gdb (GDB) 7.12", 7012000: "GNU gdb (GDB) 7.12.20161027-git", 7012050: "GNU gdb (GDB) 7.12.50.20161027-git", + + 9002000: "GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2", + 10001000: "GNU gdb (GDB) 10.1 [GDB v10.1 for FreeBSD]", } } |
