Executing Tasks in Parallel with Xargs

A neat single liner to run tasks in parallel with xargs command available on every Linux/Unix server.
#!/bin/bash

...
echo PARALLEL_JOBS:${PARALLEL_JOBS:=1}

declare -a tests=($(.../find_all_tests))
echo "${tests[@]}" | \
  xargs -d' ' -n1 -P${PARALLEL_JOBS} -I {} bash -c ".../run_test {}" || { echo "FAILURE"; exit 1; }

echo "SUCCESS"