00_bootstrap.py 1006 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/python
  2. import os, sys, mmap
  3. from regression import Regression
  4. loader = sys.argv[1]
  5. # Running Bootstrap
  6. regression = Regression(loader, "bootstrap")
  7. regression.add_check(name="Basic Bootstrapping",
  8. check=lambda res: "User Program Started" in res[0].out)
  9. regression.add_check(name="One Argument Given",
  10. check=lambda res: "# of Arguments: 1" in res[0].out and \
  11. "argv[0] = file:bootstrap" in res[0].out)
  12. regression.add_check(name="Five Arguments Given",
  13. args = ['a', 'b', 'c', 'd'],
  14. check=lambda res: "# of Arguments: 5" in res[0].out and \
  15. "argv[0] = file:bootstrap" in res[0].out and \
  16. "argv[1] = a" in res[0].out and "argv[2] = b" in res[0].out and \
  17. "argv[3] = c" in res[0].out and "argv[4] = d" in res[0].out)
  18. regression.run_checks()
  19. # Shared Object Test
  20. regression = Regression(loader, "shared_object")
  21. regression.add_check(name="Shared Object",
  22. check=lambda res: "Hello world" in res[0].out)
  23. regression.run_checks()