From 4822b865ba2fb9f536c81c574f5ca46992be618d Mon Sep 17 00:00:00 2001
From: clonemeagain <clonemeagain@gmail.com>
Date: Wed, 29 Jan 2014 14:06:21 +1100
Subject: [PATCH] Update run-tests.php

Allow tester to run single test by specifying it on command line: php run-tests.php TestMyThing etc.

Still works for normal tests.
---
 setup/test/run-tests.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/setup/test/run-tests.php b/setup/test/run-tests.php
index 3a3df3a1d..2e1fd11a8 100644
--- a/setup/test/run-tests.php
+++ b/setup/test/run-tests.php
@@ -2,6 +2,9 @@
 <?php
 if (php_sapi_name() != 'cli') exit();
 
+//Allow user to select suite
+$selected_test = (isset($argv[1])) ? $argv[1] : false;
+
 require_once "tests/class.test.php";
 
 if (!function_exists('get_osticket_root_path')) {
@@ -60,6 +63,8 @@ foreach (glob_recursive(dirname(__file__)."/tests/test.*.php") as $t) {
     $class = (include $t);
     if (!is_string($class))
         continue;
+    if($selected_test && ($class != $selected_test))
+    	continue;
     $test = new $class();
     echo "Running: " . $test->name . "\n";
     $test->run();
-- 
GitLab