mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 19:17:09 +03:00
Add a "Run Benchmarks" command to plot benchmark results
This commit is contained in:
parent
1bdd79d719
commit
5211b49f7d
@ -147,6 +147,7 @@
|
||||
{ label: 'Open In Dev Mode…', command: 'application:open-dev' }
|
||||
{ label: 'Reload Window', command: 'window:reload' }
|
||||
{ label: 'Run Package Specs', command: 'window:run-package-specs' }
|
||||
{ label: 'Run Benchmarks', command: 'window:run-benchmarks' }
|
||||
{ label: 'Toggle Developer Tools', command: 'window:toggle-dev-tools' }
|
||||
]
|
||||
}
|
||||
|
@ -20,11 +20,6 @@ export default function () {
|
||||
|
||||
document.title = 'Benchmarks'
|
||||
window.addEventListener('keydown', (event) => {
|
||||
// Quit: cmd-q / ctrl-q
|
||||
if ((event.metaKey || event.ctrlKey) && event.keyCode === 81) {
|
||||
ipcRenderer.send('command', 'application:quit')
|
||||
}
|
||||
|
||||
// Reload: cmd-r / ctrl-r
|
||||
if ((event.metaKey || event.ctrlKey) && event.keyCode === 82) {
|
||||
ipcHelpers.call('window-method', 'reload')
|
||||
@ -59,7 +54,6 @@ export default function () {
|
||||
})
|
||||
|
||||
// Prevent benchmarks from modifying application menus
|
||||
global.atom.menu.update()
|
||||
global.atom.menu.sendToBrowserProcess = function () { }
|
||||
|
||||
if (headless) {
|
||||
|
@ -300,6 +300,9 @@ class AtomApplication
|
||||
@disposable.add ipcHelpers.on ipcMain, 'run-package-specs', (event, packageSpecPath) =>
|
||||
@runTests({resourcePath: @devResourcePath, pathsToOpen: [packageSpecPath], headless: false})
|
||||
|
||||
@disposable.add ipcHelpers.on ipcMain, 'run-benchmarks', (event, benchmarksPath) =>
|
||||
@runBenchmarks({resourcePath: @devResourcePath, pathsToOpen: [benchmarksPath], headless: false, test: false})
|
||||
|
||||
@disposable.add ipcHelpers.on ipcMain, 'command', (event, command) =>
|
||||
@emit(command)
|
||||
|
||||
|
@ -54,6 +54,7 @@ module.exports = ({commandRegistry, commandInstaller, config, notificationManage
|
||||
'application:open-your-stylesheet': -> ipcRenderer.send('command', 'application:open-your-stylesheet')
|
||||
'application:open-license': -> @getModel().openLicense()
|
||||
'window:run-package-specs': -> @runPackageSpecs()
|
||||
'window:run-benchmarks': -> @runBenchmarks()
|
||||
'window:focus-next-pane': -> @getModel().activateNextPane()
|
||||
'window:focus-previous-pane': -> @getModel().activatePreviousPane()
|
||||
'window:focus-pane-above': -> @focusPaneViewAbove()
|
||||
|
@ -142,4 +142,13 @@ class WorkspaceElement extends HTMLElement
|
||||
|
||||
ipcRenderer.send('run-package-specs', specPath)
|
||||
|
||||
runBenchmarks: ->
|
||||
if activePath = @workspace.getActivePaneItem()?.getPath?()
|
||||
[projectPath] = @project.relativizePath(activePath)
|
||||
else
|
||||
[projectPath] = @project.getPaths()
|
||||
|
||||
if projectPath
|
||||
ipcRenderer.send('run-benchmarks', path.join(projectPath, 'benchmarks'))
|
||||
|
||||
module.exports = WorkspaceElement = document.registerElement 'atom-workspace', prototype: WorkspaceElement.prototype
|
||||
|
Loading…
Reference in New Issue
Block a user