You are here

test.sh in Realistic Dummy Content 7.2

Same filename and directory in other branches
  1. 8.2 developer/test.sh
#!/bin/bash
#
# Runs some linting and unit tests, then creates instances of Drupal 7 and
# Drupal 8, and runs some tests on those environments.
#
set -e

BASEPATH="$(pwd)"
SCRIPTNAME="$(basename "$0")"

if [ ! -f "$BASEPATH"/"$SCRIPTNAME" ]; then
  echo -e '[error] Please run this script from the developer directory of'
  echo -e '        realistic_dummy_content, like this:'
  echo -e ''
  echo -e '            cd /path/to/realistic_dummy_content/developer'
  echo -e "            ./$SCRIPTNAME"
  echo -e ''
  exit 1;
fi

echo -e '[info] Test preflight.'
./lib/preflight.sh
echo -e '[info] Lint PHP.'
./lib/lint-php.sh
echo -e '[info] Lint shell.'
./lib/lint-shell.sh
echo -e '[info] Unit tests.'
./lib/unit.sh

if [ "$1" == "fast" ]; then
  echo -e '[info] You specified "fast" so we are exiting after fast checks'
  echo -e '       such as linting and unit tests. Full integration tests with'
  echo -e '       real environments can be performed if you run this script'
  echo -e '       without the fast parameter.'
  echo -e ''
  exit 0;
else
  echo -e '[info] You can specify "fast" to run only fast tests.'
fi

echo -e '[info] Build development environments.'
./build-dev-environment.sh

echo -e '[info] Running self-tests.'
for FRAMEWORK in $(/bin/ls frameworks | grep -v README); do
  echo -e "[info] Self-test for $FRAMEWORK."
  ./frameworks/"$FRAMEWORK"/selftest.sh
done

File

developer/test.sh
View source
  1. #!/bin/bash
  2. #
  3. # Runs some linting and unit tests, then creates instances of Drupal 7 and
  4. # Drupal 8, and runs some tests on those environments.
  5. #
  6. set -e
  7. BASEPATH="$(pwd)"
  8. SCRIPTNAME="$(basename "$0")"
  9. if [ ! -f "$BASEPATH"/"$SCRIPTNAME" ]; then
  10. echo -e '[error] Please run this script from the developer directory of'
  11. echo -e ' realistic_dummy_content, like this:'
  12. echo -e ''
  13. echo -e ' cd /path/to/realistic_dummy_content/developer'
  14. echo -e " ./$SCRIPTNAME"
  15. echo -e ''
  16. exit 1;
  17. fi
  18. echo -e '[info] Test preflight.'
  19. ./lib/preflight.sh
  20. echo -e '[info] Lint PHP.'
  21. ./lib/lint-php.sh
  22. echo -e '[info] Lint shell.'
  23. ./lib/lint-shell.sh
  24. echo -e '[info] Unit tests.'
  25. ./lib/unit.sh
  26. if [ "$1" == "fast" ]; then
  27. echo -e '[info] You specified "fast" so we are exiting after fast checks'
  28. echo -e ' such as linting and unit tests. Full integration tests with'
  29. echo -e ' real environments can be performed if you run this script'
  30. echo -e ' without the fast parameter.'
  31. echo -e ''
  32. exit 0;
  33. else
  34. echo -e '[info] You can specify "fast" to run only fast tests.'
  35. fi
  36. echo -e '[info] Build development environments.'
  37. ./build-dev-environment.sh
  38. echo -e '[info] Running self-tests.'
  39. for FRAMEWORK in $(/bin/ls frameworks | grep -v README); do
  40. echo -e "[info] Self-test for $FRAMEWORK."
  41. ./frameworks/"$FRAMEWORK"/selftest.sh
  42. done