1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 from glob import glob
21 import os.path
22 from qm.test import base
23 from qm.test.reader_test_run import ReaderTestRun
24 from qm.test.run_database import RunDatabase
25
26
27
28
29
31 """A 'DirRunDatabase' reads test runs from a directory.
32
33 A 'DirRunDatabase' is associated with a given directory. The
34 database consists of all '.qmr' files in the directory. Each
35 '.qmr' file is treated as a result file."""
36
37 - def __init__(self, directory, database):
38 """Create a new 'DirRunDatabase'.
39
40 'directory' -- The path to the directory containing the
41 results files.
42
43 'database' -- The test 'Database' to which the results files
44 correspond."""
45
46 self.__runs = []
47
48 for f in glob(os.path.join(directory, "*.qmr")):
49 try:
50
51 reader = base.load_results(f, database)
52 run = ReaderTestRun(reader)
53 except:
54
55
56 continue
57
58 self.__runs.append(run)
59
60
62
63 return self.__runs
64