text: // Generated by CoffeeScript 1.6.3
  (function() {
    var args, e, page, page_filename, silent, start, timeout;
  
    try {
      args = phantom.args;
      if (args.length < 1 || args.length > 3) {
        console.log("Usage: " + phantom.scriptName + " <URL> <timeout> <silent>");
        phantom.exit(1);
      }
      page_filename = args[0];
      timeout = parseInt(args[1], 10) || 60000;
      silent = args.length >= 2 ? !!args[2] : false;
      start = Date.now();
      page = require('webpage').create();
      page.onConsoleMessage = function(msg) {
        if (msg.indexOf('warning') !== 0) {
          return console.log(msg);
        }
      };
      page.open(page_filename, function(status) {
        var interval;
        if (status !== 'success') {
          console.error("Unable to access network");
          return phantom.exit(1);
        } else {
          return interval = setInterval((function() {
            var code, stats;
            if (Date.now() > start + timeout) {
              console.error("Tests timed out");
              return phantom.exit(124);
            } else {
              stats = page.evaluate(function() {
                if (QUnit.config.queue.length === 0) {
                  return QUnit.config.stats;
                }
              });
              if (!stats) {
                return;
              }
              clearInterval(interval);
              if (stats.all <= 0) {
                phantom.exit(-1);
                return;
              }
              code = stats.bad > 0 ? 1 : 0;
              if (!silent) {
                console.log("phantomjs-qunit-runner.js: exiting (" + code + ")");
              }
              return phantom.exit(code);
            }
          }), 500);
        }
      });
    } catch (_error) {
      e = _error;
      console.error("QUnit exception: " + e);
      phantom.exit(1);
    }
  
  }).call(this);
  