1.1 --- a/tests/begat.py Sun May 15 14:30:10 2005 +0000
1.2 +++ b/tests/begat.py Sun May 15 15:46:44 2005 +0000
1.3 @@ -52,21 +52,28 @@
1.4 full_xpath = "--full" in sys.argv
1.5 use_libxml2dom = "libxml2dom" in sys.argv
1.6 use_libxml2macro = "libxml2macro" in sys.argv
1.7 + iterations = [int(arg.split("-")[0]) for arg in sys.argv if arg.endswith("-times")]
1.8
1.9 if len(ot_locations) == 0:
1.10 print "Please specify the location of the ot.xml file."
1.11 sys.exit(1)
1.12
1.13 + if len(iterations) == 0:
1.14 + iterations = 1
1.15 + else:
1.16 + iterations = iterations[0]
1.17 +
1.18 raw_input("Start your engines with ps -p %s -fv" % os.getpid())
1.19 t = time.time()
1.20
1.21 - if use_libxml2macro:
1.22 - n_doc = parseFile(ot_locations[0])
1.23 - l = test_begat_libxml2macro(n_doc, full_xpath)
1.24 - else: # use_libxml2dom:
1.25 - import libxml2dom
1.26 - doc = libxml2dom.parse(ot_locations[0])
1.27 - l = test_begat_libxml2dom(doc, full_xpath)
1.28 + for i in range(0, iterations):
1.29 + if use_libxml2macro:
1.30 + n_doc = parseFile(ot_locations[0])
1.31 + l = test_begat_libxml2macro(n_doc, full_xpath)
1.32 + else: # use_libxml2dom:
1.33 + import libxml2dom
1.34 + doc = libxml2dom.parse(ot_locations[0])
1.35 + l = test_begat_libxml2dom(doc, full_xpath)
1.36
1.37 print "Time taken", time.time() - t
1.38 raw_input("Stop your engines!")