12e5b6d6dSopenharmony_ci#!/usr/bin/perl
22e5b6d6dSopenharmony_ci#  ********************************************************************
32e5b6d6dSopenharmony_ci#  * Copyright (C) 2016 and later: Unicode, Inc. and others.
42e5b6d6dSopenharmony_ci#  * License & terms of use: http://www.unicode.org/copyright.html
52e5b6d6dSopenharmony_ci#  ********************************************************************
62e5b6d6dSopenharmony_ci#  ********************************************************************
72e5b6d6dSopenharmony_ci#  * COPYRIGHT:
82e5b6d6dSopenharmony_ci#  * Copyright (c) 2005-2013, International Business Machines Corporation and
92e5b6d6dSopenharmony_ci#  * others. All Rights Reserved.
102e5b6d6dSopenharmony_ci#  ********************************************************************
112e5b6d6dSopenharmony_ci
122e5b6d6dSopenharmony_ci#use strict;
132e5b6d6dSopenharmony_ci
142e5b6d6dSopenharmony_cirequire "../perldriver/Common.pl";
152e5b6d6dSopenharmony_ci
162e5b6d6dSopenharmony_ciuse lib '../perldriver';
172e5b6d6dSopenharmony_ci
182e5b6d6dSopenharmony_ciuse PerfFramework;
192e5b6d6dSopenharmony_ci
202e5b6d6dSopenharmony_cimy $options = {
212e5b6d6dSopenharmony_ci    "title"=>"UTF performance: ICU (".$ICUPreviousVersion." and ".$ICULatestVersion.")",
222e5b6d6dSopenharmony_ci    "headers"=>"ICU".$ICUPreviousVersion." ICU".$ICULatestVersion,
232e5b6d6dSopenharmony_ci    "operationIs"=>"gb18030 encoding string",
242e5b6d6dSopenharmony_ci    "passes"=>"1",
252e5b6d6dSopenharmony_ci    "time"=>"2",
262e5b6d6dSopenharmony_ci    #"outputType"=>"HTML",
272e5b6d6dSopenharmony_ci    "dataDir"=>$ConversionDataPath,
282e5b6d6dSopenharmony_ci    "outputDir"=>"../results"
292e5b6d6dSopenharmony_ci};
302e5b6d6dSopenharmony_ci
312e5b6d6dSopenharmony_ci# programs
322e5b6d6dSopenharmony_ci# tests will be done for all the programs. Results will be stored and connected
332e5b6d6dSopenharmony_cimy $p1;
342e5b6d6dSopenharmony_cimy $p2;
352e5b6d6dSopenharmony_ci
362e5b6d6dSopenharmony_ciif ($OnWindows) {
372e5b6d6dSopenharmony_ci    $p1 = "cd ".$ICUPrevious."/bin && ".$ICUPathPrevious."/utfperf/$WindowsPlatform/Release/utfperf.exe -e gb18030"; # Previous
382e5b6d6dSopenharmony_ci    $p2 = "cd ".$ICULatest."/bin && ".$ICUPathLatest."/utfperf/$WindowsPlatform/Release/utfperf.exe -e gb18030"; # Latest
392e5b6d6dSopenharmony_ci} else {
402e5b6d6dSopenharmony_ci    $p1 = "LD_LIBRARY_PATH=".$ICUPrevious."/source/lib:".$ICUPrevious."/source/tools/ctestfw ".$ICUPathPrevious."/utfperf/utfperf -e gb18030"; # Previous
412e5b6d6dSopenharmony_ci    $p2 = "LD_LIBRARY_PATH=".$ICULatest."/source/lib:".$ICULatest."/source/tools/ctestfw ".$ICUPathLatest."/utfperf/utfperf -e gb18030"; # Latest
422e5b6d6dSopenharmony_ci}
432e5b6d6dSopenharmony_ci
442e5b6d6dSopenharmony_cimy $tests = {
452e5b6d6dSopenharmony_ci    "Roundtrip",      ["$p1,Roundtrip",        "$p2,Roundtrip"],
462e5b6d6dSopenharmony_ci    "FromUnicode",    ["$p1,FromUnicode",      "$p2,FromUnicode"],
472e5b6d6dSopenharmony_ci    "FromUTF8",       ["$p1,FromUTF8",         "$p2,FromUTF8"],
482e5b6d6dSopenharmony_ci};
492e5b6d6dSopenharmony_ci
502e5b6d6dSopenharmony_cimy $dataFiles = {
512e5b6d6dSopenharmony_ci    "", ["xuzhimo.txt"]
522e5b6d6dSopenharmony_ci};
532e5b6d6dSopenharmony_ci
542e5b6d6dSopenharmony_cirunTests($options, $tests, $dataFiles);
55