leak_heredoc1.tests 440 B

12345678910111213141516171819202122232425262728293031323334
  1. echo "Warm up"
  2. i=1
  3. while test $i != 99; do
  4. : <<HERE
  5. Hello $i `echo builtin_$i`
  6. HERE
  7. : $((i++))
  8. done
  9. memleak
  10. echo "Measuring memory leak..."
  11. i=1
  12. while test $i != 99; do
  13. : <<HERE
  14. Hello $i `echo builtin_$i`
  15. HERE
  16. : $((i++))
  17. done
  18. i=1
  19. while test $i != 99; do
  20. : <<HERE
  21. Hello $i `echo builtin_$i`
  22. HERE
  23. : $((i++))
  24. done
  25. memleak
  26. kb=$?
  27. if test $kb -le 4; then
  28. echo Ok #$kb
  29. else
  30. echo "Bad: $kb kb (or more) leaked"
  31. fi