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

Version Path
trackler-2.0.8.31 tracks/c/bin/run-tests
trackler-2.0.8.30 tracks/c/bin/run-tests
trackler-2.0.8.29 tracks/c/bin/run-tests
trackler-2.0.8.28 tracks/c/bin/run-tests
trackler-2.0.8.27 tracks/c/bin/run-tests
trackler-2.0.8.26 tracks/c/bin/run-tests
trackler-2.0.8.24 tracks/c/bin/run-tests
trackler-2.0.8.23 tracks/c/bin/run-tests
trackler-2.0.8.22 tracks/c/bin/run-tests
trackler-2.0.8.21 tracks/c/bin/run-tests
trackler-2.0.8.20 tracks/c/bin/run-tests
trackler-2.0.8.19 tracks/c/bin/run-tests
trackler-2.0.8.18 tracks/c/bin/run-tests
trackler-2.0.8.17 tracks/c/bin/run-tests
trackler-2.0.8.16 tracks/c/bin/run-tests
trackler-2.0.8.15 tracks/c/bin/run-tests
trackler-2.0.8.14 tracks/c/bin/run-tests
trackler-2.0.8.13 tracks/c/bin/run-tests
trackler-2.0.8.12 tracks/c/bin/run-tests
trackler-2.0.8.11 tracks/c/bin/run-tests