You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
684 B

  1. #
  2. intent="testing all subroutines ..."
  3. if echo -n "\e" | grep -q -e 'e'; then
  4. e="-e" # bash needs a -e !
  5. fi
  6. # colors : [see also](https://en.wikipedia.org/wiki/ANSI_escape_code)
  7. nc=$(echo -n $e "\e[0m")
  8. export SITE='..';
  9. cp -p test.log test.log.1
  10. # savestdout and stderr
  11. exec 3>&1 4>&2
  12. exec > test.log
  13. exec 2>&1
  14. echo "--- ${0##*/}"
  15. for tc in *.t; do
  16. echo "tc: $tc"
  17. perl $tc
  18. echo '---'
  19. done
  20. echo '...'
  21. # restore stdout and stderr
  22. exec 1>&3 2>&4 3>&- 4>&-
  23. ipfs add -n -q test.log
  24. diff test.log test.log.1
  25. if [ $? = 0 ]; then
  26. green=$(echo -n $e "\e[1;32m")
  27. echo "${green}PASS${nc}"
  28. else
  29. red=$(echo -n $e "\e[31m")
  30. echo "${red}FAIL${nc}"
  31. exit 252
  32. fi
  33. true;