summaryrefslogtreecommitdiffstats
path: root/pts-core
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-12-16 18:43:57 -0500
committerMichael Larabel <michael@phx-laptop.(none)>2008-12-16 18:43:57 -0500
commitda6283cae60a98e0bec7e1a43742150fc81f93d8 (patch)
treec87c16125af17bfedc5f588fbf4503c685da6e13 /pts-core
parentfec1d46873e3f3232b82bbf297714925231517b2 (diff)
downloadphoronix-test-suite-upstream-da6283cae60a98e0bec7e1a43742150fc81f93d8.tar.gz
phoronix-test-suite-upstream-da6283cae60a98e0bec7e1a43742150fc81f93d8.tar.xz
phoronix-test-suite-upstream-da6283cae60a98e0bec7e1a43742150fc81f93d8.zip
pts-core: Rework option counting in pts_auto_process_test_option()
Diffstat (limited to 'pts-core')
-rw-r--r--pts-core/functions/pts-functions-run.php77
1 files changed, 38 insertions, 39 deletions
diff --git a/pts-core/functions/pts-functions-run.php b/pts-core/functions/pts-functions-run.php
index cdb79f9..319cd3e 100644
--- a/pts-core/functions/pts-functions-run.php
+++ b/pts-core/functions/pts-functions-run.php
@@ -1121,11 +1121,12 @@ function pts_all_combos(&$return_arr, $current_string, $options, $counter, $deli
function pts_auto_process_test_option($identifier, &$option_names, &$option_values)
{
// Some test items have options that are dynamically built
- if(count($option_names) < 2 && count($option_values) < 2)
+ switch($identifier)
{
- switch($identifier)
- {
- case "auto-resolution":
+ case "auto-resolution":
+ // Base options off available screen resolutions
+ if(count($option_names) == 1 && count($option_values) == 1)
+ {
$available_video_modes = hw_gpu_xrandr_available_modes();
$format_name = $option_names[0];
$format_value = $option_values[0];
@@ -1143,54 +1144,52 @@ function pts_auto_process_test_option($identifier, &$option_names, &$option_valu
array_push($option_names, $this_name);
array_push($option_values, $this_value);
}
+ }
break;
- case "auto-disk-partitions":
- $all_devices = array_merge(glob("/dev/hd*"), glob("/dev/sd*"));
- $all_devices_count = count($all_devices);
+ case "auto-disk-partitions":
+ // Base options off available disk partitions
+ $all_devices = array_merge(glob("/dev/hd*"), glob("/dev/sd*"));
+ $all_devices_count = count($all_devices);
- for($i = 0; $i < $all_devices_count; $i++)
- {
- $last_char = substr($all_devices[$i], -1);
-
- if(!is_numeric($last_char))
- {
- unset($all_devices[$i]);
- }
- }
-
- $option_values = array();
+ for($i = 0; $i < $all_devices_count; $i++)
+ {
+ $last_char = substr($all_devices[$i], -1);
- foreach($all_devices as $partition)
+ if(!is_numeric($last_char))
{
- array_push($option_values, $partition);
+ unset($all_devices[$i]);
}
+ }
- $option_names = $option_values;
+ $option_values = array();
+ foreach($all_devices as $partition)
+ {
+ array_push($option_values, $partition);
+ }
+ $option_names = $option_values;
break;
- case "auto-disks":
- $all_devices = array_merge(glob("/dev/hd*"), glob("/dev/sd*"));
- $all_devices_count = count($all_devices);
-
- for($i = 0; $i < $all_devices_count; $i++)
- {
- $last_char = substr($all_devices[$i], -1);
-
- if(is_numeric($last_char))
- {
- unset($all_devices[$i]);
- }
- }
+ case "auto-disks":
+ // Base options off attached disks
+ $all_devices = array_merge(glob("/dev/hd*"), glob("/dev/sd*"));
+ $all_devices_count = count($all_devices);
- $option_values = array();
+ for($i = 0; $i < $all_devices_count; $i++)
+ {
+ $last_char = substr($all_devices[$i], -1);
- foreach($all_devices as $disk)
+ if(is_numeric($last_char))
{
- array_push($option_values, $disk);
+ unset($all_devices[$i]);
}
+ }
- $option_names = $option_values;
+ $option_values = array();
+ foreach($all_devices as $disk)
+ {
+ array_push($option_values, $disk);
+ }
+ $option_names = $option_values;
break;
- }
}
}
function pts_test_options($identifier)