| 1 |
lars |
1 |
--
|
|
|
2 |
-- PHPUnit
|
|
|
3 |
--
|
|
|
4 |
-- Copyright (c) 2002-2009, Sebastian Bergmann <sb@sebastian-bergmann.de>.
|
|
|
5 |
-- All rights reserved.
|
|
|
6 |
--
|
|
|
7 |
-- Redistribution and use in source and binary forms, with or without
|
|
|
8 |
-- modification, are permitted provided that the following conditions
|
|
|
9 |
-- are met:
|
|
|
10 |
--
|
|
|
11 |
-- * Redistributions of source code must retain the above copyright
|
|
|
12 |
-- notice, this list of conditions and the following disclaimer.
|
|
|
13 |
--
|
|
|
14 |
-- * Redistributions in binary form must reproduce the above copyright
|
|
|
15 |
-- notice, this list of conditions and the following disclaimer in
|
|
|
16 |
-- the documentation and/or other materials provided with the
|
|
|
17 |
-- distribution.
|
|
|
18 |
--
|
|
|
19 |
-- * Neither the name of Sebastian Bergmann nor the names of his
|
|
|
20 |
-- contributors may be used to endorse or promote products derived
|
|
|
21 |
-- from this software without specific prior written permission.
|
|
|
22 |
--
|
|
|
23 |
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
24 |
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
25 |
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
26 |
-- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
27 |
-- COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
28 |
-- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
29 |
-- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
30 |
-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
31 |
-- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
32 |
-- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
33 |
-- ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
34 |
-- POSSIBILITY OF SUCH DAMAGE.
|
|
|
35 |
--
|
|
|
36 |
-- $Id$
|
|
|
37 |
--
|
|
|
38 |
|
|
|
39 |
CREATE TABLE IF NOT EXISTS run(
|
|
|
40 |
run_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
41 |
timestamp INTEGER,
|
|
|
42 |
revision INTEGER,
|
|
|
43 |
information STRING,
|
|
|
44 |
completed INTEGER DEFAULT 0
|
|
|
45 |
);
|
|
|
46 |
|
|
|
47 |
CREATE TABLE IF NOT EXISTS test(
|
|
|
48 |
run_id INTEGER,
|
|
|
49 |
test_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
50 |
test_name TEXT,
|
|
|
51 |
test_result INTEGER DEFAULT 0,
|
|
|
52 |
test_message TEXT DEFAULT "",
|
|
|
53 |
test_execution_time REAL DEFAULT 0,
|
|
|
54 |
code_method_id INTEGER,
|
|
|
55 |
node_root INTEGER,
|
|
|
56 |
node_left INTEGER,
|
|
|
57 |
node_right INTEGER,
|
|
|
58 |
node_parent INTEGER,
|
|
|
59 |
node_depth INTEGER,
|
|
|
60 |
node_is_leaf INTEGER DEFAULT 0
|
|
|
61 |
);
|
|
|
62 |
|
|
|
63 |
CREATE INDEX IF NOT EXISTS test_run_id ON test (run_id);
|
|
|
64 |
CREATE INDEX IF NOT EXISTS test_result ON test (test_result);
|
|
|
65 |
CREATE INDEX IF NOT EXISTS test_code_method_id ON test (code_method_id);
|
|
|
66 |
CREATE INDEX IF NOT EXISTS test_node_root ON test (node_root);
|
|
|
67 |
CREATE INDEX IF NOT EXISTS test_node_left ON test (node_left);
|
|
|
68 |
CREATE INDEX IF NOT EXISTS test_node_right ON test (node_right);
|
|
|
69 |
CREATE INDEX IF NOT EXISTS test_node_parent ON test (node_parent);
|
|
|
70 |
|
|
|
71 |
CREATE TABLE IF NOT EXISTS code_file(
|
|
|
72 |
code_file_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
73 |
code_file_name TEXT,
|
|
|
74 |
code_full_file_name TEXT,
|
|
|
75 |
code_file_md5 TEXT,
|
|
|
76 |
revision INTEGER
|
|
|
77 |
);
|
|
|
78 |
|
|
|
79 |
CREATE TABLE IF NOT EXISTS code_function(
|
|
|
80 |
code_file_id INTEGER,
|
|
|
81 |
code_function_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
82 |
code_function_name TEXT,
|
|
|
83 |
code_function_start_line INTEGER,
|
|
|
84 |
code_function_end_line INTEGER
|
|
|
85 |
);
|
|
|
86 |
|
|
|
87 |
CREATE INDEX IF NOT EXISTS code_file_id ON code_function (code_file_id);
|
|
|
88 |
|
|
|
89 |
CREATE TABLE IF NOT EXISTS code_class(
|
|
|
90 |
code_file_id INTEGER,
|
|
|
91 |
code_class_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
92 |
code_class_parent_id INTEGER,
|
|
|
93 |
code_class_name TEXT,
|
|
|
94 |
code_class_start_line INTEGER,
|
|
|
95 |
code_class_end_line INTEGER
|
|
|
96 |
);
|
|
|
97 |
|
|
|
98 |
CREATE INDEX IF NOT EXISTS code_file_id ON code_class (code_file_id);
|
|
|
99 |
|
|
|
100 |
CREATE TABLE IF NOT EXISTS code_method(
|
|
|
101 |
code_class_id INTEGER,
|
|
|
102 |
code_method_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
103 |
code_method_name TEXT,
|
|
|
104 |
code_method_start_line INTEGER,
|
|
|
105 |
code_method_end_line INTEGER
|
|
|
106 |
);
|
|
|
107 |
|
|
|
108 |
CREATE INDEX IF NOT EXISTS code_class_id ON code_method (code_class_id);
|
|
|
109 |
|
|
|
110 |
CREATE TABLE IF NOT EXISTS code_line(
|
|
|
111 |
code_file_id INTEGER,
|
|
|
112 |
code_line_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
113 |
code_line_number INTEGER,
|
|
|
114 |
code_line TEXT,
|
|
|
115 |
code_line_covered INTEGER
|
|
|
116 |
);
|
|
|
117 |
|
|
|
118 |
CREATE INDEX IF NOT EXISTS code_line_code_file_id ON code_line (code_file_id);
|
|
|
119 |
|
|
|
120 |
CREATE TABLE IF NOT EXISTS code_coverage(
|
|
|
121 |
test_id INTEGER,
|
|
|
122 |
code_line_id INTEGER
|
|
|
123 |
);
|
|
|
124 |
|
|
|
125 |
CREATE UNIQUE INDEX IF NOT EXISTS code_coverage_test_id_code_line_id ON code_coverage (test_id, code_line_id);
|
|
|
126 |
|
|
|
127 |
CREATE TABLE IF NOT EXISTS metrics_project(
|
|
|
128 |
run_id INTEGER,
|
|
|
129 |
metrics_project_cls INTEGER,
|
|
|
130 |
metrics_project_clsa INTEGER,
|
|
|
131 |
metrics_project_clsc INTEGER,
|
|
|
132 |
metrics_project_roots INTEGER,
|
|
|
133 |
metrics_project_leafs INTEGER,
|
|
|
134 |
metrics_project_interfs INTEGER,
|
|
|
135 |
metrics_project_maxdit INTEGER
|
|
|
136 |
);
|
|
|
137 |
|
|
|
138 |
CREATE INDEX IF NOT EXISTS run_id ON metrics_project (run_id);
|
|
|
139 |
|
|
|
140 |
CREATE TABLE IF NOT EXISTS metrics_file(
|
|
|
141 |
run_id INTEGER,
|
|
|
142 |
code_file_id INTEGER,
|
|
|
143 |
metrics_file_coverage REAL,
|
|
|
144 |
metrics_file_loc INTEGER,
|
|
|
145 |
metrics_file_cloc INTEGER,
|
|
|
146 |
metrics_file_ncloc INTEGER,
|
|
|
147 |
metrics_file_loc_executable INTEGER,
|
|
|
148 |
metrics_file_loc_executed INTEGER
|
|
|
149 |
);
|
|
|
150 |
|
|
|
151 |
CREATE INDEX IF NOT EXISTS run_id ON metrics_file (run_id);
|
|
|
152 |
CREATE INDEX IF NOT EXISTS code_file_id ON metrics_file (code_file_id);
|
|
|
153 |
|
|
|
154 |
CREATE TABLE IF NOT EXISTS metrics_function(
|
|
|
155 |
run_id INTEGER,
|
|
|
156 |
code_function_id INTEGER,
|
|
|
157 |
metrics_function_coverage REAL,
|
|
|
158 |
metrics_function_loc INTEGER,
|
|
|
159 |
metrics_function_loc_executable INTEGER,
|
|
|
160 |
metrics_function_loc_executed INTEGER,
|
|
|
161 |
metrics_function_ccn INTEGER,
|
|
|
162 |
metrics_function_crap REAL,
|
|
|
163 |
metrics_function_npath INTEGER
|
|
|
164 |
);
|
|
|
165 |
|
|
|
166 |
CREATE INDEX IF NOT EXISTS run_id ON metrics_function (run_id);
|
|
|
167 |
CREATE INDEX IF NOT EXISTS code_function_id ON metrics_function (code_function_id);
|
|
|
168 |
|
|
|
169 |
CREATE TABLE IF NOT EXISTS metrics_class(
|
|
|
170 |
run_id INTEGER,
|
|
|
171 |
code_class_id INTEGER,
|
|
|
172 |
metrics_class_coverage REAL,
|
|
|
173 |
metrics_class_loc INTEGER,
|
|
|
174 |
metrics_class_loc_executable INTEGER,
|
|
|
175 |
metrics_class_loc_executed INTEGER,
|
|
|
176 |
metrics_class_aif REAL,
|
|
|
177 |
metrics_class_ahf REAL,
|
|
|
178 |
metrics_class_cis INTEGER,
|
|
|
179 |
metrics_class_csz INTEGER,
|
|
|
180 |
metrics_class_dit INTEGER,
|
|
|
181 |
metrics_class_impl INTEGER,
|
|
|
182 |
metrics_class_mif REAL,
|
|
|
183 |
metrics_class_mhf REAL,
|
|
|
184 |
metrics_class_noc INTEGER,
|
|
|
185 |
metrics_class_pf REAL,
|
|
|
186 |
metrics_class_vars INTEGER,
|
|
|
187 |
metrics_class_varsnp INTEGER,
|
|
|
188 |
metrics_class_varsi INTEGER,
|
|
|
189 |
metrics_class_wmc INTEGER,
|
|
|
190 |
metrics_class_wmcnp INTEGER,
|
|
|
191 |
metrics_class_wmci INTEGER
|
|
|
192 |
);
|
|
|
193 |
|
|
|
194 |
CREATE INDEX IF NOT EXISTS run_id ON metrics_class (run_id);
|
|
|
195 |
CREATE INDEX IF NOT EXISTS code_class_id ON metrics_class (code_class_id);
|
|
|
196 |
|
|
|
197 |
CREATE TABLE IF NOT EXISTS metrics_method(
|
|
|
198 |
run_id INTEGER,
|
|
|
199 |
code_method_id INTEGER,
|
|
|
200 |
metrics_method_coverage REAL,
|
|
|
201 |
metrics_method_loc INTEGER,
|
|
|
202 |
metrics_method_loc_executable INTEGER,
|
|
|
203 |
metrics_method_loc_executed INTEGER,
|
|
|
204 |
metrics_method_ccn INTEGER,
|
|
|
205 |
metrics_method_crap REAL,
|
|
|
206 |
metrics_method_npath INTEGER
|
|
|
207 |
);
|
|
|
208 |
|
|
|
209 |
CREATE INDEX IF NOT EXISTS run_id ON metrics_method (run_id);
|
|
|
210 |
CREATE INDEX IF NOT EXISTS code_method_id ON metrics_method (code_method_id);
|