You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Wait until the number of background jobs is within the limit
155
+
while(( $(jobs -r | wc -l) >= JOBS ));do
156
+
sleep 0.1
157
+
done
158
+
}
154
159
155
160
check_generators()
156
161
{
@@ -169,31 +174,37 @@ check_generators()
169
174
local look_for=$(grep "${g}.*\(\)"${test_script})
170
175
local has_trigger="$(grep Trigger${g}${ini_path})"
171
176
[[ -z"${look_for}" ]] &&continue
172
-
echo -n "Test ${TEST_COUNTER}: ${ini_path} with generator ${g}"
173
177
tested_any=1
174
178
# prepare the test directory
175
179
local test_dir=${TEST_COUNTER}_$(basename ${ini})_${g}_dir
176
180
rm -rf ${test_dir}2> /dev/null
177
181
mkdir ${test_dir}
178
-
pushd${test_dir}> /dev/null
179
-
# one single test
180
-
exec_test ${ini_path}${g}${has_trigger}
181
-
RET=${?}
182
-
popd> /dev/null
183
-
if [[ "${RET}"!="0" ]] ;then
184
-
echo_red " -> FAILED"
185
-
ret_this=${RET}
186
-
else
187
-
echo_green " -> PASSED"
188
-
fi
182
+
local test_num=${TEST_COUNTER}
189
183
((TEST_COUNTER++))
184
+
185
+
# Wait for an available slot before starting a new test
186
+
wait_for_slot
187
+
188
+
echo"Test ${test_num}: ${ini_path} with generator ${g} - STARTED"
189
+
# Run test in background
190
+
(
191
+
cd${test_dir}
192
+
exec_test ${ini_path}${g}${has_trigger}
193
+
exit$?
194
+
) &
195
+
local pid=$!
196
+
197
+
# Store test information in global arrays
198
+
test_pids+=(${pid})
199
+
test_numbers+=(${test_num})
200
+
test_generators+=(${g})
201
+
test_ini_paths+=("${ini_path}")
190
202
fi
191
203
done
192
204
[[ -z"${tested_any}" ]] && { echo_red "No test scenario was found for any generator. There must be at least one generator to be tested."; ret_this=1 ; }
193
205
return${ret_this}
194
206
}
195
207
196
-
197
208
add_ini_files_from_macros()
198
209
{
199
210
# given a list of macros, collect all INI files which contain at least one of them
@@ -216,7 +227,6 @@ add_ini_files_from_macros()
216
227
done
217
228
}
218
229
219
-
220
230
get_root_includes()
221
231
{
222
232
# check if some R__ADD_INCLUDE_PATH is used in the including macro and check the included file against that
@@ -236,7 +246,6 @@ get_root_includes()
236
246
echo${full_includes}
237
247
}
238
248
239
-
240
249
find_including_macros()
241
250
{
242
251
# figure out the macros that INCLUDE macros that have changed, so that in turn we can check
@@ -283,7 +292,6 @@ find_including_macros()
283
292
echo${including_macros}
284
293
}
285
294
286
-
287
295
add_ini_files_from_tests()
288
296
{
289
297
# Collect also those INI files for which the test has been changed
0 commit comments