diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-04-25 10:48:39 -0400 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-04-25 10:48:39 -0400 |
commit | 38c9277c46f01a0b267c981d0e5ef40ccd034590 (patch) | |
tree | 586eecefa5e0f4a5882c7750e36316bd069b64c5 | |
parent | a739a4f9cefe13b737991c4664ecea39a203cef9 (diff) | |
download | phoronix-test-suite-upstream-38c9277c46f01a0b267c981d0e5ef40ccd034590.tar.gz phoronix-test-suite-upstream-38c9277c46f01a0b267c981d0e5ef40ccd034590.tar.xz phoronix-test-suite-upstream-38c9277c46f01a0b267c981d0e5ef40ccd034590.zip |
Do not statically depend upon the php binary but support if php5 binary
is detected without link to php.
-rw-r--r-- | TODO | 1 | ||||
-rwxr-xr-x | phoronix-test-suite | 56 | ||||
-rw-r--r-- | pts-core/functions/pts-functions-install.php | 2 | ||||
-rw-r--r-- | pts-core/functions/pts-functions-run.php | 6 | ||||
-rw-r--r-- | pts-core/functions/pts-functions.php | 4 |
5 files changed, 42 insertions, 27 deletions
@@ -9,3 +9,4 @@ - More MD5 checks in test scripts - Change locking system away from time-based but to PID based - Clean up tests scripts +- Add IgnoreFirstRun argument for tests scripts diff --git a/phoronix-test-suite b/phoronix-test-suite index ff8a379..65c66bd 100755 --- a/phoronix-test-suite +++ b/phoronix-test-suite @@ -9,7 +9,17 @@ # Full path to root directory of the actual Phoronix Test Suite code export PTS_DIR=`pwd` -if [ ! -x /usr/bin/php ] && [ ! -x /usr/local/bin/php ] +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" +else + export PHP_BIN="" +fi + +if [ "X$PHP_BIN" = "X" ] then echo "\n\nPHP5 CLI Must Be Installed To Run The Phoronix Test Suite!" echo "Only PHP For The Command Line Is Needed, Not A Full-Blown PHP w/ Web Server" @@ -25,66 +35,66 @@ fi case "$1" in "install") - php pts-core/pts-run-cmd.php INSTALL_BENCHMARK $2 + $PHP_BIN pts-core/pts-run-cmd.php INSTALL_BENCHMARK $2 ;; "install-dependencies") - php pts-core/pts-run-cmd.php INSTALL_EXTERNAL_DEPENDENCIES $2 + $PHP_BIN pts-core/pts-run-cmd.php INSTALL_EXTERNAL_DEPENDENCIES $2 ;; "run") - php pts-core/pts-run-benchmark.php $2 + $PHP_BIN pts-core/pts-run-benchmark.php $2 ;; "batch-run") - php pts-core/pts-run-benchmark.php $2 BATCH + $PHP_BIN pts-core/pts-run-benchmark.php $2 BATCH ;; "benchmark") - php pts-core/pts-run-cmd.php INSTALL_BENCHMARK $2 - php pts-core/pts-run-benchmark.php $2 + $PHP_BIN pts-core/pts-run-cmd.php INSTALL_BENCHMARK $2 + $PHP_BIN pts-core/pts-run-benchmark.php $2 ;; "batch-benchmark") - php pts-core/pts-run-cmd.php INSTALL_BENCHMARK $2 - php pts-core/pts-run-benchmark.php $2 BATCH + $PHP_BIN pts-core/pts-run-cmd.php INSTALL_BENCHMARK $2 + $PHP_BIN pts-core/pts-run-benchmark.php $2 BATCH ;; "merge-results") - php pts-core/pts-merge-results.php $2 $3 $4 + $PHP_BIN pts-core/pts-merge-results.php $2 $3 $4 ;; "remove-result") - php pts-core/pts-run-cmd.php REMOVE_RESULT $2 + $PHP_BIN pts-core/pts-run-cmd.php REMOVE_RESULT $2 ;; "upload") - php pts-core/pts-run-cmd.php UPLOAD_RESULT $2 + $PHP_BIN pts-core/pts-run-cmd.php UPLOAD_RESULT $2 ;; "list-tests") - php pts-core/pts-run-cmd.php LIST_TESTS + $PHP_BIN pts-core/pts-run-cmd.php LIST_TESTS ;; "list-suites") - php pts-core/pts-run-cmd.php LIST_SUITES + $PHP_BIN pts-core/pts-run-cmd.php LIST_SUITES ;; "list-results" | "list-saved-results") - php pts-core/pts-run-cmd.php LIST_SAVED_RESULTS + $PHP_BIN pts-core/pts-run-cmd.php LIST_SAVED_RESULTS ;; "show-result") - php pts-core/pts-run-cmd.php SHOW_RESULT $2 + $PHP_BIN pts-core/pts-run-cmd.php SHOW_RESULT $2 ;; "suite-info" | "suite-information") - php pts-core/pts-run-cmd.php SUITE_INFO $2 + $PHP_BIN pts-core/pts-run-cmd.php SUITE_INFO $2 ;; "test-info" | "test-information") - php pts-core/pts-run-cmd.php TEST_INFO $2 + $PHP_BIN pts-core/pts-run-cmd.php TEST_INFO $2 ;; "system-info" | "system-information") - php pts-core/pts-run-cmd.php SYS_INFO + $PHP_BIN pts-core/pts-run-cmd.php SYS_INFO ;; "diagnostics") - php pts-core/pts-run-cmd.php DIAGNOSTICS_DUMP + $PHP_BIN pts-core/pts-run-cmd.php DIAGNOSTICS_DUMP ;; "remote-comparison") - php pts-core/pts-run-cmd.php REMOTE_COMPARISON $2 $3 + $PHP_BIN pts-core/pts-run-cmd.php REMOTE_COMPARISON $2 $3 ;; "initial-config") - php pts-core/pts-run-cmd.php INITIAL_CONFIG + $PHP_BIN pts-core/pts-run-cmd.php INITIAL_CONFIG ;; "login") - php pts-core/pts-run-cmd.php LOGIN + $PHP_BIN pts-core/pts-run-cmd.php LOGIN ;; *) echo "\n=================================" diff --git a/pts-core/functions/pts-functions-install.php b/pts-core/functions/pts-functions-install.php index 1677d2b..68170b0 100644 --- a/pts-core/functions/pts-functions-install.php +++ b/pts-core/functions/pts-functions-install.php @@ -79,7 +79,7 @@ function pts_install_benchmark($Benchmark) } else if(is_file(BENCHMARK_RESOURCE_DIR . "$Benchmark/install.php")) { - echo pts_exec("cd " . BENCHMARK_RESOURCE_DIR . "$Benchmark/ && php install.php " . BENCHMARK_ENV_DIR . $Benchmark) . "\n"; + echo pts_exec("cd " . BENCHMARK_RESOURCE_DIR . "$Benchmark/ && " . PHP_BIN . " install.php " . BENCHMARK_ENV_DIR . $Benchmark) . "\n"; file_put_contents(BENCHMARK_ENV_DIR . "$Benchmark/pts-install", md5_file(BENCHMARK_RESOURCE_DIR . "$Benchmark/install.php")); } } diff --git a/pts-core/functions/pts-functions-run.php b/pts-core/functions/pts-functions-run.php index f14ae52..c7bfd1b 100644 --- a/pts-core/functions/pts-functions-run.php +++ b/pts-core/functions/pts-functions-run.php @@ -164,7 +164,7 @@ function pts_run_benchmark($benchmark_identifier, $extra_arguments = "", $argume } if(is_file(BENCHMARK_RESOURCE_DIR . $benchmark_identifier . "/pre.php")) { - echo pts_exec("php " . BENCHMARK_RESOURCE_DIR . $benchmark_identifier . "/pre.php " . BENCHMARK_ENV_DIR . "$benchmark_identifier"); + echo pts_exec(PHP_BIN . " " . BENCHMARK_RESOURCE_DIR . $benchmark_identifier . "/pre.php " . BENCHMARK_ENV_DIR . "$benchmark_identifier"); } if(!empty($pre_run_message)) @@ -183,7 +183,7 @@ function pts_run_benchmark($benchmark_identifier, $extra_arguments = "", $argume if(is_file(BENCHMARK_RESOURCE_DIR . $benchmark_identifier . "/parse-results.php")) { - $BENCHMARK_RESULTS = pts_exec("cd " . BENCHMARK_RESOURCE_DIR . $benchmark_identifier . "/ && php parse-results.php \"$BENCHMARK_RESULTS\""); + $BENCHMARK_RESULTS = pts_exec("cd " . BENCHMARK_RESOURCE_DIR . $benchmark_identifier . "/ && " . PHP_BIN . " parse-results.php \"$BENCHMARK_RESULTS\""); } array_push($BENCHMARK_RESULTS_ARRAY, $BENCHMARK_RESULTS); } @@ -194,7 +194,7 @@ function pts_run_benchmark($benchmark_identifier, $extra_arguments = "", $argume } if(is_file(BENCHMARK_RESOURCE_DIR . $benchmark_identifier . "/post.php")) { - echo pts_exec("php " . BENCHMARK_RESOURCE_DIR . $benchmark_identifier . "/post.php " . BENCHMARK_ENV_DIR . "$benchmark_identifier"); + echo pts_exec(PHP_BIN . " " . BENCHMARK_RESOURCE_DIR . $benchmark_identifier . "/post.php " . BENCHMARK_ENV_DIR . "$benchmark_identifier"); } // End diff --git a/pts-core/functions/pts-functions.php b/pts-core/functions/pts-functions.php index 5adeba2..96e7bef 100644 --- a/pts-core/functions/pts-functions.php +++ b/pts-core/functions/pts-functions.php @@ -34,6 +34,7 @@ function pts_directory() return $dir; } define("PTS_DIR", pts_directory()); +define("PHP_BIN", getenv("PHP_BIN")); function __autoload($to_load) { @@ -285,6 +286,9 @@ function pts_env_variables() return array( "PTS_TYPE" => PTS_TYPE, "PTS_VERSION" => PTS_VERSION, + "PTS_CODENAME" => PTS_CODENAME, + "PTS_DIR" => PTS_DIR, + "PHP_BIN" => PHP_BIN, "NUM_CPU_CORES" => cpu_core_count(), "NUM_CPU_JOBS" => cpu_job_count(), "SYS_MEMORY" => memory_mb_capacity(), |