2 REM Copyright (C) 2016 and later: Unicode, Inc. and others.
3 REM License & terms of use: http://www.unicode.org/copyright.html
4 REM ********************************************************************
6 REM Don't add additional global environment variables, keep the variables local to this script.
13 echo Usage
: %0 "x86 or x64" "Debug or Release"
18 echo Usage
: %0 %1 "Debug or Release"
22 set ICU_ICUDIR
="%~dp0"\..\..\..
23 set ICU_SAMPLESDIR
=%ICU_ICUDIR%\source\samples
25 if "%ICU_ARCH%" == "x64" (
26 set ICU_BINDIR
=%~dp0..\..\..
\bin
64
28 set ICU_BINDIR
=%~dp0..\..\..
\bin
31 if not exist "%ICU_BINDIR%" (
32 echo Error
'%ICU_BINDIR%' does
not exist!
33 echo Have you built all of ICU yet ?
37 echo Testing ICU samples in
%ICU_ICUDIR% arch
=%ICU_ARCH% type=%ICU_DBRL%
38 set PATH=%ICU_BINDIR%;%PATH%
41 set SAMPLE_BREAK
=%ICU_SAMPLESDIR%\break\
%ICU_ARCH%\
%ICU_DBRL%\break.exe
42 set SAMPLE_CAL
=%ICU_SAMPLESDIR%\cal\
%ICU_ARCH%\
%ICU_DBRL%\cal.exe
43 set SAMPLE_CASE
=%ICU_SAMPLESDIR%\case\
%ICU_ARCH%\
%ICU_DBRL%\case.exe
44 set SAMPLE_CITER
=%ICU_SAMPLESDIR%\citer\
%ICU_ARCH%\
%ICU_DBRL%\citer.exe
45 set SAMPLE_COLL
=%ICU_SAMPLESDIR%\coll\
%ICU_ARCH%\
%ICU_DBRL%\coll.exe
46 set SAMPLE_CSDET
=%ICU_SAMPLESDIR%\csdet\
%ICU_ARCH%\
%ICU_DBRL%\csdet.exe
47 set SAMPLE_DATE
=%ICU_SAMPLESDIR%\
date\
%ICU_ARCH%\
%ICU_DBRL%\
date.exe
48 set SAMPLE_DATEFMT
=%ICU_SAMPLESDIR%\datefmt\
%ICU_ARCH%\
%ICU_DBRL%\datefmt.exe
49 set SAMPLE_DTITVFMT
=%ICU_SAMPLESDIR%\dtitvfmtsample\
%ICU_ARCH%\
%ICU_DBRL%\dtitvfmtsample.exe
50 set SAMPLE_DTPTNG
=%ICU_SAMPLESDIR%\dtptngsample\
%ICU_ARCH%\
%ICU_DBRL%\dtptngsample.exe
51 set SAMPLE_MSGFMT
=%ICU_SAMPLESDIR%\msgfmt\
%ICU_ARCH%\
%ICU_DBRL%\msgfmt.exe
52 set SAMPLE_NUMFMT
=%ICU_SAMPLESDIR%\numfmt\
%ICU_ARCH%\
%ICU_DBRL%\numfmt.exe
53 set SAMPLE_PLURFMTSAMPLE
=%ICU_SAMPLESDIR%\plurfmtsample\
%ICU_ARCH%\
%ICU_DBRL%\plurfmtsample.exe
54 set SAMPLE_PROPS
=%ICU_SAMPLESDIR%\props\
%ICU_ARCH%\
%ICU_DBRL%\props.exe
55 set SAMPLE_STRSRCH
=%ICU_SAMPLESDIR%\strsrch\
%ICU_ARCH%\
%ICU_DBRL%\strsrch.exe
56 set SAMPLE_TRANSLIT
=%ICU_SAMPLESDIR%\translit\
%ICU_ARCH%\
%ICU_DBRL%\translit.exe
57 set SAMPLE_UCITER8
=%ICU_SAMPLESDIR%\uciter8\
%ICU_ARCH%\
%ICU_DBRL%\uciter8.exe
58 set SAMPLE_UCNV
=%ICU_SAMPLESDIR%\ucnv\
%ICU_ARCH%\
%ICU_DBRL%\ucnv.exe
59 REM udata needs changes to the vcxproj to change the output locations for writer/reader.
60 rem set SAMPLE_UDATA_WRITER=%ICU_SAMPLESDIR%\udata\%ICU_ARCH%\%ICU_DBRL%\writer.exe
61 rem set SAMPLE_UDATA_READER=%ICU_SAMPLESDIR%\udata\%ICU_ARCH%\%ICU_DBRL%\reader.exe
62 set SAMPLE_UFORTUNE
=%ICU_SAMPLESDIR%\ufortune\
%ICU_ARCH%\
%ICU_DBRL%\ufortune.exe
63 set SAMPLE_UGREP
=%ICU_SAMPLESDIR%\ugrep\
%ICU_ARCH%\
%ICU_DBRL%\ugrep.exe
64 REM There is also the 'resources' project in VS.
65 set SAMPLE_URESB
=%ICU_SAMPLESDIR%\uresb\
%ICU_ARCH%\
%ICU_DBRL%\uresb.exe
66 set SAMPLE_USTRING
=%ICU_SAMPLESDIR%\ustring\
%ICU_ARCH%\
%ICU_DBRL%\ustring.exe
71 @
echo ==== %THT% =========================================================================
73 if ERRORLEVEL 1 goto :SampleError
77 @
echo ==== %THT% =========================================================================
79 if ERRORLEVEL 1 goto :SampleError
83 @
echo ==== %THT% =========================================================================
85 if ERRORLEVEL 1 goto :SampleError
89 @
echo ==== %THT% =========================================================================
91 if ERRORLEVEL 1 goto :SampleError
95 @
echo ==== %THT% =========================================================================
97 if ERRORLEVEL 1 goto :SampleError
101 @
echo ==== %THT% =========================================================================
102 %SAMPLE_CSDET% %ICU_SAMPLESDIR%\csdet
\readme.txt
103 if ERRORLEVEL 1 goto :SampleError
107 @
echo ==== %THT% =========================================================================
109 if ERRORLEVEL 1 goto :SampleError
113 @
echo ==== %THT% =========================================================================
115 if ERRORLEVEL 1 goto :SampleError
117 @
set THT
=dtitvfmtsample
119 @
echo ==== %THT% =========================================================================
121 if ERRORLEVEL 1 goto :SampleError
123 @
set THT
=dtptngsample
125 @
echo ==== %THT% =========================================================================
126 pushd
%ICU_SAMPLESDIR%\dtptngsample\
%ICU_ARCH%\
%ICU_DBRL%
129 if ERRORLEVEL 1 goto :SampleError
133 @
echo ==== %THT% =========================================================================
134 %SAMPLE_MSGFMT% arg1 arg2
135 if ERRORLEVEL 1 goto :SampleError
139 @
echo ==== %THT% =========================================================================
141 if ERRORLEVEL 1 goto :SampleError
143 @
set THT
=plurfmtsample
145 @
echo ==== %THT% =========================================================================
146 %SAMPLE_PLURFMTSAMPLE%
147 if ERRORLEVEL 1 goto :SampleError
151 @
echo ==== %THT% =========================================================================
153 if ERRORLEVEL 1 goto :SampleError
157 @
echo ==== %THT% =========================================================================
159 if ERRORLEVEL 1 goto :SampleError
163 @
echo ==== %THT% =========================================================================
165 if ERRORLEVEL 1 goto :SampleError
169 @
echo ==== %THT% =========================================================================
171 if ERRORLEVEL 1 goto :SampleError
175 @
echo ==== %THT% =========================================================================
176 pushd
%ICU_SAMPLESDIR%\ucnv
179 if ERRORLEVEL 1 goto :SampleError
181 REM TODO: udata needs changes to the vcxproj file to fix the output locations for writer/reader.
184 @
echo ==== %THT% =========================================================================
185 pushd
%ICU_SAMPLESDIR%\udata\
%ICU_ARCH%\
%ICU_DBRL%
186 @
echo TODO
: udata needs changes to the vcxproj file to fix the output locations
for writer
/reader.
188 rem %SAMPLE_UDATA_WRITER%
189 rem %SAMPLE_UDATA_READER%
191 if ERRORLEVEL 1 goto :SampleError
195 @
echo ==== %THT% =========================================================================
196 if "%ICU_ARCH%" == "x64" (
197 @
echo The ufortune sample currently only runs on x86.
198 @
echo Skipping
%THT%.
201 if ERRORLEVEL 1 goto :SampleError
206 @
echo ==== %THT% =========================================================================
207 echo Looking
for "ICU" in
'%ICU_SAMPLESDIR%\ugrep\readme.txt' with ugrep.exe
208 %SAMPLE_UGREP% ICU
%ICU_SAMPLESDIR%\ugrep
\readme.txt
209 if ERRORLEVEL 1 goto :SampleError
213 @
echo ==== %THT% =========================================================================
214 pushd
%ICU_SAMPLESDIR%\uresb
219 if ERRORLEVEL 1 goto :SampleError
223 @
echo ==== %THT% =========================================================================
225 if ERRORLEVEL 1 goto :SampleError
230 goto :QuitWithNoError
234 echo ERROR
: Sample program
%THT% did
not exit cleanly. Stopping execution.
246 rem
Exit with non
-zero error code.