Sha256: 759742670f80af3341f050d32ea2e7f8e26646eb1998f866953e576a4082517e

Contents?: true

Size: 1.08 KB

Versions: 27

Compression:

Stored size: 1.08 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 | grep FAIL: ; then
            exit 1
          elif [ ${PIPESTATUS[0]} -ne 0 ]; then
            exit 1
          fi
          valgrind --quiet --leak-check=full --error-exitcode=1 ./tests.out >> /dev/null;
          cd ${CURRENT_DIR};
        }
    fi
done

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
trackler-2.2.1.69 tracks/c/bin/run-tests
trackler-2.2.1.68 tracks/c/bin/run-tests
trackler-2.2.1.67 tracks/c/bin/run-tests
trackler-2.2.1.66 tracks/c/bin/run-tests
trackler-2.2.1.65 tracks/c/bin/run-tests
trackler-2.2.1.64 tracks/c/bin/run-tests
trackler-2.2.1.63 tracks/c/bin/run-tests
trackler-2.2.1.62 tracks/c/bin/run-tests
trackler-2.2.1.61 tracks/c/bin/run-tests
trackler-2.2.1.60 tracks/c/bin/run-tests
trackler-2.2.1.59 tracks/c/bin/run-tests
trackler-2.2.1.58 tracks/c/bin/run-tests
trackler-2.2.1.57 tracks/c/bin/run-tests
trackler-2.2.1.56 tracks/c/bin/run-tests
trackler-2.2.1.55 tracks/c/bin/run-tests
trackler-2.2.1.54 tracks/c/bin/run-tests
trackler-2.2.1.53 tracks/c/bin/run-tests
trackler-2.2.1.52 tracks/c/bin/run-tests
trackler-2.2.1.51 tracks/c/bin/run-tests
trackler-2.2.1.50 tracks/c/bin/run-tests