Index: modules/simpletest/simpletest.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.module,v retrieving revision 1.3 diff -u -r1.3 simpletest.module --- modules/simpletest/simpletest.module 10 May 2008 07:46:22 -0000 1.3 +++ modules/simpletest/simpletest.module 3 Jun 2008 07:54:46 -0000 @@ -26,6 +26,14 @@ 'description' => 'Run tests against Drupal core and your active modules. These tests help assure that your site code is working as designed.', 'access arguments' => array('administer unit tests'), ); + $items['admin/build/testing/run'] = array( + 'title' => 'Testing', + 'page callback' => 'simpletest_run_tests_web', + 'page arguments' => array(4), + 'description' => 'Run a single test given a test case name.', + 'access arguments' => array('administer unit tests'), + 'type' => MENU_CALLBACK, + ); $items['admin/settings/testing'] = array( 'title' => 'Testing', 'description' => 'Configure SimpleTest framework.', @@ -437,6 +445,26 @@ return $total_test; } +/** + * Run a the specified tests given their test case names and output + * the results using the standard web interface. + * + * @param string $test_cases Comma delimited list of test cases. + * @return HTML output. + */ +function simpletest_run_tests_web($test_cases) { + $test_cases = explode(',', $test_cases); + + $form_state = array(); + foreach ($test_cases as $test_case) { + $form_state['values'][$test_case] = '1'; + } + $form_state['values']['op'] = 'Run tests'; + + drupal_execute('simpletest_overview_form', $form_state); + return simpletest_entrypoint(); +} + function simpletest_settings() { $form = array();