Prior to this change, the assumption in all shell and Python scripts was
that the Bash interpreter would always be available at `/bin/bash`, and
Python would always be available at `/usr/bin/python`. However, on a VM
running FreeBSD, installing bash and python using the pkg command
installs them under /usr/local/bin.
This change updates the paths to use /usr/bin/env in the shebang. While
this is not a standard path either, it is more likely to be available at
this location.
This change also updates the find command in common_infra.sh to use
`-perm -+x` in lieu of `-executable`, which is not a condition defined
by POSIX. This allows running the tests on BSD.
This commit changes the local timezone calculation to use tm.tm_gmtoff,
and falling back to calculating it manually from the output of strftime
when tm_gmtoff is not a member of struct tm.
This also fixes the tests so that they are no longer expected to fail.
Fixes#20.
Prior to this change, the tests were using the automake simple test
harness. The limitation was that for each set of test cases (e.g.
timezone tests), even if one test failed, it would report every test in
that set as failed. Migrating to TAP allows fine-grained reporting on
every single test case, and allows better investigation into checking
which individual tests failed.
This change also updates the timezone tests to explicitly mark the ones
that check when the timezone is Pacific Daylight Time as expected to
fail. It also updates the clock tests to improve the formatting of the
test case identifier.
Previously, when testing the clock command of x52cli, we had forced the
system timezone to UTC. As a result, the offset calculations for clocks
2 and 3 were never computed and always resulted in 0, which hid the bug
when the local time and local standard time did not match (#20).
This commit adds a test case that uses faketime to test setting the
clock to local (Pacific Time) and verifying that the offsets are
computed correctly. Given that the bug is still present as of this
commit, add the test suite to XFAIL_TESTS as well, so that it doesn't
break the CI build.