From 24107c0f68acfa039210c4c15448ca2cbcb07101 Mon Sep 17 00:00:00 2001 From: Michael Larabel Date: Mon, 5 May 2008 09:31:41 -0400 Subject: Clean up and add new code to phoronix-test-suite SH file and add make-download-cache option. --- phoronix-test-suite | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'phoronix-test-suite') diff --git a/phoronix-test-suite b/phoronix-test-suite index c755ad0..d77a11e 100755 --- a/phoronix-test-suite +++ b/phoronix-test-suite @@ -9,6 +9,21 @@ # Full path to root directory of the actual Phoronix Test Suite code export PTS_DIR=`pwd` +if [ $PTS_DIR != `pwd` ] +then + cd $PTS_DIR +fi + +# Location to save results, download cache, results viewer, etc. Must have trailing slash. +export PTS_USER_DIR=$HOME'/.phoronix-test-suite/' + +# Set DOWNLOAD_CACHE if it's not set already by the user +if [ "X$DOWNLOAD_CACHE" = "X" ] +then + export DOWNLOAD_CACHE=$PTS_USER_DIR'download-cache/' +fi + +# Determine PHP binary location if [ -x /usr/bin/php5 ] || [ -x /usr/local/bin/php5 ] then export PHP_BIN="php5" @@ -19,6 +34,7 @@ else export PHP_BIN="" fi +# Make sure PHP is installed if [ "X$PHP_BIN" = "X" ] then echo "\n\nPHP5 CLI Must Be Installed To Run The Phoronix Test Suite!" @@ -28,11 +44,6 @@ then echo "For support visit: http://www.phoronix.com/forums/forumdisplay.php?f=49\n\n" fi -if [ $PTS_DIR != `pwd` ] -then - cd $PTS_DIR -fi - case "$1" in "install") $PHP_BIN pts-core/pts-run-cmd.php INSTALL_BENCHMARK $2 @@ -69,6 +80,9 @@ case "$1" in "upload") $PHP_BIN pts-core/pts-run-cmd.php UPLOAD_RESULT $2 ;; +"make-download-cache") + $PHP_BIN pts-core/pts-run-cmd.php MAKE_DOWNLOAD_CACHE + ;; "list-tests") $PHP_BIN pts-core/pts-run-cmd.php LIST_TESTS ;; @@ -110,7 +124,6 @@ case "$1" in echo "Phoronix Test Suite" echo "http://www.phoronix-test-suite.com/" echo "=================================\n" -# echo "gui: Launch The Phoronix Test Suite GUI" echo "install : Install or Update The Specified Test(s)" echo "install-dependencies : Install The External (Distribution) Dependencies For Specified Test(s)" echo "run : Run The Specified Test/Suite" @@ -121,6 +134,7 @@ case "$1" in echo "list-tests: List all Phoronix Test Suite test profiles" echo "list-suites: List all Phoronix Test Suites" echo "list-results: List all saved results" + echo "make-download-cache: Backup all saved files to ~/.phoronix-test-suite/download-cache/" echo "remove-result : Remove this saved result file and associated files" echo "remove-all-results: Removes all saved results and associated files" echo "suite-info: Show tests in a suite and other information about the suite" -- cgit