diff options
-rw-r--r-- | CHANGE-LOG | 2 | ||||
-rw-r--r-- | documentation/sensor_monitoring.html | 2 | ||||
-rw-r--r-- | documentation/writing_your_first_module.html | 4 | ||||
-rwxr-xr-x | phoronix-test-suite | 10 | ||||
-rw-r--r-- | pts-core/pts-run-cmd.php | 26 |
5 files changed, 41 insertions, 3 deletions
@@ -6,6 +6,8 @@ Phoronix Test Suite - pts-core: Print out the external dependencies that will be installed prior to running the script - pts-core: Add dynamic option building support to tests running in batch mode - pts-core: Don't auto-load PTS modules if PTS_IGNORE_MODULES environmental variable is set +- pts-core: Few PTS module architecture updates +- pts-core: Add test-module and debug-module options for running through all module function calls for testing their functionality - system_monitor: When reading +3.3V, poll V3_POWER not BATTERY_POWER (noted by Marox) - pts: Update gentoo-packages.xml with Nils Kneuper changes diff --git a/documentation/sensor_monitoring.html b/documentation/sensor_monitoring.html index 8cad5ae..c6931e0 100644 --- a/documentation/sensor_monitoring.html +++ b/documentation/sensor_monitoring.html @@ -24,7 +24,7 @@ system temperature, battery power consumption, CPU voltage, +3.33V line voltage, in the future.</p> <p>The full list of supported sensor options can be found by running <em>phoronix-test-suite module-info system_monitor</em>. The sensors actually detected on the current system and their -values can be read by running <em>phoronix-test-suite sensors</em>. Selecting +values can be read by running <em>phoronix-test-suite test-module system_monitor</em>. Selecting sensors to monitor is performed through the <em>MONITOR</em> environmental variable. As examples, to monitor just the CPU temperature while running the universe suite, one would run <em>MONITOR=cpu.temp phoronix-test-suite benchmark universe</em>. diff --git a/documentation/writing_your_first_module.html b/documentation/writing_your_first_module.html index f066117..a015614 100644 --- a/documentation/writing_your_first_module.html +++ b/documentation/writing_your_first_module.html @@ -37,6 +37,10 @@ defined in <em>PTS_MODULES</em> can be set within the <em>LoadModules</em> tag found in <em>~/.phoronix-test-suite/user-config.xml</em>. Multiple modules can be loaded simultaneously using the <em>PTS_MODULES</em> variable or <em>LoadModules</em> tag by delimiting each command with a comma (<em>,</em>).</p> +<p>Note: To run through all of the function calls for a module without needing to run a test, +run <em>phoronix-test-suite test-module MODULE_NAME</em>. Additionally, running +<em>phoronix-test-suite debug-module MODULE_NAME</em> will yield additional debugging details while +executing the same process.</p> <h1>PHP Module</h1> <p>To see all of the functions supported for modules written in PHP, look at <em>pts-core/modules/dummy_module.php</em> and additionally the other .php modules that ship with the Phoronix Test Suite. diff --git a/phoronix-test-suite b/phoronix-test-suite index 7087cf4..1cede69 100755 --- a/phoronix-test-suite +++ b/phoronix-test-suite @@ -167,8 +167,14 @@ case "$1" in "refresh-graph" | "refresh-graphs" | "refresh-result") $PHP_BIN pts-core/pts-run-cmd.php REFRESH_GRAPHS $2 ;; -"sensor-options") - $PHP_BIN pts-core/pts-run-cmd.php SENSOR_OPTIONS +"test-module" | "debug-module") + if [ "$1" = "debug-module" ] + then + export PTS_DEBUG=1 + fi + + export PTS_IGNORE_MODULES=1 + $PHP_BIN pts-core/pts-run-cmd.php TEST_MODULE $2 ;; "sensors" | "sensor-options") echo "\nThis option was dropped from the Phoronix Test Suite. For more information and the replacement option, view the latest documentation.\n" diff --git a/pts-core/pts-run-cmd.php b/pts-core/pts-run-cmd.php index 48c3e7e..3ef7f77 100644 --- a/pts-core/pts-run-cmd.php +++ b/pts-core/pts-run-cmd.php @@ -580,6 +580,32 @@ switch($COMMAND) echo "Results Saved To: " . SAVE_RESULTS_DIR . $SAVE_TO . "\n\n"; display_web_browser(SAVE_RESULTS_DIR . $SAVE_TO); break; + case "TEST_MODULE": + $module = strtolower($ARG_1); + if(is_file(MODULE_DIR . $module . ".php") || is_file(MODULE_DIR . $module . ".sh")) + { + pts_load_module($module); + pts_attach_module($module); + + echo pts_string_header("Starting Module Test Process"); + + $module_processes = array("__startup", "__pre_install_process", "__pre_test_install", "__post_test_install", "__post_install_process", + "__pre_run_process", "__pre_test_run", "__interim_test_run", "__post_test_run", "__post_run_process", "__shutdown"); + + foreach($module_processes as $process) + { + if(IS_DEBUG_MODE) + echo "Calling: " . $process . "()\n"; + pts_module_process($process); + sleep(1); + } + echo "\n"; + } + else + { + echo "\n" . $module . " is not recognized.\n"; + } + break; case "DIAGNOSTICS_DUMP": echo pts_string_header("Phoronix Test Suite v" . PTS_VERSION . " (" . PTS_CODENAME . ")\n" . "Diagnostics Dump"); $pts_defined_constants = get_defined_constants(true); |