]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/compat/tzone.pl
3 # Copyright (C) 2007-2007, International Business Machines
4 # Corporation and others. All Rights Reserved.
7 if ($ARGV[0] eq '-h' || $ARGV[0] eq '--help') {
8 print "Usage: tzone [year month day hour minute]\n";
12 my $LIBRARY = '../../lib';
14 my @TZONE_RAW = `locate zoneinfo | grep '^/usr/share/zoneinfo/' | grep -v 'tab\$' | grep -v '/right/' | grep -v '/posix/' | grep -v '/posixrules\$' | grep -v '/Factory\$'`;
25 if (scalar(@ARGV) == 5) {
26 ($year, $month, $day, $hour, $minute) = @ARGV;
27 print "The date we are using is: $month-$day-$year $hour:$minute.\n";
29 print "We are using the current date.\n";
33 #filter out the time zones
34 foreach my $tzone (@TZONE_RAW) {
37 $TZONE[$index] = substr($tzone, 20);
42 #go through each timezone and test
44 $ENV{'LD_LIBRARY_PATH'} = $LIBRARY;
46 print "The following time zones had wrong results.\n";
48 foreach my $tzone (@TZONE) {
50 $ENV{'TZ'} = "$tzone";
52 my @result = `./tzdate $year $month $day $hour $minute $USECURRENT`;
54 #if the result is wrong print the time zone information to a log file
55 if (scalar(@result) > 0) {
56 print "\nTIME ZONE: $tzone\n";
62 print "\nThe number of time zones with wrong results: $count out of $index\n";
64 print("\n\nGood Bye!\n");