test-common.sh.in 865 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # program locations
  2. AUDIOWMARK=@top_builddir@/src/audiowmark
  3. TEST_MSG=f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0
  4. # common shell functions
  5. die()
  6. {
  7. echo >&2 "$0: $@"
  8. exit 1
  9. }
  10. audiowmark()
  11. {
  12. if [ "x$Q" == "x1" ] && [ -z "$V" ]; then
  13. AUDIOWMARK_Q="-q"
  14. else
  15. echo >&2 ==== audiowmark "$@" ====
  16. fi
  17. $AUDIOWMARK --strict "$@" || die "failed to run audiowmark $@"
  18. }
  19. audiowmark_add()
  20. {
  21. if [ "x$Q" == "x1" ] && [ -z "$V" ]; then
  22. AUDIOWMARK_Q="-q"
  23. else
  24. echo >&2 ==== audiowmark add "$@" ====
  25. fi
  26. $AUDIOWMARK $AUDIOWMARK_Q --strict add "$@" || die "failed to watermark $@"
  27. }
  28. audiowmark_cmp()
  29. {
  30. if [ "x$Q" == "x1" ] && [ -z "$V" ]; then
  31. AUDIOWMARK_OUT="/dev/null"
  32. else
  33. AUDIOWMARK_OUT="/dev/stdout"
  34. echo >&2 ==== audiowmark cmp "$@" ====
  35. fi
  36. $AUDIOWMARK --strict cmp "$@" > $AUDIOWMARK_OUT || die "failed to detect watermark $@"
  37. }