5 # URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
6 # Copyright (C) 2008 - 2015, Phoronix Media
7 # Copyright (C) 2008 - 2015, Michael Larabel
8 # phoronix-test-suite: The Phoronix Test Suite is an extensible open-source testing / benchmarking platform
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 3 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 # Full path to root directory of the actual Phoronix Test Suite code
25 # export PTS_DIR=$(readlink -f `dirname $0`)
27 export PTS_MODE
="CLIENT"
29 if [ $PTS_DIR != "`pwd`" ]
34 # Run any start-up hooks, such as to pre-seed environment variables or other non-default behaviors / customizations
35 if [ -d pts-core
/hooks
/startup
]
37 for file in pts-core
/hooks
/startup
/*.sh
43 # Determine PHP binary location
44 if [ ! "X$PHP_BIN" = "X" ] && [ -x $PHP_BIN ]
46 export PHP_BIN
=$PHP_BIN
47 elif [ -x /usr
/bin
/php5
] ||
[ -x /usr
/local
/bin
/php5
] ||
[ -x /usr
/pkg
/bin
/php5
]
50 elif [ -x /usr
/bin
/php
] ||
[ -x /usr
/local
/bin
/php
] ||
[ -x /usr
/pkg
/bin
/php
]
53 elif [ -x /usr
/php
5/bin
/php
]
55 export PHP_BIN
="/usr/php5/bin/php"
56 elif [ -x /usr
/php
/bin
/php
]
58 export PHP_BIN
="/usr/php/bin/php"
59 elif [ -x /opt
/bin
/php
]
61 export PHP_BIN
="/opt/bin/php"
62 elif [ -x /usr
/pkg
/libexec
/cgi-bin
/php
]
64 export PHP_BIN
="/usr/pkg/libexec/cgi-bin/php"
65 elif which php
>/dev
/null
2>&1 ;
68 elif which php5
>/dev
/null
2>&1 ;
71 elif [ -x /usr
/bin
/hhvm
]
73 export PHP_BIN
="/usr/bin/hhvm"
74 elif which hhvm
>/dev
/null
2>&1 ;
81 # Make sure PHP is installed
82 if [ "X$PHP_BIN" = "X" ]
86 PHP 5.3 or newer must be installed for the Phoronix Test Suite
87 The PHP command-line package is commonly called php-cli, php5-cli, or php.
88 For more information visit: http://www.phoronix-test-suite.com/
92 if [ -x /usr
/bin
/apt-get
]
94 echo "The command to likely run for your operating system is: "
95 echo "# apt-get install php5-cli"
97 elif [ -x /usr
/bin
/yum
] ||
[ -x /usr
/bin
/dnf
]
99 echo "The command to likely run for your operating system is: "
100 echo "# yum install php-cli php-xml"
102 elif [ -x /usr
/bin
/zypper
]
104 echo "The command to likely run for your operating system is: "
105 echo "# zypper install php5 php5-zip"
107 elif [ -x /usr
/bin
/pkg_radd
]
109 echo "The command to likely run for your operating system is: "
110 echo "# pkg_radd php5 php5-json php5-zip php5-dom"
112 elif [ -x /usr
/bin
/pacman
]
114 echo "The command to likely run for your operating system is: "
115 echo "# pacman -S php"
122 if [ ! -f pts-core
/phoronix-test-suite.php
] && [ -f `dirname $0`/pts-core
/phoronix-test-suite.php
]
127 # Ensure the user is in the correct directory
128 if [ ! -f pts-core
/phoronix-test-suite.php
]
132 To run the Phoronix Test Suite locally you must first change directories to phoronix-test-suite/
133 or install the program using the install-sh script. For support visit: http://www.phoronix-test-suite.com/
139 # Command-specific conditions
141 "test-module" |
"debug-module" |
"webui")
142 export PTS_IGNORE_MODULES
=1
145 export PTS_SILENT_MODE
=1
149 export PTS_EXT_LAUNCH_SCRIPT_DIR
=`mktemp -d 2>/dev/null || mktemp -d -t ptstmp`
151 # Run The Phoronix Test Suite
153 while [ $PTS_EXIT_STATUS -eq 8 ]; do
154 $PHP_BIN pts-core
/phoronix-test-suite.php $@
158 if [ -f $PTS_EXT_LAUNCH_SCRIPT_DIR/web-server-launcher
]
160 chmod +x
$PTS_EXT_LAUNCH_SCRIPT_DIR/web-server-launcher
161 exec $PTS_EXT_LAUNCH_SCRIPT_DIR/web-server-launcher
162 rm -f $PTS_EXT_LAUNCH_SCRIPT_DIR/web-server-launcher
163 elif [ -f $PTS_EXT_LAUNCH_SCRIPT_DIR/phoromatic-server-launcher
]
165 chmod +x
$PTS_EXT_LAUNCH_SCRIPT_DIR/phoromatic-server-launcher
166 exec $PTS_EXT_LAUNCH_SCRIPT_DIR/phoromatic-server-launcher
167 rm -f $PTS_EXT_LAUNCH_SCRIPT_DIR/phoromatic-server-launcher
169 # rm -rf $PTS_EXT_LAUNCH_SCRIPT_DIR