test.test 430 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. stdout=$(${program})
  3. retval=$?
  4. echo 1..3
  5. if [ $retval -eq 0 ]; then
  6. echo "ok - Exits without error"
  7. else
  8. echo "not ok - Exist with ${retval}"
  9. fi
  10. if [ -z "${stdout}" ]; then
  11. echo "not ok - no output"
  12. else
  13. echo "ok - outputs data"
  14. fi
  15. stderr=$(echo ${testdata} | ${program} 2>&1 >/dev/null)
  16. if [ -z ${stderr} ]; then
  17. echo "ok - Does not output an error message"
  18. else
  19. echo "not ok - Outputs an error message"
  20. fi