forked from phoronix-test-suite/phoronix-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphoronix-test-suite
executable file
·157 lines (140 loc) · 4.3 KB
/
phoronix-test-suite
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
#!/bin/sh
#
# Phoronix Test Suite
# URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
# Copyright (C) 2008 - 2015, Phoronix Media
# Copyright (C) 2008 - 2015, 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=$(readlink -f `dirname $0`)
export PTS_DIR=`pwd`
export PTS_MODE="CLIENT"
if [ $PTS_DIR != "`pwd`" ]
then
cd $PTS_DIR
fi
# Determine PHP binary location
if [ ! "X$PHP_BIN" = "X" ] && [ -x $PHP_BIN ]
then
export PHP_BIN=$PHP_BIN
elif [ -x /usr/bin/php5 ] || [ -x /usr/local/bin/php5 ] || [ -x /usr/pkg/bin/php5 ]
then
export PHP_BIN="php5"
elif [ -x /usr/bin/php ] || [ -x /usr/local/bin/php ] || [ -x /usr/pkg/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"
elif [ -x /opt/bin/php ]
then
export PHP_BIN="/opt/bin/php"
elif [ -x /usr/pkg/libexec/cgi-bin/php ]
then
export PHP_BIN="/usr/pkg/libexec/cgi-bin/php"
elif which php >/dev/null ;
then
export PHP_BIN="php"
elif which php5 >/dev/null ;
then
export PHP_BIN="php5"
elif [ -x /usr/bin/hhvm ]
then
export PHP_BIN="/usr/bin/hhvm"
else
export PHP_BIN=""
fi
# Make sure PHP is installed
if [ "X$PHP_BIN" = "X" ]
then
cat <<'EOT'
PHP 5.2 or newer must be installed for the Phoronix Test Suite
The PHP command-line package is commonly called php-cli, php5-cli, or php.
For more information visit: http://www.phoronix-test-suite.com/
EOT
if [ -x /usr/bin/apt-get ]
then
echo "The command to likely run for your operating system is: "
echo "# apt-get install php5-cli php5-json php5-gd"
echo " "
elif [ -x /usr/bin/yum ]
then
echo "The command to likely run for your operating system is: "
echo "# yum install php-cli php-xml"
echo " "
elif [ -x /usr/bin/zypper ]
then
echo "The command to likely run for your operating system is: "
echo "# zypper install php5 php5-zip"
echo " "
elif [ -x /usr/bin/pkg_radd ]
then
echo "The command to likely run for your operating system is: "
echo "# pkg_radd php5 php5-json php5-zip php5-dom"
echo " "
elif [ -x /usr/bin/pacman ]
then
echo "The command to likely run for your operating system is: "
echo "# pacman -S php"
echo " "
fi
exit
fi
if [ ! -f pts-core/phoronix-test-suite.php ] && [ -f `dirname $0`/pts-core/phoronix-test-suite.php ]
then
cd `dirname $0`
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
# Command-specific conditions
case "$1" in
"test-module" | "debug-module" | "webui")
export PTS_IGNORE_MODULES=1
;;
"enterprise-setup")
export PTS_SILENT_MODE=1
;;
esac
export PTS_EXT_LAUNCH_SCRIPT_DIR=`mktemp -d 2>/dev/null || mktemp -d -t ptstmp`
# Run The Phoronix Test Suite
PTS_EXIT_STATUS=8
while [ $PTS_EXIT_STATUS -eq 8 ]; do
$PHP_BIN pts-core/phoronix-test-suite.php $@
PTS_EXIT_STATUS=$?
done
if [ -f $PTS_EXT_LAUNCH_SCRIPT_DIR/web-server-launcher ]
then
chmod +x $PTS_EXT_LAUNCH_SCRIPT_DIR/web-server-launcher
exec $PTS_EXT_LAUNCH_SCRIPT_DIR/web-server-launcher
rm -f $PTS_EXT_LAUNCH_SCRIPT_DIR/web-server-launcher
elif [ -f $PTS_EXT_LAUNCH_SCRIPT_DIR/phoromatic-server-launcher ]
then
chmod +x $PTS_EXT_LAUNCH_SCRIPT_DIR/phoromatic-server-launcher
exec $PTS_EXT_LAUNCH_SCRIPT_DIR/phoromatic-server-launcher
rm -f $PTS_EXT_LAUNCH_SCRIPT_DIR/phoromatic-server-launcher
fi
# rm -rf $PTS_EXT_LAUNCH_SCRIPT_DIR