run_performance.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/usr/bin/python
  2. # Script for automatically run performance tests
  3. # author: sana
  4. # contributor: tct
  5. import subprocess
  6. # list of data structures
  7. teste = ["algorithms",
  8. "avl_tree",
  9. "b_tree",
  10. "binary_search_tree",
  11. "binary_tree",
  12. "doubly_linked_list",
  13. "hash_map",
  14. "hash_set",
  15. "heap",
  16. "interval_tree",
  17. "linked_list",
  18. "matrix",
  19. "mgraph",
  20. "pair",
  21. "queue",
  22. "red_black_tree",
  23. "scapegoat_tree",
  24. "skip_list",
  25. "sort",
  26. "splay_tree",
  27. "stack",
  28. "treap_tree",
  29. "tree_algorithms",
  30. "tree",
  31. "trie_tree",
  32. "vector"]
  33. EXEC = "./temelia_performance "
  34. # no. of failed and passed tests
  35. failed = 0
  36. passed = 0
  37. print "* Compiling performance tests..."
  38. subprocess.call("make")
  39. print "* Testing Temelia's performance..."
  40. for test in teste:
  41. if (subprocess.call(EXEC + test, shell=True) != 0):
  42. failed += 1
  43. else:
  44. passed += 1
  45. print "Done."
  46. print 'Statistics: ' + str(failed) + ' failed tests' + ' | ' + \
  47. str(passed) + ' passed tests.'