From e4e4ef34d342c8c4450da3a7a24c2a6bd24d7c15 Mon Sep 17 00:00:00 2001 From: Michael Larabel Date: Thu, 28 Aug 2008 22:24:52 -0400 Subject: pts-core: Create end-user variables for having software/hardware values when saving the results and setting the test identifier When being prompted for the test identifier in saving test results, several user variables are supported. These include $VIDEO_RESOLUTION, $VIDEO_CARD, $OPERATING_SYSTEM, $PROCESSOR, $MOTHERBOARD, and $KERNEL_VERSION. If any of these variables are entered, the Phoronix Test Suite will replace them with their respective values before saving the results. --- CHANGE-LOG | 2 ++ documentation/tips_and_tricks.html | 3 +++ pts-core/functions/pts-functions-run.php | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/CHANGE-LOG b/CHANGE-LOG index 6017dd0..2dcbc17 100644 --- a/CHANGE-LOG +++ b/CHANGE-LOG @@ -18,10 +18,12 @@ Phoronix Test Suite - pts-core: Suppress warnings/errors from set_nvidia_extension() - pts-core: On some Intel setups, don't report DRI in graphics string - pts-core: Improve Intel graphics memory detection and other drivers that report the capacity as VideoRam instead of VideoRAM +- pts-core: Create end-user variables for having software/hardware values when saving the results and setting the test identifier - pts: Update mandrivalinux-packages.xml from Stéphane Téletchéa - pts: Add the unigine test suite for OpenGL tech demo tests from Unigine Corp - pts: Fix tests in java-opengl test suite - graphics_override: Don't apply anti-aliasing or anisotropic filtering settings unless there is something to apply +- pts_MultiPassFailGraph: Ensure the background fill reaches the bottom edge of the box - documentation: Update the test profile and suite XML specifications Phoronix Test Suite 1.2.0 Beta 3 diff --git a/documentation/tips_and_tricks.html b/documentation/tips_and_tricks.html index 91c8496..5c7b614 100644 --- a/documentation/tips_and_tricks.html +++ b/documentation/tips_and_tricks.html @@ -26,6 +26,9 @@ be added in the future.

checks will be performed when merging results and it will allow you to form custom suites very easily, etc. Though the preferred method to create a suite is by writing a formal suite.

+

- When being prompted for the test identifier in saving test results, several user variables are supported. These include +$VIDEO_RESOLUTION, $VIDEO_CARD, $OPERATING_SYSTEM, $PROCESSOR, $MOTHERBOARD, and $KERNEL_VERSION. +If any of these variables are entered, the Phoronix Test Suite will replace them with their respective values before saving the results.

- If RemoveDownloadFiles is set to TRUE within the user-config.xml file, once a test has been installed the originally downloaded files for that test will be automatically removed. This conserves disk space but will cause these files to be re-downloaded the next time the test needs to be re-installed. This will also diff --git a/pts-core/functions/pts-functions-run.php b/pts-core/functions/pts-functions-run.php index e165487..1eab88c 100644 --- a/pts-core/functions/pts-functions-run.php +++ b/pts-core/functions/pts-functions-run.php @@ -71,12 +71,33 @@ function pts_prompt_results_identifier($current_identifiers = null) if(empty($RESULTS_IDENTIFIER)) $RESULTS_IDENTIFIER = date("Y-m-d H:i"); + else + $RESULTS_IDENTIFIER = pts_swap_user_variables($RESULTS_IDENTIFIER); if(!defined("TEST_RESULTS_IDENTIFIER")) define("TEST_RESULTS_IDENTIFIER", $RESULTS_IDENTIFIER); return $RESULTS_IDENTIFIER; } +function pts_swap_user_variables($user_str) +{ + if(strpos($user_str, "$") !== FALSE) + { + $supported_variables = array( + "VIDEO_RESOLUTION" => current_screen_resolution(), + "VIDEO_CARD" => graphics_processor_string(), + "OPERATING_SYSTEM" => pts_vendor_identifier(), + "PROCESSOR" => processor_string(), + "MOTHERBOARD" => main_system_hardware_string(), + "KERNEL_VERSION" => kernel_string() + ); + + foreach($supported_variables as $key => $value) + $user_str = str_replace("$" . $key, $value, $user_str); + } + + return $user_str; +} function pts_prompt_save_file_name($check_env = true) { // Prompt to save a file when running a test -- cgit