Sha256: 0817c6c14f8a92e4d45216d7584f55d0ba92119724c3a01b8ab593a5d79329e4

Contents?: true

Size: 853 Bytes

Versions: 91

Compression:

Stored size: 853 Bytes

Contents

#!/usr/bin/env bash
#
# Validate if tests can run properly and the example implementation
# is passing the tests for each exercise

set -o errexit
set -o nounset

root_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../ && pwd )"
temp_folder_name="exercises_temp/"
temp_folder="$root_path/$temp_folder_name"

# Clean up after script on normal or forced exit
trap "{ rm -rf $temp_folder; }" EXIT

cp exercises $temp_folder -r
cd $temp_folder

for exercise in *; do
  cd $exercise
  echo "Processing $exercise"

  # Replace "-" with "_" to follow bash conventions
  exercise_name=$(echo "$exercise" | sed -r 's/[-]+/_/g')
  test_file=${exercise_name}_test.sh

  # Create implementation file from example
  cp example.sh ${exercise_name}.sh

  # Unskip all the tests
  sed -i 's/skip/# skip/g' $test_file

  # Run the tests
  bats $test_file

  cd ../
done

Version data entries

91 entries across 91 versions & 1 rubygems

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