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.78 tracks/c/bin/run-tests
trackler-2.2.1.77 tracks/c/bin/run-tests
trackler-2.2.1.76 tracks/c/bin/run-tests
trackler-2.2.1.75 tracks/c/bin/run-tests
trackler-2.2.1.74 tracks/c/bin/run-tests
trackler-2.2.1.73 tracks/c/bin/run-tests
trackler-2.2.1.72 tracks/c/bin/run-tests
trackler-2.2.1.71 tracks/c/bin/run-tests
trackler-2.2.1.70 tracks/c/bin/run-tests