From 249044e754acfbcb24990cea2ff37a51531cb775 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Thu, 5 Sep 2013 15:13:23 -0700 Subject: [PATCH] Add application:run-benchmarks command --- benchmark/benchmark-bootstrap.coffee | 3 ++- src/atom-application.coffee | 6 ++++++ src/root-view.coffee | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/benchmark/benchmark-bootstrap.coffee b/benchmark/benchmark-bootstrap.coffee index 3a5a9a024..caa4ce8d3 100644 --- a/benchmark/benchmark-bootstrap.coffee +++ b/benchmark/benchmark-bootstrap.coffee @@ -2,4 +2,5 @@ require 'atom' {runSpecSuite} = require 'jasmine-helper' document.title = "Benchmark Suite" -runSpecSuite("benchmark-suite", true) +benchmarkSuite = require.resolve('./benchmark-suite') +runSpecSuite(benchmarkSuite, true) diff --git a/src/atom-application.coffee b/src/atom-application.coffee index 9c3654588..74fcc2de6 100644 --- a/src/atom-application.coffee +++ b/src/atom-application.coffee @@ -116,6 +116,7 @@ class AtomApplication handleEvents: -> @on 'application:about', -> Menu.sendActionToFirstResponder('orderFrontStandardAboutPanel:') @on 'application:run-all-specs', -> @runSpecs(exitWhenDone: false, resourcePath: global.devResourcePath) + @on 'application:run-benchmarks', -> @runBenchmarks() @on 'application:show-settings', -> (@focusedWindow() ? this).openPath("atom://config") @on 'application:quit', -> app.quit() @on 'application:hide', -> Menu.sendActionToFirstResponder('hide:') @@ -272,6 +273,11 @@ class AtomApplication devMode = true new AtomWindow({bootstrapScript, resourcePath, exitWhenDone, isSpec, devMode, specPath}) + runBenchmarks: -> + bootstrapScript = 'benchmark/benchmark-bootstrap' + isSpec = true # So the spec folder is added to NODE_PATH + new AtomWindow({bootstrapScript, @resourcePath, isSpec}) + # Private: Opens a native dialog to prompt the user for a path. # # Once paths are selected, they're opened in a new or existing {AtomWindow}s. diff --git a/src/root-view.coffee b/src/root-view.coffee index 6232912ed..362134f83 100644 --- a/src/root-view.coffee +++ b/src/root-view.coffee @@ -93,6 +93,7 @@ class RootView extends View @command 'application:about', -> ipc.sendChannel('command', 'application:about') @command 'application:run-all-specs', -> ipc.sendChannel('command', 'application:run-all-specs') + @command 'application:run-benchmarks', -> ipc.sendChannel('command', 'application:run-benchmarks') @command 'application:show-settings', -> ipc.sendChannel('command', 'application:show-settings') @command 'application:quit', -> ipc.sendChannel('command', 'application:quit') @command 'application:hide', -> ipc.sendChannel('command', 'application:hide')