diff --git a/globalredirect.module b/globalredirect.module
index a05f46b..963beb3 100644
--- a/globalredirect.module
+++ b/globalredirect.module
@@ -20,6 +20,14 @@ function globalredirect_help($path, $arg) {
  * Implements hook_init().
  */
 function globalredirect_init() {
+  // Don't perform redirects if the call was made by the command-line tester:
+  // Without this if block, calling
+  //   cd /path/to/drupal
+  //   php scripts/run-tests.sh --color --verbose "Blog"
+  // results in a test not running at all and no error being given.
+  if ($GLOBALS['_SERVER']['SCRIPT_FILENAME'] == './scripts/run-tests.sh') {
+    return;
+  }
   global $language;
   /**
    * Get the settings.
