Index: modules/simpletest/simpletest.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.module,v retrieving revision 1.11 diff -u -r1.11 simpletest.module --- modules/simpletest/simpletest.module 21 Aug 2008 19:36:38 -0000 1.11 +++ modules/simpletest/simpletest.module 26 Aug 2008 11:18:10 -0000 @@ -27,6 +27,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 or multiples tests given a test case name.', + 'access arguments' => array('administer unit tests'), + 'type' => MENU_CALLBACK, + ); return $items; } @@ -566,6 +574,29 @@ } /** + * 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 or 'all'. + * @return HTML output. + */ +function simpletest_run_tests_web($test_cases) { + if ($test_cases == 'all') { + $test_cases = array_keys(simpletest_get_all_tests()); + } + else { + $test_cases = explode(',', $test_cases); + } + $form_state = array(); + foreach ($test_cases as $case) { + $form_state['values'][$case] = 1; + } + $form_state['op'] = t('Run selected tests'); + drupal_execute('simpletest_test_form', $form_state); + return drupal_get_form('simpletest_test_form'); +} + +/** * Clear the test results tables. */ function simpletest_clean_results_table() {