diff options
-rw-r--r-- | CHANGE-LOG | 1 | ||||
-rw-r--r-- | pts-core/functions/pts-functions-run.php | 77 |
2 files changed, 39 insertions, 39 deletions
@@ -15,6 +15,7 @@ Phoronix Test Suite (Git) - pts-core: Add pts-functions_vars.php, pts-functions_assignments.php - pts-core: Check all supplied arguments for a PCQS test when determining if PCQS needs to be installed - pts-core: Store aliases for distributions used in package identification in pts-core/static/software-vendor-aliases.txt +- pts-core: Rework option counting in pts_auto_process_test_option() - pts: Add more tests to netbook suite Phoronix Test Suite 1.6.0 Alpha 3 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) |