ocarina/saria-test.py

39 lines
667 B
Python

# Bryan Schumaker (8/7/2010)
import os
import sys
import datetime
now = datetime.datetime.now
print "Loading libsaria"
before = now()
import libsaria
after = now()
print "libsaria loaded (", after-before, ")"
if len(sys.argv) == 1:
from libsaria import fns
fns.startup()
print
print "Available tests:"
for file in os.listdir("tests"):
split = file.rsplit(".")
if split[1] == "pyc":
continue
if split[0] == "__init__":
continue
print " ", file
for file in sys.argv[1:]:
print
print "=====", file, "====="
print
begin = now()
__import__("tests."+file.rsplit(".")[0])
end = now()
print
print "=====", file, "(", after-before,") ====="