diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-11-02 13:17:30 -0500 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-11-02 13:17:30 -0500 |
commit | 545996b3170de4f122c3206a4b4dabac25287b2b (patch) | |
tree | 3c641ffa7c25288a2f0eda24fbcb7de7e7b88587 /pts-core | |
parent | 0db69cc24d2ee40d3b049b5fac7eb3b14dcafa52 (diff) | |
download | phoronix-test-suite-upstream-545996b3170de4f122c3206a4b4dabac25287b2b.tar.gz phoronix-test-suite-upstream-545996b3170de4f122c3206a4b4dabac25287b2b.tar.xz phoronix-test-suite-upstream-545996b3170de4f122c3206a4b4dabac25287b2b.zip |
pts-core: Add timed kill infrasturcture to kill a process from a test
script by calling $TIMED_KILL <process_name> <time_in_seconds>
Diffstat (limited to 'pts-core')
-rw-r--r-- | pts-core/functions/pts-functions-run.php | 3 | ||||
-rwxr-xr-x | pts-core/test-libraries/timed-kill.sh | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/pts-core/functions/pts-functions-run.php b/pts-core/functions/pts-functions-run.php index a047976..c2a2199 100644 --- a/pts-core/functions/pts-functions-run.php +++ b/pts-core/functions/pts-functions-run.php @@ -493,7 +493,8 @@ function pts_run_test($test_identifier, $extra_arguments = "", $arguments_descri $benchmark_log_file = TEST_ENV_DIR . $test_identifier . "/" . $test_identifier . "-" . THIS_RUN_TIME . "-" . ($i + 1) . ".log"; $start_timer = TEST_LIBRARIES_DIR . "timer-start.sh"; $stop_timer = TEST_LIBRARIES_DIR . "timer-stop.sh"; - $test_extra_runtime_variables = array_merge($extra_runtime_variables, array("LOG_FILE" => $benchmark_log_file, "TIMER_START" => $start_timer, "TIMER_STOP" => $stop_timer, "PHP_BIN" => PHP_BIN)); + $timed_kill = TEST_LIBRARIES_DIR . "timed-kill.sh"; + $test_extra_runtime_variables = array_merge($extra_runtime_variables, array("LOG_FILE" => $benchmark_log_file, "TIMER_START" => $start_timer, "TIMER_STOP" => $stop_timer, "TIMED_KILL" => $timed_kill, "PHP_BIN" => PHP_BIN)); echo pts_string_header($test_title . " (Run " . ($i + 1) . " of " . $times_to_run . ")"); $result_output = array(); diff --git a/pts-core/test-libraries/timed-kill.sh b/pts-core/test-libraries/timed-kill.sh new file mode 100755 index 0000000..ffb0661 --- /dev/null +++ b/pts-core/test-libraries/timed-kill.sh @@ -0,0 +1,3 @@ +#!/bin/sh +(sleep $2; killall -9 $1) > /dev/null 2>&1 & + |