From 8df1ba108ff6c305adb3325ccf42ea38429e415e Mon Sep 17 00:00:00 2001 From: Qiu Chaofan Date: Wed, 19 Apr 2023 17:05:21 +0800 Subject: [PATCH] Fix tests on AIX - Add AIX timezone database path to search list. - Use date program from freeware to do the testing. --- src/offset/local/tz_info/timezone.rs | 4 ++-- tests/dateutils.rs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/offset/local/tz_info/timezone.rs b/src/offset/local/tz_info/timezone.rs index 866cc011b2..352250e0bd 100644 --- a/src/offset/local/tz_info/timezone.rs +++ b/src/offset/local/tz_info/timezone.rs @@ -620,8 +620,8 @@ fn saturating_abs(v: i32) -> i32 { // Possible system timezone directories #[cfg(unix)] -const ZONE_INFO_DIRECTORIES: [&str; 3] = - ["/usr/share/zoneinfo", "/share/zoneinfo", "/etc/zoneinfo"]; +const ZONE_INFO_DIRECTORIES: [&str; 4] = + ["/usr/share/zoneinfo", "/share/zoneinfo", "/etc/zoneinfo", "/usr/share/lib/zoneinfo"]; /// Number of seconds in one week pub(crate) const SECONDS_PER_WEEK: i64 = SECONDS_PER_DAY * DAYS_PER_WEEK; diff --git a/tests/dateutils.rs b/tests/dateutils.rs index 1eb0941011..fb1e3e47a7 100644 --- a/tests/dateutils.rs +++ b/tests/dateutils.rs @@ -55,7 +55,10 @@ fn verify_against_date_command_local(path: &'static str, dt: NaiveDateTime) { #[test] #[cfg(unix)] fn try_verify_against_date_command() { + #[cfg(not(target_os = "aix"))] let date_path = "/usr/bin/date"; + #[cfg(target_os = "aix")] + let date_path = "/opt/freeware/bin/date"; if !path::Path::new(date_path).exists() { // date command not found, skipping