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 less than NWORKERS
161
+
while(( $(jobs -r | wc -l) >= NWORKERS ));do
162
+
sleep 0.1
163
+
done
164
+
}
165
+
155
166
check_generators()
156
167
{
157
168
# check all possible generators incorporated in the INI file
@@ -169,24 +180,31 @@ check_generators()
169
180
local look_for=$(grep "${g}.*\(\)"${test_script})
170
181
local has_trigger="$(grep Trigger${g}${ini_path})"
171
182
[[ -z"${look_for}" ]] &&continue
172
-
echo-n "Test ${TEST_COUNTER}: ${ini_path} with generator ${g}"
183
+
echo"Test ${TEST_COUNTER}: ${ini_path} with generator ${g} - STARTED"
173
184
tested_any=1
174
185
# prepare the test directory
175
186
local test_dir=${TEST_COUNTER}_$(basename ${ini})_${g}_dir
176
187
rm -rf ${test_dir}2> /dev/null
177
188
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
189
+
local test_num=${TEST_COUNTER}
189
190
((TEST_COUNTER++))
191
+
192
+
# Wait for an available slot before starting a new test
193
+
wait_for_slot
194
+
195
+
# Run test in background
196
+
(
197
+
cd${test_dir}
198
+
exec_test ${ini_path}${g}${has_trigger}
199
+
exit$?
200
+
) &
201
+
local pid=$!
202
+
203
+
# Store test information in global arrays
204
+
test_pids+=(${pid})
205
+
test_numbers+=(${test_num})
206
+
test_generators+=(${g})
207
+
test_ini_paths+=("${ini_path}")
190
208
fi
191
209
done
192
210
[[ -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 ; }
0 commit comments