diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-09-29 20:39:50 -0400 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-09-29 20:39:50 -0400 |
commit | 7acc92ef2e29b761a703b0b9c4ba807c91318de0 (patch) | |
tree | 8a887f6c2254ba8aabbb16197063ca09e279c608 /pts-core/functions | |
parent | 2686570d0e002fb56edddd21cb7085d2ff0613d9 (diff) | |
download | phoronix-test-suite-upstream-7acc92ef2e29b761a703b0b9c4ba807c91318de0.tar.gz phoronix-test-suite-upstream-7acc92ef2e29b761a703b0b9c4ba807c91318de0.tar.xz phoronix-test-suite-upstream-7acc92ef2e29b761a703b0b9c4ba807c91318de0.zip |
pts-core: Add pts_available_tests_array() and
pts_available_suites_array()
Diffstat (limited to 'pts-core/functions')
-rw-r--r-- | pts-core/functions/pts-functions.php | 3 | ||||
-rw-r--r-- | pts-core/functions/pts-functions_tests.php | 24 |
2 files changed, 25 insertions, 2 deletions
diff --git a/pts-core/functions/pts-functions.php b/pts-core/functions/pts-functions.php index fd319a8..0295614 100644 --- a/pts-core/functions/pts-functions.php +++ b/pts-core/functions/pts-functions.php @@ -217,7 +217,6 @@ function pts_save_result($save_to = null, $save_results = null) if(is_file("/proc/cpuinfo")) { $file = file_get_contents("/proc/cpuinfo"); - @file_put_contents($save_to_dir . "/system-details/" . TEST_RESULTS_IDENTIFIER . "/cpuinfo", $file); } } @@ -518,7 +517,7 @@ function pts_string_header($heading, $char = '=') if(($line_length = strlen($line)) > $header_size) $header_size = $line_length; - $terminal_width = trim(shell_exec("tput cols")); + $terminal_width = trim(shell_exec("tput cols 2>&1")); if($header_size > $terminal_width && $terminal_width > 1) $header_size = $terminal_width; diff --git a/pts-core/functions/pts-functions_tests.php b/pts-core/functions/pts-functions_tests.php index 8f8f90f..261edd2 100644 --- a/pts-core/functions/pts-functions_tests.php +++ b/pts-core/functions/pts-functions_tests.php @@ -259,5 +259,29 @@ function pts_test_supported($identifier) { return pts_test_architecture_supported($identifier) && pts_test_platform_supported($identifier); } +function pts_available_tests_array() +{ + $tests = glob(XML_PROFILE_DIR . "*.xml"); + $local_tests = glob(XML_PROFILE_LOCAL_DIR . "*.xml"); + $tests = array_unique(array_merge($tests, $local_tests)); + asort($tests); + + for($i = 0; $i < count($tests); $i++) + $tests[$i] = basename($tests[$i], ".xml"); + + return $tests; +} +function pts_available_suites_array() +{ + $suites = glob(XML_SUITE_DIR . "*.xml"); + $local_suites = glob(XML_SUITE_LOCAL_DIR . "*.xml"); + $suites = array_unique(array_merge($suites, $local_suites)); + asort($suites); + + for($i = 0; $i < count($suites); $i++) + $suites[$i] = basename($suites[$i], ".xml"); + + return $suites; +} ?> |