diff --git a/testing/test_webpages.sh b/testing/test_webpages.sh index 2091995af..fdc32c6eb 100644 --- a/testing/test_webpages.sh +++ b/testing/test_webpages.sh @@ -26,7 +26,7 @@ check_webpage() { fi # Check if response contains HTML - if ! printf '%s' "$BODY" | grep -q "\|\|> "$result_file" return 1 fi @@ -75,13 +75,13 @@ test_all_urls() { ((total_count++)) ((url_index++)) - + # Run the check in background test_url "$url" "$base_url" "$tmp_dir" "$url_index" & - + # Track the job ((active_jobs++)) - + # If we've reached max_parallel, wait for a job to finish if [ $active_jobs -ge $max_parallel ]; then wait -n # Wait for any child process to exit @@ -97,7 +97,7 @@ test_all_urls() { if [ -f "${tmp_dir}/result_${i}.txt" ]; then cat "${tmp_dir}/result_${i}.txt" fi - + if [ -f "${tmp_dir}/failed_${i}" ]; then failed_count=$((failed_count + $(cat "${tmp_dir}/failed_${i}"))) fi @@ -171,4 +171,4 @@ main() { # Run main if script is executed directly if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then main "$@" -fi \ No newline at end of file +fi