summaryrefslogtreecommitdiffstats
path: root/phoronix-test-suite
blob: 8daa47052592172770efa512918b02e13d125828 (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
206
207
208
209
210
#!/bin/sh

#
#	Phoronix Test Suite
#	URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
#	Copyright (C) 2008, Phoronix Media
#	Copyright (C) 2008, Michael Larabel
#	phoronix-test-suite: The Phoronix Test Suite is an extensible open-source testing / benchmarking platform
#
#	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/>.
#

# Full path to root directory of the actual Phoronix Test Suite code
export PTS_DIR=`pwd`
CALL_DIR=`pwd`

if [ $PTS_DIR != `pwd` ]
then
	cd $PTS_DIR
fi

# Determine PHP binary location
if [ -x /usr/bin/php5 ] || [ -x /usr/local/bin/php5 ]
then
	export PHP_BIN="php5"
elif [ -x /usr/bin/php ] || [ -x /usr/local/bin/php ]
then
	export PHP_BIN="php"
elif [ -x /usr/php5/bin/php ]
then
	export PHP_BIN="/usr/php5/bin/php"
elif [ -x /usr/php/bin/php ]
then
	export PHP_BIN="/usr/php/bin/php"
else
	export PHP_BIN=""
fi

# Make sure PHP is installed
if [ "X$PHP_BIN" = "X" ]
then
	cat <<'EOT'

PHP5 CLI Must Be Installed To Run The Phoronix Test Suite.
Only PHP For The Command Line Is Needed, Not A Complete PHP w/ Web Server Installation
The PHP CLI package is usually called php-cli or php5-cli. Also recommended is the PHP GD library (php-gd)
For support visit: http://www.phoronix-test-suite.com/

EOT
exit
fi

# Ensure the user is in the correct directory
if [ ! -f pts-core/phoronix-test-suite.php ]
then
	cat <<'EOT'

To run the Phoronix Test Suite locally you must first change directories to phoronix-test-suite/ 
or install the program using the install-sh script. For support visit: http://www.phoronix-test-suite.com/

EOT
exit
fi

# Check if being called from a Self Contained test profile
# export SCTP_FILE=`echo $CALL_DIR/$1 | sed 's:\./::g'`
# if [ -e $SCTP_FILE ]
# then
# 	export PTS_COMMAND="benchmark"
# 	$PHP_BIN pts-core/phoronix-test-suite.php BENCHMARK $SCTP_FILE
# 	exit
# fi

case "$1" in
"install" | "force-install")
	RUN_COMMAND="install_test"
	;;
"run" | "batch-run" | "default-run")
	if [ "$1" = "batch-run" ]
	then
		export PTS_BATCH_MODE=1
	fi
	if [ "$1" = "default-run" ]
	then
		export PTS_DEFAULTS_MODE=1
	fi
	RUN_COMMAND="run_test"
	;;
"batch-benchmark")
	export PTS_BATCH_MODE=1
	RUN_COMMAND="benchmark"
	;;
"default-benchmark")
	export PTS_DEFAULTS_MODE=1
	RUN_COMMAND="benchmark"
	;;
"upload" | "upload-results")
	RUN_COMMAND="upload_result"
	;;
"list-all-tests")
	RUN_COMMAND="list_tests"
	;;
"list-results")
	RUN_COMMAND="list_saved_results"
	;;
"show-results" | "view-result" | "view-results")
	RUN_COMMAND="show_result"
	;;
"clone")
	RUN_COMMAND="clone_global_result"
	;;
"force-install-all")
	RUN_COMMAND="install_all"
	;;
"version")
	RUN_COMMAND="core_version"
	;;
"login")
	RUN_COMMAND="global_login"
	;;
"refresh-graph" | "refresh-result")
	RUN_COMMAND="refresh_graphs"
	;;
"test-module" | "debug-module")
	if [ "$1" = "debug-module" ]
	then
		export PTS_DEBUG=1
	fi

	export PTS_IGNORE_MODULES=1
	RUN_COMMAND="test_module"
	;;
"sensors" | "sensor-options" | "analyze" | "analyze-results" | "suite-info" | "test-info")
	echo "\nThis option was dropped or changed in the Phoronix Test Suite.\nFor more information and the replacement option, view the documentation.\n"
	exit
	;;
*)
	RUN_COMMAND=$1
esac

$PHP_BIN pts-core/phoronix-test-suite.php $RUN_COMMAND $@

if [ $? = 3 ]
then
	cat <<'EOT'

=================================
Phoronix Test Suite
URL: http://www.phoronix-test-suite.com/
=================================

Installation Options:
    install <suite / test>: Install or update the specified suite/test(s)
    install-dependencies <suite / test>: Install the distribution dependencies
    install-all: Install or update all available tests
    list-installed-tests: List all tests that are installed

Testing Options:
    benchmark <suite / test>: Install and then run the test(s)
    run <suite / test>: Run the specified test(s)
    list-tests: List all tests and relevant information
    list-suites: List all suites and relevant information

Batch Testing Options:
    batch-setup: Setup the batch mode options
    batch-run <suite / test>: Run the specified test(s) in batch mode
    batch-benchmark <suite / test>: Install and run the test(s) in batch mode

Result Viewing Options:
    list-results: List all saved results
    show-result <saved name>: Show this result file in your web browser
    remove-result <saved name>: Remove this saved result file
    remove-all-results: Removes all saved results
    merge-results <saved name> <saved name>: Merge two sets of results

Phoronix Global Options:
    upload-results <saved name>: Upload saved results to Phoronix Global
    login: Enter your Phoronix Global log-in information for uploading results

Analytical Options:
    analyze-batch <saved name>: Analysis of a batch run
    analyze-all-runs <saved name>: A candlestick graph from all trial runs

Module Options:
    list-modules: List all installed/available PTS modules
    module-info: Show detailed information on a PTS module
    module-setup: Configure the end-user options for a PTS module

Miscellaneous Options:
    make-download-cache: Backup all downloaded test files
    info <suite / test>: Show detailed information about a test or suite
    system-info: Show detected software and hardware information
    diagnostics: Useful information when reporting a bug or problem
    build-suite: Build your own test suite
    version: Print the Phoronix Test Suite version and code-name

EOT

fi