Sha256: cd786974cc0cc5ba12ecd83b8de22a94cfd2808ed2ba4bfe0bd7825f8e0ce89b
Contents?: true
Size: 928 Bytes
Versions: 117
Compression:
Stored size: 928 Bytes
Contents
#!/bin/bash set -e for D in exercises/*; do CURRENT_DIR=$(pwd) if [ -d "${D}" ]; then # Get the exercise name from the test file TEST_FILE=$(basename $(ls ${D}/test/test*)) STRIPPED_OF_EXTENSION="${TEST_FILE%.*}" EXERCISE_NAME="${STRIPPED_OF_EXTENSION:5}" # Copy the examples with the correct name for the exercise if [ -e "${D}/src/example.c" ] then cp ${D}/src/example.c ${D}/src/${EXERCISE_NAME}.c fi if [ -e "${D}/src/example.h" ] then cp ${D}/src/example.h ${D}/src/${EXERCISE_NAME}.h fi # Make it! { cd ${D}; echo "Running tests for ${EXERCISE_NAME}"; make clean >> /dev/null; if make | grep FAIL: ; then exit 1 elif [ ${PIPESTATUS[0]} -ne 0 ]; then exit 1 fi cd ${CURRENT_DIR}; } fi done
Version data entries
117 entries across 117 versions & 1 rubygems