summaryrefslogtreecommitdiffstats
path: root/pts-core/objects/pts_result_file.php
blob: 8735377418349af561feb0983dd512c886ab2d30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<?php

/*
	Phoronix Test Suite
	URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
	Copyright (C) 2008, Phoronix Media
	Copyright (C) 2008, Michael Larabel

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

class pts_result_file
{
	var $system_hardware;
	var $system_software;
	var $system_author;
	var $system_notes;
	var $system_date;
	var $system_pts_version;
	var $system_identifiers;

	var $suite_name;
	var $suite_title;
	var $suite_version;
	var $suite_description;
	var $suite_extensions;
	var $suite_properties;
	var $suite_type;

	var $results_name;
	var $results_version;
	var $results_attributes;
	var $results_scale;
	var $results_test_name;
	var $results_arguments;
	var $results_proportion;
	var $results_format;

	var $results_identifiers;
	var $results_values;
	var $results_raw_values;

	public function __construct($result_file)
	{
		$xml_reader = new tandem_XmlReader($result_file);
		$this->system_hardware = $xml_reader->getXMLArrayValues(P_RESULTS_SYSTEM_HARDWARE);
		$this->system_software = $xml_reader->getXMLArrayValues(P_RESULTS_SYSTEM_SOFTWARE);
		$this->system_author = $xml_reader->getXMLArrayValues(P_RESULTS_SYSTEM_AUTHOR);
		$this->system_notes = $xml_reader->getXMLArrayValues(P_RESULTS_SYSTEM_NOTES);
		$this->system_date = $xml_reader->getXMLArrayValues(P_RESULTS_SYSTEM_DATE);
		$this->system_pts_version = $xml_reader->getXMLArrayValues(P_RESULTS_SYSTEM_PTSVERSION);
		$this->system_identifiers = $xml_reader->getXMLArrayValues(P_RESULTS_SYSTEM_IDENTIFIERS);
		$results_raw = $xml_reader->getXMLArrayValues(P_RESULTS_RESULTS_GROUP);

		$this->suite_name = $xml_reader->getXMLValue(P_RESULTS_SUITE_NAME);
		$this->suite_version = $xml_reader->getXMLValue(P_RESULTS_SUITE_VERSION);
		$this->suite_title = $xml_reader->getXMLValue(P_RESULTS_SUITE_TITLE);
		$this->suite_description = $xml_reader->getXMLValue(P_RESULTS_SUITE_DESCRIPTION);
		$this->suite_extensions = $xml_reader->getXMLValue(P_RESULTS_SUITE_EXTENSIONS);
		$this->suite_properties = $xml_reader->getXMLValue(P_RESULTS_SUITE_PROPERTIES);
		$this->suite_type = $xml_reader->getXMLValue(P_RESULTS_SUITE_TYPE);

		$this->results_name = $xml_reader->getXMLArrayValues(P_RESULTS_TEST_TITLE);
		$this->results_version = $xml_reader->getXMLArrayValues(P_RESULTS_TEST_VERSION);
		$this->results_attributes = $xml_reader->getXMLArrayValues(P_RESULTS_TEST_ATTRIBUTES);
		$this->results_scale = $xml_reader->getXMLArrayValues(P_RESULTS_TEST_SCALE);
		$this->results_test_name = $xml_reader->getXMLArrayValues(P_RESULTS_TEST_TESTNAME);
		$this->results_arguments = $xml_reader->getXMLArrayValues(P_RESULTS_TEST_ARGUMENTS);
		$this->results_proportion = $xml_reader->getXMLArrayValues(P_RESULTS_TEST_PROPORTION);
		$this->results_format = $xml_reader->getXMLArrayValues(P_RESULTS_TEST_RESULTFORMAT);

		$results_identifiers = array();
		$results_values = array();
		$results_rawvalues = array();

		foreach($results_raw as $result_raw)
		{
			$xml_results = new tandem_XmlReader($result_raw);
			array_push($results_identifiers, $xml_results->getXMLArrayValues(S_RESULTS_RESULTS_GROUP_IDENTIFIER));
			array_push($results_values, $xml_results->getXMLArrayValues(S_RESULTS_RESULTS_GROUP_VALUE));
			array_push($results_rawvalues, $xml_results->getXMLArrayValues(S_RESULTS_RESULTS_GROUP_RAW));
		}

		$this->results_identifiers = $results_identifiers;
		$this->results_values = $results_values;
		$this->results_raw_values = $results_rawvalues;
	}

	public function get_system_hardware()
	{
		return $this->system_hardware;
	}
	public function get_system_software()
	{
		return $this->system_software;
	}
	public function get_system_author()
	{
		return $this->system_author;
	}
	public function get_system_notes()
	{
		return $this->system_notes;
	}
	public function get_system_date()
	{
		return $this->system_date;
	}
	public function get_system_pts_version()
	{
		return $this->system_pts_version;
	}
	public function get_system_identifiers()
	{
		return $this->system_identifiers;
	}

	public function get_suite_name()
	{
		return $this->suite_name;
	}
	public function get_suite_title()
	{
		return $this->suite_title;
	}
	public function get_suite_version()
	{
		return $this->suite_version;
	}
	public function get_suite_description()
	{
		return $this->suite_description;
	}
	public function get_suite_extensions()
	{
		return $this->suite_extensions;
	}
	public function get_suite_properties()
	{
		return $this->suite_properties;
	}
	public function get_suite_type()
	{
		return $this->suite_type;
	}

	public function get_results_name()
	{
		return $this->results_name;
	}
	public function get_results_version()
	{
		return $this->results_version;
	}
	public function get_results_attributes()
	{
		return $this->results_attributes;
	}
	public function get_results_scale()
	{
		return $this->results_scale;
	}
	public function get_results_test_name()
	{
		return $this->results_test_name;
	}
	public function get_results_arguments()
	{
		return $this->results_arguments;
	}
	public function get_results_proportion()
	{
		return $this->results_proportion;
	}
	public function get_results_format()
	{
		return $this->results_format;
	}

	public function get_results_identifiers()
	{
		return $this->results_identifiers;
	}
	public function get_results_values()
	{
		return $this->results_values;
	}
	public function get_results_raw_values()
	{
		return $this->results_raw_values;
	}
}

?>