summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-09-17 20:33:53 -0400
committerMichael Larabel <michael@phx-laptop.(none)>2008-09-17 20:33:53 -0400
commit47b24208daf6b0106a3b0604f2828c666da2157f (patch)
treef2ee60a42a4f0c366936989b711e7213feca05b2
parent71d0a0f2302c26c3e1f90ebdb13dc8687086359b (diff)
downloadphoronix-test-suite-upstream-47b24208daf6b0106a3b0604f2828c666da2157f.tar.gz
phoronix-test-suite-upstream-47b24208daf6b0106a3b0604f2828c666da2157f.tar.xz
phoronix-test-suite-upstream-47b24208daf6b0106a3b0604f2828c666da2157f.zip
pts-core: Add support so test options can be set as an environment
variable by using <TEST NAME UPPER_CASE>_<NUM OPTION>=<INDEX OF REQUEST>
-rw-r--r--pts-core/functions/pts-functions_tests.php2
-rw-r--r--pts-core/pts-run-test.php12
2 files changed, 12 insertions, 2 deletions
diff --git a/pts-core/functions/pts-functions_tests.php b/pts-core/functions/pts-functions_tests.php
index 0a6b8ce..8f8f90f 100644
--- a/pts-core/functions/pts-functions_tests.php
+++ b/pts-core/functions/pts-functions_tests.php
@@ -5,7 +5,7 @@
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
Copyright (C) 2008, Phoronix Media
Copyright (C) 2008, Michael Larabel
- pts-functions.php: General functions required for Phoronix Test Suite operation.
+ pts-functions_tests.php: Functions needed for some test parameters
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
diff --git a/pts-core/pts-run-test.php b/pts-core/pts-run-test.php
index 6d1dbc1..e2ad7e9 100644
--- a/pts-core/pts-run-test.php
+++ b/pts-core/pts-run-test.php
@@ -215,6 +215,7 @@ if(is_test($TO_RUN))
echo "\n";
echo $settings_name[$option_count] . ":\n";
+ $first_try = true;
do
{
echo "\n";
@@ -223,7 +224,16 @@ if(is_test($TO_RUN))
echo ($i + 1) . ": " . $option_names[$i] . "\n";
}
echo "\nPlease Enter Your Choice: ";
- $bench_choice = trim(fgets(STDIN));
+
+ if($first_try && ($auto_opt = getenv(strtoupper($TO_RUN) . "_" . $option_count)) != FALSE)
+ {
+ $bench_choice = $auto_opt;
+ echo $bench_choice . "\n";
+ }
+ else
+ $bench_choice = trim(fgets(STDIN));
+
+ $first_try = false;
}
while(($bench_choice < 1 || $bench_choice > count($option_names)) && !in_array($bench_choice, $option_names));