Fix tests on AIX

- Add AIX timezone database path to search list.
- Use date program from freeware to do the testing.
This commit is contained in:
Qiu Chaofan 2023-04-19 17:05:21 +08:00 committed by Dirkjan Ochtman
parent f87d548601
commit 8df1ba108f
2 changed files with 5 additions and 2 deletions

View File

@ -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;

View File

@ -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