runAllTests.praat 787 B

12345678910111213141516171819202122232425262728
  1. # run_all_tests.praat
  2. tests = Create Strings as file list: "tests", "test_*.praat"
  3. ntests = Get number of strings
  4. for itest to ntests
  5. selectObject: tests
  6. test$ = Get string: itest
  7. appendInfoLine: test$
  8. report_before$ = Report memory use
  9. runScript: test$
  10. @check_memory: report_before$, " "
  11. endfor
  12. procedure check_memory: .report_before$, .preprint$
  13. .m$[1] = "Strings: "
  14. .m$[2] = "Arrays: "
  15. .m$[3] = "Things: "
  16. .report_after$ = Report memory use
  17. appendInfoLine: .preprint$, "Memory:"
  18. for .i to 3
  19. .nb = extractNumber (.report_before$, .m$[.i])
  20. .na = extractNumber (.report_after$, .m$[.i])
  21. .post$ = if .nb <> .na then " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" else "" endif
  22. appendInfoLine: .preprint$, .m$[.i], .nb, " ", .na, .post$
  23. endfor
  24. endproc
  25. removeObject: tests