Skip to content

Commit e61db5d

Browse files
authored
Windows test limit (#15)
1 parent d7e1350 commit e61db5d

File tree

1 file changed

+134
-0
lines changed

1 file changed

+134
-0
lines changed

scripts/run.bat

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,164 @@
11
@echo off
2+
Setlocal EnableDelayedExpansion
3+
24
for /r "." %%a in (build\bin\*_omp.exe) do (
35
echo -------------------------------------
46
echo %%~na
57
echo -------------------------------------
8+
set start=!time!
69
%%~fa --gtest_repeat=10
10+
set end=!time!
11+
12+
set options="tokens=1-4 delims=:.,"
13+
for /f %options% %%a in ("!start!") do (
14+
set start_h=%%a
15+
set /a start_m=100%%b %% 100
16+
set /a start_s=100%%c %% 100
17+
set /a start_ms=100%%d %% 100
18+
)
19+
for /f %options% %%a in ("!end!") do (
20+
set end_h=%%a
21+
set /a end_m=100%%b %% 100
22+
set /a end_s=100%%c %% 100
23+
set /a end_ms=100%%d %% 100
24+
)
25+
26+
set /a hours=!end_h!-!start_h!
27+
set /a mins=!end_m!-!start_m!
28+
set /a secs=!end_s!-!start_s!
29+
set /a ms=!end_ms!-!start_ms!
30+
31+
if !ms! lss 0 set /a secs = !secs! - 1 & set /a ms = 100!ms!
32+
if !secs! lss 0 set /a mins = !mins! - 1 & set /a secs = 60!secs!
33+
if !mins! lss 0 set /a hours = !hours! - 1 & set /a mins = 60!mins!
34+
if !hours! lss 0 set /a hours = 24!hours!
35+
if 1!ms! lss 100 set ms=0!ms!
36+
set /a totalsecs = !hours!*3600 + !mins!*60 + !secs!
37+
if !totalsecs! gtr 5 (
38+
echo Alert: runtime greater then 5 sec.
39+
echo runtime = !totalsecs! sec.
40+
exit /b 1
41+
)
742
)
843

944
for /r "." %%a in (build\bin\*_tbb.exe) do (
1045
echo -------------------------------------
1146
echo %%~na
1247
echo -------------------------------------
48+
set start=!time!
1349
%%~fa --gtest_repeat=10
50+
set end=!time!
51+
52+
set options="tokens=1-4 delims=:.,"
53+
for /f %options% %%a in ("!start!") do (
54+
set start_h=%%a
55+
set /a start_m=100%%b %% 100
56+
set /a start_s=100%%c %% 100
57+
set /a start_ms=100%%d %% 100
58+
)
59+
for /f %options% %%a in ("!end!") do (
60+
set end_h=%%a
61+
set /a end_m=100%%b %% 100
62+
set /a end_s=100%%c %% 100
63+
set /a end_ms=100%%d %% 100
64+
)
65+
66+
set /a hours=!end_h!-!start_h!
67+
set /a mins=!end_m!-!start_m!
68+
set /a secs=!end_s!-!start_s!
69+
set /a ms=!end_ms!-!start_ms!
70+
71+
if !ms! lss 0 set /a secs = !secs! - 1 & set /a ms = 100!ms!
72+
if !secs! lss 0 set /a mins = !mins! - 1 & set /a secs = 60!secs!
73+
if !mins! lss 0 set /a hours = !hours! - 1 & set /a mins = 60!mins!
74+
if !hours! lss 0 set /a hours = 24!hours!
75+
if 1!ms! lss 100 set ms=0!ms!
76+
set /a totalsecs = !hours!*3600 + !mins!*60 + !secs!
77+
if !totalsecs! gtr 5 (
78+
echo Alert: runtime greater then 5 sec.
79+
echo runtime = !totalsecs! sec.
80+
exit /b 1
81+
)
1482
)
1583

1684
for /r "." %%a in (build\bin\*_std.exe) do (
1785
echo -------------------------------------
1886
echo %%~na
1987
echo -------------------------------------
88+
set start=!time!
2089
%%~fa --gtest_repeat=10
90+
set end=!time!
91+
92+
set options="tokens=1-4 delims=:.,"
93+
for /f %options% %%a in ("!start!") do (
94+
set start_h=%%a
95+
set /a start_m=100%%b %% 100
96+
set /a start_s=100%%c %% 100
97+
set /a start_ms=100%%d %% 100
98+
)
99+
for /f %options% %%a in ("!end!") do (
100+
set end_h=%%a
101+
set /a end_m=100%%b %% 100
102+
set /a end_s=100%%c %% 100
103+
set /a end_ms=100%%d %% 100
104+
)
105+
106+
set /a hours=!end_h!-!start_h!
107+
set /a mins=!end_m!-!start_m!
108+
set /a secs=!end_s!-!start_s!
109+
set /a ms=!end_ms!-!start_ms!
110+
111+
if !ms! lss 0 set /a secs = !secs! - 1 & set /a ms = 100!ms!
112+
if !secs! lss 0 set /a mins = !mins! - 1 & set /a secs = 60!secs!
113+
if !mins! lss 0 set /a hours = !hours! - 1 & set /a mins = 60!mins!
114+
if !hours! lss 0 set /a hours = 24!hours!
115+
if 1!ms! lss 100 set ms=0!ms!
116+
set /a totalsecs = !hours!*3600 + !mins!*60 + !secs!
117+
if !totalsecs! gtr 5 (
118+
echo Alert: runtime greater then 5 sec.
119+
echo runtime = !totalsecs! sec.
120+
exit /b 1
121+
)
21122
)
22123

23124
for /r "." %%a in (build\bin\*_mpi.exe) do (
24125
echo -------------------------------------
25126
echo %%~na
26127
echo -------------------------------------
128+
set start=!time!
27129
for /l %%x in (1, 1, 10) do (
28130
mpiexec -np 4 %%~fa || exit /b 1
29131
)
132+
set end=!time!
133+
134+
set options="tokens=1-4 delims=:.,"
135+
for /f %options% %%a in ("!start!") do (
136+
set start_h=%%a
137+
set /a start_m=100%%b %% 100
138+
set /a start_s=100%%c %% 100
139+
set /a start_ms=100%%d %% 100
140+
)
141+
for /f %options% %%a in ("!end!") do (
142+
set end_h=%%a
143+
set /a end_m=100%%b %% 100
144+
set /a end_s=100%%c %% 100
145+
set /a end_ms=100%%d %% 100
146+
)
147+
148+
set /a hours=!end_h!-!start_h!
149+
set /a mins=!end_m!-!start_m!
150+
set /a secs=!end_s!-!start_s!
151+
set /a ms=!end_ms!-!start_ms!
152+
153+
if !ms! lss 0 set /a secs = !secs! - 1 & set /a ms = 100!ms!
154+
if !secs! lss 0 set /a mins = !mins! - 1 & set /a secs = 60!secs!
155+
if !mins! lss 0 set /a hours = !hours! - 1 & set /a mins = 60!mins!
156+
if !hours! lss 0 set /a hours = 24!hours!
157+
if 1!ms! lss 100 set ms=0!ms!
158+
set /a totalsecs = !hours!*3600 + !mins!*60 + !secs!
159+
if !totalsecs! gtr 5 (
160+
echo Alert: runtime greater then 5 sec.
161+
echo runtime = !totalsecs! sec.
162+
exit /b 1
163+
)
30164
)

0 commit comments

Comments
 (0)