diff --git a/script/make_utils/run_use_case_examples.sh b/script/make_utils/run_use_case_examples.sh index 206baeb73..027459ac6 100755 --- a/script/make_utils/run_use_case_examples.sh +++ b/script/make_utils/run_use_case_examples.sh @@ -41,16 +41,19 @@ else fi fi -for EXAMPLE in ${LIST_OF_USE_CASES[@]} +declare -a success_examples +declare -a failed_examples + +for EXAMPLE in "${LIST_OF_USE_CASES[@]}" do EXAMPLE_NAME=$(basename "${EXAMPLE}") - if [ -f "${EXAMPLE}/Makefile" ]; then - echo "*** Processing example ${EXAMPLE_NAME}" - else + if [ ! -f "${EXAMPLE}/Makefile" ]; then continue fi + echo "*** Processing example ${EXAMPLE_NAME}" + # Setup a new venv VENV_PATH="/tmp/virtualenv_${EXAMPLE_NAME}" if [ -d "$VENV_PATH" ]; then @@ -69,6 +72,7 @@ do if [ $hresult -ne 0 ]; then echo "Could not install Concrete ML in the virtualenv, see /tmp/log_cml_pip_${EXAMPLE_NAME}" rm -rf "$VENV_PATH" + failed_examples+=("$EXAMPLE_NAME") continue fi echo " - Concrete ML installed in $VENV_PATH" @@ -81,6 +85,7 @@ do if [ $hresult -ne 0 ]; then echo "Could not install example requirements in the virtualenv, see /tmp/log_reqs_${EXAMPLE_NAME}" rm -rf "$VENV_PATH" + failed_examples+=("$EXAMPLE_NAME") continue fi echo " - Requirements installed in $VENV_PATH" @@ -100,9 +105,24 @@ do hresult="${PIPESTATUS[0]}" if [ "$hresult" -ne 0 ]; then echo "Error while running example ${EXAMPLE_NAME}" + failed_examples+=("$EXAMPLE_NAME") + else + success_examples+=("$EXAMPLE_NAME") fi set -e # Remove the virtualenv rm -rf "$VENV_PATH" done + +# Print summary +echo +echo "Summary:" +echo "Successes: ${#success_examples[@]} examples" +for example in "${success_examples[@]}"; do + echo " - $example" +done +echo "Failures: ${#failed_examples[@]} examples" +for example in "${failed_examples[@]}"; do + echo " - $example" +done