/*globals ENV QUnit EmberDev */

(function() {
  window.Ember = {
    testing: true
  };
  window.ENV = window.ENV || {};

  // Test for "hooks in ENV.EMBER_LOAD_HOOKS['hookName'] get executed"
  ENV.EMBER_LOAD_HOOKS = ENV.EMBER_LOAD_HOOKS || {};
  ENV.EMBER_LOAD_HOOKS.__before_ember_test_hook__ = ENV.EMBER_LOAD_HOOKS.__before_ember_test_hook__ || [];
  ENV.__test_hook_count__ = 0;
  ENV.EMBER_LOAD_HOOKS.__before_ember_test_hook__.push(function(object) {
    ENV.__test_hook_count__ += object;
  });

  // Handle extending prototypes
  QUnit.config.urlConfig.push('extendprototypes');

  var extendPrototypes = QUnit.urlParams.extendprototypes;
  ENV['EXTEND_PROTOTYPES'] = !!extendPrototypes;

  // Don't worry about jQuery version
  ENV['FORCE_JQUERY'] = true;

  if (EmberDev.jsHint) {
    // jsHint makes its own Object.create stub, we don't want to use this
    ENV['STUB_OBJECT_CREATE'] = !Object.create;
  }

  ENV['EXPERIMENTAL_CONTROL_HELPER'] = true;

  QUnit.config.urlConfig.push('enablerouteto');
  var enableRouteTo = QUnit.urlParams.enablerouteto;
  ENV['ENABLE_ROUTE_TO'] = !!enableRouteTo;

  EmberDev.distros = {
    spade:   'ember-spade.js',
    build:   'ember.js',
    prod:    'ember.prod.js',
    runtime: 'ember-runtime.js'
  };
})();

/*globals ENV QUnit EmberDev */

(function() {
  window.Ember = {
    testing: true
  };
  window.ENV = window.ENV || {};

  // Test for "hooks in ENV.EMBER_LOAD_HOOKS['hookName'] get executed"
  ENV.EMBER_LOAD_HOOKS = ENV.EMBER_LOAD_HOOKS || {};
  ENV.EMBER_LOAD_HOOKS.__before_ember_test_hook__ = ENV.EMBER_LOAD_HOOKS.__before_ember_test_hook__ || [];
  ENV.__test_hook_count__ = 0;
  ENV.EMBER_LOAD_HOOKS.__before_ember_test_hook__.push(function(object) {
    ENV.__test_hook_count__ += object;
  });

  // Handle extending prototypes
  QUnit.config.urlConfig.push('extendprototypes');

  var extendPrototypes = QUnit.urlParams.extendprototypes;
  ENV['EXTEND_PROTOTYPES'] = !!extendPrototypes;

  // Don't worry about jQuery version
  ENV['FORCE_JQUERY'] = true;

  if (EmberDev.jsHint) {
    // jsHint makes its own Object.create stub, we don't want to use this
    ENV['STUB_OBJECT_CREATE'] = !Object.create;
  }

  ENV['EXPERIMENTAL_CONTROL_HELPER'] = true;

  QUnit.config.urlConfig.push('enablerouteto');
  var enableRouteTo = QUnit.urlParams.enablerouteto;
  ENV['ENABLE_ROUTE_TO'] = !!enableRouteTo;

  EmberDev.distros = {
    spade:   'ember-spade.js',
    build:   'ember.js',
    prod:    'ember.prod.js',
    runtime: 'ember-runtime.js'
  };
})();
QUnit.done = function(res) {
    global_test_results = res;
      // older IE versions don't like this test. lame.
      //   // console.log(res);
      //   };
};

add global test results