Simpletest atm only has run_all_tests that makes it possible to run all tests from command line. This patch gives it the ability to select tests which are run from command line and also if you run it via browser.

Comments

moshe weitzman’s picture

if it makes sense, i'd love to see 'run all tests' and 'run some tests' exposed as drush commands. thats the consensus winner for command line drupal. take a look if you haven't already.

Rok Žlender’s picture

StatusFileSize
new5.57 KB

Patch with drush command hook.

webchick’s picture

Status: Needs review » Needs work

This is pedantic, but can we please rename the file to run_tests.php? ;)

This patch doesn't apply against HEAD...

webchick’s picture

Version: 6.x-1.x-dev » 5.x-1.x-dev

I've been informed that this is against 5.x, not HEAD, hence my confusion. :D

moshe weitzman’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new5.67 KB

I tested via drush and this worked well. I attach a patch with slightly more thorough help text. I could not get run_all_tests.php to work but I can't spend more time debugging it. I think drush is a more way to load up drupal since it sets base_url and works with multi-site and so on. Personally, I think run_all_tests.php can be removed.

Ideas for expansion
- provide a command which lists all the available test classes like UploadPictureTests
- perhaps make the output prettier via drush_table()

Thanks for adding drush support. Two great modules, working together.

boombatower’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

This patch no longer works on any of the branches.

As for 5.x it isn't really in developement, but I suppose this could be committed. If anything this should be ported to 6.x and/or HEAD.

moshe weitzman’s picture

Status: Patch (to be ported) » Fixed

I have committed the drush changes to drush module itself. You may now run all tests or specified tests using the 'drush test run' command. I'd like to move that code to simpletest module if you all are interested. Perhaps when drush ports to D6 you will take it.

I think the other code proposed here has already been committed by now so i mark this as fixed.

boombatower’s picture

Thanks, that is what I was looking for. Trying to clean up the queue.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.