1 #!/usr/bin/perl 2 # ******************************************************************** 3 # * COPYRIGHT: 4 # * Copyright (c) 2005-2008, International Business Machines Corporation and 5 # * others. All Rights Reserved. 6 # ******************************************************************** 7 8 #use strict; 9 10 use lib '../perldriver'; 11 12 require "../perldriver/Common.pl"; 13 14 use PerfFramework; 15 16 # This test should be run on Windows. 17 if (!$OnWindows) { 18 print "This test should be run on Windows.\n"; 19 exit(1); 20 } 21 22 my $options = { 23 "title"=>"Collation performance: ICU,POSIX,and Win", 24 "headers"=>"ICU POSIX WIN", 25 "operationIs"=>"unicode String", 26 "passes"=>"1", 27 "time"=>"2", 28 #"outputType"=>"HTML", 29 "dataDir"=>$CollationDataPath, 30 "outputDir"=>"../results" 31 }; 32 33 # programs 34 # tests will be done for all the programs. Results will be stored and connected 35 my $p = $ICUPathLatest."/collperf/$WindowsPlatform/Release/collperf.exe"; 36 37 my $tests = { 38 "Key Gen null", ["$p TestIcu_KeyGen_null", "$p TestPosix_KeyGen_null", "$p TestWin_KeyGen_null"], 39 "qsort strcoll null", ["$p TestIcu_qsort_strcoll_null", "$p TestPosix_qsort_strcoll_null", "$p TestWin_qsort_CompareStringW_null"], 40 "qsort use key", ["$p TestIcu_qsort_usekey", "$p TestPosix_qsort_usekey", "$p TestWin_qsort_usekey"], 41 "Binary Search icu strcoll null", ["$p TestIcu_BinarySearch_strcoll_null", "$p TestPosix_BinarySearch_strcoll_null", "$p TestWin_BinarySearch_CompareStringW_null"], 42 "Binary Search icu use key", ["$p TestIcu_BinarySearch_usekey", "$p TestPosix_BinarySearch_usekey", "$p TestWin_BinarySearch_usekey"], 43 # These are the original test. They are commented out to so that the above test can run and compare certain aspects of collation. 44 #"Key Gen ICU null", ["$p TestIcu_KeyGen_null"], 45 #"Key Gen ICU len", ["$p TestIcu_KeyGen_len"], 46 #"Key Gen POSIX", ["$p TestPosix_KeyGen_null"], 47 #"Key Gen Win", ["$p TestWin_KeyGen_null"], 48 #"Iteration icu forward null", ["$p TestIcu_ForwardIter_null"], 49 #"Iteration icu forward len", ["$p TestIcu_ForwardIter_len"], 50 #"Iteration icu backward null", ["$p TestIcu_BackwardIter_null"], 51 #"Iteration icu backward len", ["$p TestIcu_BackwardIter_len"], 52 #"Iteration/all icu forward null", ["$p TestIcu_ForwardIter_all_null"], 53 #"Iteration/all icu forward len", ["$p TestIcu_ForwardIter_all_len"], 54 #"Iteration/all icu backward null", ["$p TestIcu_BackwardIter_all_null"], 55 #"Iteration/all icu backward len", ["$p TestIcu_BackwardIter_all_len"], 56 #"qsort icu strcoll null", ["$p TestIcu_qsort_strcoll_null"], 57 #"qsort icu strcoll len", ["$p TestIcu_qsort_strcoll_len"], 58 #"qsort icu use key", ["$p TestIcu_qsort_usekey"], 59 #"qsort posix strcoll null", ["$p TestPosix_qsort_strcoll_null"], 60 #"qsort posix use key", ["$p TestPosix_qsort_usekey"], 61 #"qsort win CompareStringW null", ["$p TestWin_qsort_CompareStringW_null"], 62 #"qsort win CompareStringW len", ["$p TestWin_qsort_CompareStringW_len"], 63 #"qsort win use key", ["$p TestWin_qsort_usekey"], 64 #"Binary Search icu strcoll null", ["$p TestIcu_BinarySearch_strcoll_null"], 65 #"Binary Search icu strcoll len", ["$p TestIcu_BinarySearch_strcoll_len"], 66 #"Binary Search icu use key", ["$p TestIcu_BinarySearch_usekey"], 67 #"Binary Search icu u_strcmp", ["$p TestIcu_BinarySearch_strcmp"], 68 #"Binary Search icu cmpCPO", ["$p TestIcu_BinarySearch_cmpCPO"], 69 #"Binary Search posix strcoll null", ["$p TestPosix_BinarySearch_strcoll_null"], 70 #"Binary Search posix use key", ["$p TestPosix_BinarySearch_usekey"], 71 #"Binary Search win CompareStringW null", ["$p TestWin_BinarySearch_CompareStringW_null"], 72 #"Binary Search win CompareStringW len", ["$p TestWin_BinarySearch_CompareStringW_len"], 73 #"Binary Search win use key", ["$p TestWin_BinarySearch_usekey"], 74 #"Binary Search win wcscmp", ["$p TestWin_BinarySearch_wcscmp"], 75 }; 76 77 my $dataFiles = { 78 "", 79 [ 80 "TestNames_Asian.txt", 81 "TestNames_Chinese.txt", 82 "TestNames_Japanese.txt", 83 "TestNames_Japanese_h.txt", 84 "TestNames_Japanese_k.txt", 85 "TestNames_Korean.txt", 86 "TestNames_Latin.txt", 87 "Testnames_Russian.txt", 88 "TestNames_SerbianSH.txt", 89 "TestNames_SerbianSR.txt", 90 "TestNames_Simplified_Chinese.txt", 91 "TestNames_Thai.txt" 92 ] 93 }; 94 95 runTests($options, $tests, $dataFiles); 96