1@echo off
2REM  ********************************************************************
3REM  * COPYRIGHT:
4REM  * Copyright (c) 2010, International Business Machines Corporation
5REM  * and others. All Rights Reserved.
6REM  ********************************************************************
7
8set ICU_ARCH=%1
9set ICU_DBRL=%2
10
11if "%1" == "" (
12echo Usage: %0 "x86 or x64"  "Debug or Release"
13exit /b 1
14)
15
16if "%2" == "" (
17echo Usage: %0 %1 "Debug or Release"
18exit /b 1
19)
20
21set ICU_OPATH=%PATH%
22
23set ICU_ICUDIR=%~f0\..\..\..
24set ICU_BINDIR=%ICU_ICUDIR%\bin
25set PATH=%ICU_BINDIR%;%PATH%
26
27echo testing ICU in %ICU_ICUDIR%  arch=%ICU_ARCH% type=%ICU_DBRL%
28pushd %ICU_ICUDIR%
29
30@rem factor these out
31set ICUINFO_CMD=%ICU_ICUDIR%\source\tools\icuinfo\%ICU_ARCH%\%ICU_DBRL%\icuinfo.exe
32set INTLTEST_CMD=%ICU_ICUDIR%\source\test\intltest\%ICU_ARCH%\%ICU_DBRL%\intltest.exe
33set IOTEST_CMD=%ICU_ICUDIR%\source\test\iotest\%ICU_ARCH%\%ICU_DBRL%\iotest.exe
34set CINTLTST_CMD=%ICU_ICUDIR%\source\test\cintltst\%ICU_ARCH%\%ICU_DBRL%\cintltst.exe
35set LETEST_CMD=%ICU_ICUDIR%\source\test\letest\%ICU_ARCH%\%ICU_DBRL%\letest.exe
36
37set ICUFAILED=
38set ICURUN=
39set ICUFAILCNT=0
40
41@echo on
42
43@set THT=icuinfo
44@echo ==== %THT% =========================================================================
45%ICUINFO_CMD% %ICUINFO_OPTS%
46
47@IF NOT ERRORLEVEL 1 GOTO OK_%THT%
48@set ICUFAILED=%ICUFAILED% %THT%
49@set ICUFAILCNT=1
50:OK_icuinfo
51@set ICURUN=%ICURUN% %THT%
52
53@set THT=intltest
54@echo ==== %THT% =========================================================================
55@cd %ICU_ICUDIR%\source\test\intltest
56%INTLTEST_CMD% %INTLTEST_OPTS%
57
58@IF NOT ERRORLEVEL 1 GOTO OK_%THT%
59@set ICUFAILED=%ICUFAILED% %THT%
60@set ICUFAILCNT=1
61:OK_intltest
62@set ICURUN=%ICURUN% %THT%
63
64@set THT=iotest
65@echo ==== %THT% =========================================================================
66@cd %ICU_ICUDIR%\source\test\iotest
67%IOTEST_CMD% %IOTEST_OPTS%
68
69@IF NOT ERRORLEVEL 1 GOTO OK_%THT%
70@set ICUFAILED=%ICUFAILED% %THT%
71@set ICUFAILCNT=1
72:OK_IOTEST
73@set ICURUN=%ICURUN% %THT%
74
75@set THT=cintltst
76@echo ==== %THT% =========================================================================
77@cd %ICU_ICUDIR%\source\test\cintltst
78%CINTLTST_CMD% %CINTLTST_OPTS%
79
80@IF NOT ERRORLEVEL 1 GOTO OK_%THT%
81@set ICUFAILED=%ICUFAILED% %THT%
82@set ICUFAILCNT=1
83:OK_cintltst
84@set ICURUN=%ICURUN% %THT%
85
86@set THT=letest
87@echo ==== %THT% =========================================================================
88@cd %ICU_ICUDIR%\source\test\letest
89%LETST_CMD% %LETEST_OPTS%
90
91@IF NOT ERRORLEVEL 1 GOTO OK_%THT%
92@set ICUFAILED=%ICUFAILED% %THT%
93@set ICUFAILCNT=1
94:OK_letest
95@set ICURUN=%ICURUN% %THT%
96
97@echo off
98
99REM clean up
100set PATH=%ICU_OPATH%
101REM unset ICU_OPATH
102popd
103
104@REM done
105
106echo -
107echo -
108echo -
109echo ============================================================
110echo Summary:
111echo -
112echo Tests Run    : %ICURUN%
113
114if %ICUFAILCNT% == 0 (
115	echo " - All Passed!"
116	exit /b 0
117)
118echo Failing Tests: %ICUFAILED%
119echo -
120echo FAILED!
121
122exit /b 1