Imported Upstream version 58.1
[platform/upstream/icu.git] / source / test / perf / unisetperf / unisetperf.pl
1 #!/usr/bin/perl
2 #  ********************************************************************
3 #  * Copyright (C) 2016 and later: Unicode, Inc. and others.
4 #  * License & terms of use: http://www.unicode.org/copyright.html#License
5 #  ********************************************************************
6 #  ********************************************************************
7 #  * COPYRIGHT:
8 #  * Copyright (c) 2005-2013, International Business Machines Corporation and
9 #  * others. All Rights Reserved.
10 #  ********************************************************************
11
12 #use strict;
13
14 require "../perldriver/Common.pl";
15
16 use lib '../perldriver';
17
18 use PerfFramework;
19
20 my $options = {
21     "title"=>"UnicodeSet span()/contains() performance",
22     "headers"=>"Bv Bv0",
23     "operationIs"=>"tested Unicode code point",
24     "passes"=>"3",
25     "time"=>"2",
26     #"outputType"=>"HTML",
27     "dataDir"=>$UDHRDataPath,
28     "outputDir"=>"../results"
29 };
30
31 # programs
32 # tests will be done for all the programs. Results will be stored and connected
33 my $p;
34 if ($OnWindows) {
35     $p = "cd ".$ICULatest."/bin && ".$ICUPathLatest."/unisetperf/$WindowsPlatform/Release/unisetperf.exe";
36 } else {
37     $p = "LD_LIBRARY_PATH=".$ICULatest."/source/lib:".$ICULatest."/source/tools/ctestfw ".$ICUPathLatest."/unisetperf/unisetperf";
38 }
39
40 my $tests = {
41     "Contains",
42     [
43         "$p,Contains --type Bv",
44         "$p,Contains --type Bv0"
45     ],
46     "SpanUTF16",
47     [
48         "$p,SpanUTF16 --type Bv",
49         "$p,SpanUTF16 --type Bv0"
50     ]
51 };
52
53 my $dataFiles = {
54     "",
55     [
56         "udhr_eng.txt",
57         "udhr_deu_1996.txt",
58         "udhr_fra.txt",
59         "udhr_rus.txt",
60         "udhr_tha.txt",
61         "udhr_jpn.txt",
62         "udhr_cmn_hans.txt",
63         "udhr_cmn_hant.txt",
64         "udhr_jpn.html"
65     ]
66 };
67
68 runTests($options, $tests, $dataFiles);
69
70 $options = {
71     "title"=>"UnicodeSet span()/contains() performance",
72     "headers"=>"Bv BvF Bvp BvpF L Bvl",
73     "operationIs"=>"tested Unicode code point",
74     "passes"=>"3",
75     "time"=>"2",
76     #"outputType"=>"HTML",
77     "dataDir"=>$UDHRDataPath,
78     "outputDir"=>"../results"
79 };
80
81 $tests = {
82     "SpanUTF8",
83     [
84         "$p,SpanUTF8 --type Bv",
85         "$p,SpanUTF8 --type BvF",
86         "$p,SpanUTF8 --type Bvp",
87         "$p,SpanUTF8 --type BvpF",
88         "$p,SpanUTF8 --type L",
89         "$p,SpanUTF8 --type Bvl"
90     ]
91 };
92
93 runTests($options, $tests, $dataFiles);