Skip to content

Commit

Permalink
Fix tests on AIX
Browse files Browse the repository at this point in the history
- Add AIX timezone database path to search list.
- Use date program from freeware to do the testing.
  • Loading branch information
ecnelises authored and djc committed May 11, 2023
1 parent f87d548 commit 8df1ba1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/offset/local/tz_info/timezone.rs
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions tests/dateutils.rs
Expand Up @@ -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
Expand Down

0 comments on commit 8df1ba1

Please sign in to comment.