From 5976ed7a6b8609c4a2d79fb9f12563ad86e8c1ab 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 8572825a89..d586aaf4a6 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 dec6bfe117..743c59d8bb 100644 --- a/tests/dateutils.rs +++ b/tests/dateutils.rs @@ -51,7 +51,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