mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix local timezone-dependent test.
This commit is contained in:
parent
09cbb9c12e
commit
67a0e46f18
@ -19,4 +19,3 @@ install:
|
||||
- sudo apt-get --reinstall install -qq language-pack-en language-pack-fr
|
||||
- git clone https://github.com/google/googletest ~/gtest && cd ~/gtest && git checkout release-1.8.0 && cd -
|
||||
script: ./autogen.sh && ./configure GTEST_ROOT=~/gtest/googletest GMOCK_ROOT=~/gtest/googlemock && make && TZ="America/Los_Angeles" make check
|
||||
after_failure: "cat src/libqof/qof/test/test-gnc-timezone.log"
|
@ -681,16 +681,24 @@ TimeZoneProvider::TimeZoneProvider(const std::string& tzname) : zone_vector {}
|
||||
}
|
||||
catch(const std::exception& err)
|
||||
{
|
||||
std::cerr << "Unable to use either provided tzname or TZ environment variable. Resorting to /etc/localtime.\n";
|
||||
try
|
||||
{
|
||||
parse_file("/etc/localtime");
|
||||
parse_file(getenv("TZ"));
|
||||
}
|
||||
catch(const std::invalid_argument& env)
|
||||
catch(const std::exception& err)
|
||||
{
|
||||
std::cerr << "/etc/localtime invalid, resorting to GMT.";
|
||||
TZ_Ptr zone(new PTZ("UTC0"));
|
||||
zone_vector.push_back(std::make_pair(max_year, zone));
|
||||
|
||||
std::cerr << "Unable to use either provided tzname or TZ environment variable. Resorting to /etc/localtime.\n";
|
||||
try
|
||||
{
|
||||
parse_file("/etc/localtime");
|
||||
}
|
||||
catch(const std::invalid_argument& env)
|
||||
{
|
||||
std::cerr << "/etc/localtime invalid, resorting to GMT.";
|
||||
TZ_Ptr zone(new PTZ("UTC0"));
|
||||
zone_vector.push_back(std::make_pair(max_year, zone));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user