#!/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 .
#
# 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 : Install or update the specified suite/test(s)
install-dependencies : Install the distribution dependencies
install-all: Install or update all available tests
list-installed-tests: List all tests that are installed
Testing Options:
benchmark : Install and then run the test(s)
run : 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 : Run the specified test(s) in batch mode
batch-benchmark : Install and run the test(s) in batch mode
Result Viewing Options:
list-results: List all saved results
show-result : Show this result file in your web browser
remove-result : Remove this saved result file
remove-all-results: Removes all saved results
merge-results : Merge two sets of results
Phoronix Global Options:
upload-results : Upload saved results to Phoronix Global
login: Enter your Phoronix Global log-in information for uploading results
Analytical Options:
analyze-batch : Analysis of a batch run
analyze-all-runs : 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 : 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