summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-04-26 21:33:29 -0400
committerMichael Larabel <michael@phx-laptop.(none)>2008-04-26 21:33:29 -0400
commit02a39203397d8e9bef1d675fe2cf74339188bc90 (patch)
tree62ef712617648c2bfa205784566ada13f030e32e
parent4cb80d666159b0ff23f268416dc38a6ef5bc15a0 (diff)
downloadphoronix-test-suite-upstream-02a39203397d8e9bef1d675fe2cf74339188bc90.tar.gz
phoronix-test-suite-upstream-02a39203397d8e9bef1d675fe2cf74339188bc90.tar.xz
phoronix-test-suite-upstream-02a39203397d8e9bef1d675fe2cf74339188bc90.zip
Add remove-all-results option
-rw-r--r--CHANGE-LOG1
-rwxr-xr-xphoronix-test-suite6
-rw-r--r--pts-core/functions/pts-functions-extra.php26
-rw-r--r--pts-core/pts-run-cmd.php31
4 files changed, 49 insertions, 15 deletions
diff --git a/CHANGE-LOG b/CHANGE-LOG
index 0320f42..75fa3b4 100644
--- a/CHANGE-LOG
+++ b/CHANGE-LOG
@@ -21,6 +21,7 @@ Phoronix Test Suite
- Add MONITOR= environmental variable. If MONITOR=gpu.temp, the low, average, and high temperatures will be reported at end of test
- Add a lot more sensor and monitoring support... Add MONITOR=sys.temp and MONITOR=cpu.temp. Multiple sensors supported that are delimited by comma (depends upon LM_Sensors)
- Clean up pts-results-viewer as well as switching to Liberation Sans for the font in graph rendering and clean up graph alignment
+- Add remove-all-results option
Phoronix Test Suite 0.4.0
April 24, 2008
diff --git a/phoronix-test-suite b/phoronix-test-suite
index 65c66bd..b1315ce 100755
--- a/phoronix-test-suite
+++ b/phoronix-test-suite
@@ -60,6 +60,9 @@ case "$1" in
"remove-result")
$PHP_BIN pts-core/pts-run-cmd.php REMOVE_RESULT $2
;;
+"remove-all-results")
+ $PHP_BIN pts-core/pts-run-cmd.php REMOVE_ALL_RESULTS
+ ;;
"upload")
$PHP_BIN pts-core/pts-run-cmd.php UPLOAD_RESULT $2
;;
@@ -109,10 +112,11 @@ case "$1" in
echo "benchmark <suite OR test OR saved file>: Same as manually running install and then run"
echo "batch-benchmark <suite OR test OR saved file>: Same as manually running install and then run in Batch Mode"
echo "merge-results <Saved File 1 OR Global ID> <Saved File 2 OR Global ID> <Save To>: Merge two saved result sets"
- echo "remove-result <Saved File>: Remove this saved result file and associated files"
echo "list-tests: List all Phoronix Test Suite test profiles"
echo "list-suites: List all Phoronix Test Suites"
echo "list-results: List all saved results"
+ echo "remove-result <Saved File>: Remove this saved result file and associated files"
+ echo "remove-all-results: Removes all saved results and associated files"
echo "suite-info: Show tests in a suite and other information about the suite"
echo "test-info: Show information about a test"
echo "system-info: Dump detected software and hardware information detected by PTS"
diff --git a/pts-core/functions/pts-functions-extra.php b/pts-core/functions/pts-functions-extra.php
new file mode 100644
index 0000000..a656fdb
--- /dev/null
+++ b/pts-core/functions/pts-functions-extra.php
@@ -0,0 +1,26 @@
+<?php
+
+function pts_remove_saved_result($identifier)
+{
+ $return_value = false;
+
+ if(is_file(SAVE_RESULTS_DIR . $identifier . "/composite.xml"))
+ {
+ @unlink(SAVE_RESULTS_DIR . $identifier . "/composite.xml");
+
+ foreach(glob(SAVE_RESULTS_DIR . $identifier . "/result-graphs/*.png") as $remove_file)
+ @unlink($remove_file);
+
+ foreach(glob(SAVE_RESULTS_DIR . $identifier . "/test-*.xml") as $remove_file)
+ @unlink($remove_file);
+
+ @unlink(SAVE_RESULTS_DIR . $identifier . "/pts-results-viewer.xsl");
+ @rmdir(SAVE_RESULTS_DIR . $identifier . "/result-graphs/");
+ @rmdir(SAVE_RESULTS_DIR . $identifier);
+ echo "Removed: $identifier\n";
+ $return_value = true;
+ }
+ return $return_value;
+}
+
+?>
diff --git a/pts-core/pts-run-cmd.php b/pts-core/pts-run-cmd.php
index f0df6fc..c390e2d 100644
--- a/pts-core/pts-run-cmd.php
+++ b/pts-core/pts-run-cmd.php
@@ -1,6 +1,7 @@
<?php
require("pts-core/functions/pts-functions.php");
+require("pts-core/functions/pts-functions-extra.php");
$COMMAND = $argv[1];
@@ -12,21 +13,23 @@ if(isset($argv[3]))
switch($COMMAND)
{
+ case "REMOVE_ALL_RESULTS":
+ $remove_all = pts_bool_question("Are you sure you wish to remove all saved results (Y/n)?", true);
+
+ if($remove_all)
+ {
+ foreach(glob(SAVE_RESULTS_DIR . "*/composite.xml") as $benchmark_file)
+ {
+ $saved_identifier = array_pop(explode('/', dirname($benchmark_file)));
+ pts_remove_saved_result($saved_identifier);
+ }
+ }
+ break;
case "REMOVE_RESULT":
if(is_file(SAVE_RESULTS_DIR . $ARG_1 . "/composite.xml"))
{
- unlink(SAVE_RESULTS_DIR . $ARG_1 . "/composite.xml");
-
- foreach(glob(SAVE_RESULTS_DIR . $ARG_1 . "/result-graphs/*.png") as $remove_file)
- unlink($remove_file);
-
- foreach(glob(SAVE_RESULTS_DIR . $ARG_1 . "/test-*.xml") as $remove_file)
- unlink($remove_file);
-
- unlink(SAVE_RESULTS_DIR . $ARG_1 . "/pts-results-viewer.xsl");
- rmdir(SAVE_RESULTS_DIR . $ARG_1 . "/result-graphs/");
- rmdir(SAVE_RESULTS_DIR . $ARG_1);
- echo "\nRemoved: $ARG_1\n";
+ echo "\n";
+ pts_remove_saved_result($ARG_1);
}
else
echo "\nThis result doesn't exist!\n";
@@ -63,12 +66,12 @@ switch($COMMAND)
if(!empty($title))
{
echo $title . "\n";
- printf("Saved Name: %-15ls Test: %-18ls \n", $saved_identifier, $suite);
+ printf("Saved Name: %-18ls Test: %-18ls \n", $saved_identifier, $suite);
foreach($identifiers as $id)
echo "\t- $id\n";
- echo "\n\n";
+ echo "\n";
}
}
break;