From c72df9ddf946e9e21226c03d5e2b373dbe862fc4 Mon Sep 17 00:00:00 2001 From: Kai Luo Date: Fri, 19 Jul 2024 12:40:09 +0800 Subject: [PATCH 1/2] AIX uses .a as dylib's suffix --- src/tools/compiletest/src/runtest.rs | 32 +++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 1a4101e4de80b..78f3dcd4fe33f 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -94,6 +94,8 @@ fn get_lib_name(lib: &str, aux_type: AuxType) -> Option { format!("{}.dll", lib) } else if cfg!(target_vendor = "apple") { format!("lib{}.dylib", lib) + } else if cfg!(target_os = "aix") { + format!("lib{}.a", lib) } else { format!("lib{}.so", lib) }), @@ -278,11 +280,19 @@ impl<'test> TestCx<'test> { Ui | MirOpt => false, mode => panic!("unimplemented for mode {:?}", mode), }; - if test_should_run { self.run_if_enabled() } else { WillExecute::No } + if test_should_run { + self.run_if_enabled() + } else { + WillExecute::No + } } fn run_if_enabled(&self) -> WillExecute { - if self.config.run_enabled() { WillExecute::Yes } else { WillExecute::Disabled } + if self.config.run_enabled() { + WillExecute::Yes + } else { + WillExecute::Disabled + } } fn should_run_successfully(&self, pm: Option) -> bool { @@ -2441,7 +2451,11 @@ impl<'test> TestCx<'test> { /// The revision, ignored for incremental compilation since it wants all revisions in /// the same directory. fn safe_revision(&self) -> Option<&str> { - if self.config.mode == Incremental { None } else { self.revision } + if self.config.mode == Incremental { + None + } else { + self.revision + } } /// Gets the absolute path to the directory where all output for the given @@ -2665,7 +2679,11 @@ impl<'test> TestCx<'test> { fn charset() -> &'static str { // FreeBSD 10.1 defaults to GDB 6.1.1 which doesn't support "auto" charset - if cfg!(target_os = "freebsd") { "ISO-8859-1" } else { "UTF-8" } + if cfg!(target_os = "freebsd") { + "ISO-8859-1" + } else { + "UTF-8" + } } fn run_rustdoc_test(&self) { @@ -4488,7 +4506,11 @@ impl<'test> TestCx<'test> { for output_file in files { println!("Actual {} saved to {}", kind, output_file.display()); } - if self.config.bless { 0 } else { 1 } + if self.config.bless { + 0 + } else { + 1 + } } fn check_and_prune_duplicate_outputs( From ec805d17ebb70c6510914dfab2fb7b7f1c454491 Mon Sep 17 00:00:00 2001 From: Kai Luo Date: Fri, 19 Jul 2024 13:02:51 +0800 Subject: [PATCH 2/2] Revert format change --- src/tools/compiletest/src/runtest.rs | 30 +++++----------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 78f3dcd4fe33f..0122886961737 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -280,19 +280,11 @@ impl<'test> TestCx<'test> { Ui | MirOpt => false, mode => panic!("unimplemented for mode {:?}", mode), }; - if test_should_run { - self.run_if_enabled() - } else { - WillExecute::No - } + if test_should_run { self.run_if_enabled() } else { WillExecute::No } } fn run_if_enabled(&self) -> WillExecute { - if self.config.run_enabled() { - WillExecute::Yes - } else { - WillExecute::Disabled - } + if self.config.run_enabled() { WillExecute::Yes } else { WillExecute::Disabled } } fn should_run_successfully(&self, pm: Option) -> bool { @@ -2451,11 +2443,7 @@ impl<'test> TestCx<'test> { /// The revision, ignored for incremental compilation since it wants all revisions in /// the same directory. fn safe_revision(&self) -> Option<&str> { - if self.config.mode == Incremental { - None - } else { - self.revision - } + if self.config.mode == Incremental { None } else { self.revision } } /// Gets the absolute path to the directory where all output for the given @@ -2679,11 +2667,7 @@ impl<'test> TestCx<'test> { fn charset() -> &'static str { // FreeBSD 10.1 defaults to GDB 6.1.1 which doesn't support "auto" charset - if cfg!(target_os = "freebsd") { - "ISO-8859-1" - } else { - "UTF-8" - } + if cfg!(target_os = "freebsd") { "ISO-8859-1" } else { "UTF-8" } } fn run_rustdoc_test(&self) { @@ -4506,11 +4490,7 @@ impl<'test> TestCx<'test> { for output_file in files { println!("Actual {} saved to {}", kind, output_file.display()); } - if self.config.bless { - 0 - } else { - 1 - } + if self.config.bless { 0 } else { 1 } } fn check_and_prune_duplicate_outputs(