# HG changeset patch # User paulb # Date 1116172004 0 # Node ID e48fa274811fca9a457b7ba2dc8b71647db251d8 # Parent dac46be1fe30d13ec702cdb75c03f39369790aa2 [project @ 2005-05-15 15:46:44 by paulb] Introduced support for iterating over the test. diff -r dac46be1fe30 -r e48fa274811f tests/begat.py --- a/tests/begat.py Sun May 15 14:30:10 2005 +0000 +++ b/tests/begat.py Sun May 15 15:46:44 2005 +0000 @@ -52,21 +52,28 @@ full_xpath = "--full" in sys.argv use_libxml2dom = "libxml2dom" in sys.argv use_libxml2macro = "libxml2macro" in sys.argv + iterations = [int(arg.split("-")[0]) for arg in sys.argv if arg.endswith("-times")] if len(ot_locations) == 0: print "Please specify the location of the ot.xml file." sys.exit(1) + if len(iterations) == 0: + iterations = 1 + else: + iterations = iterations[0] + raw_input("Start your engines with ps -p %s -fv" % os.getpid()) t = time.time() - if use_libxml2macro: - n_doc = parseFile(ot_locations[0]) - l = test_begat_libxml2macro(n_doc, full_xpath) - else: # use_libxml2dom: - import libxml2dom - doc = libxml2dom.parse(ot_locations[0]) - l = test_begat_libxml2dom(doc, full_xpath) + for i in range(0, iterations): + if use_libxml2macro: + n_doc = parseFile(ot_locations[0]) + l = test_begat_libxml2macro(n_doc, full_xpath) + else: # use_libxml2dom: + import libxml2dom + doc = libxml2dom.parse(ot_locations[0]) + l = test_begat_libxml2dom(doc, full_xpath) print "Time taken", time.time() - t raw_input("Stop your engines!")