Sha256: 1d789036cf3f84b4a8ed3685f2b1b428fd3516f61aa7a9a188048f7bee3a9082

Contents?: true

Size: 1 KB

Versions: 109

Compression:

Stored size: 1 KB

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}"

        #remove the ignore line
        sed -i.bak 's/TEST_IGNORE();//' ${D}/test/test_*.c

        # 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 memcheck | grep FAIL: ; then
            exit 1
          elif [ ${PIPESTATUS[0]} -ne 0 ]; then
            exit 1
          fi
          cd ${CURRENT_DIR};
        }
    fi
done

Version data entries

109 entries across 109 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/c/bin/run-tests
trackler-2.2.1.179 tracks/c/bin/run-tests
trackler-2.2.1.178 tracks/c/bin/run-tests
trackler-2.2.1.177 tracks/c/bin/run-tests
trackler-2.2.1.176 tracks/c/bin/run-tests
trackler-2.2.1.175 tracks/c/bin/run-tests
trackler-2.2.1.174 tracks/c/bin/run-tests
trackler-2.2.1.173 tracks/c/bin/run-tests
trackler-2.2.1.172 tracks/c/bin/run-tests
trackler-2.2.1.171 tracks/c/bin/run-tests
trackler-2.2.1.170 tracks/c/bin/run-tests
trackler-2.2.1.169 tracks/c/bin/run-tests
trackler-2.2.1.167 tracks/c/bin/run-tests
trackler-2.2.1.166 tracks/c/bin/run-tests
trackler-2.2.1.165 tracks/c/bin/run-tests
trackler-2.2.1.164 tracks/c/bin/run-tests
trackler-2.2.1.163 tracks/c/bin/run-tests
trackler-2.2.1.162 tracks/c/bin/run-tests
trackler-2.2.1.161 tracks/c/bin/run-tests
trackler-2.2.1.160 tracks/c/bin/run-tests