5
* @param {jasmine.Env} env
7
jasmine.Runner = function(env) {
10
self.queue = new jasmine.Queue(env);
16
jasmine.Runner.prototype.execute = function() {
18
if (self.env.reporter.reportRunnerStarting) {
19
self.env.reporter.reportRunnerStarting(this);
21
self.queue.start(function () {
22
self.finishCallback();
26
jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) {
27
beforeEachFunction.typeName = 'beforeEach';
28
this.before_.splice(0,0,beforeEachFunction);
31
jasmine.Runner.prototype.afterEach = function(afterEachFunction) {
32
afterEachFunction.typeName = 'afterEach';
33
this.after_.splice(0,0,afterEachFunction);
37
jasmine.Runner.prototype.finishCallback = function() {
38
this.env.reporter.reportRunnerResults(this);
41
jasmine.Runner.prototype.addSuite = function(suite) {
42
this.suites_.push(suite);
45
jasmine.Runner.prototype.add = function(block) {
46
if (block instanceof jasmine.Suite) {
49
this.queue.add(block);
52
jasmine.Runner.prototype.specs = function () {
53
var suites = this.suites();
55
for (var i = 0; i < suites.length; i++) {
56
specs = specs.concat(suites[i].specs());
61
jasmine.Runner.prototype.suites = function() {
65
jasmine.Runner.prototype.topLevelSuites = function() {
66
var topLevelSuites = [];
67
for (var i = 0; i < this.suites_.length; i++) {
68
if (!this.suites_[i].parentSuite) {
69
topLevelSuites.push(this.suites_[i]);
72
return topLevelSuites;
75
jasmine.Runner.prototype.results = function() {
76
return this.queue.results();