     packageSpecQueue.drain = -> callback(null, failedPackages)
 
   runCoreSpecs = (callback) ->
-    contentsDir = grunt.config.get('atom.contentsDir')
-    if process.platform is 'darwin'
-      appPath = path.join(contentsDir, 'MacOS', 'Atom')
-    else if process.platform is 'win32'
-      appPath = path.join(contentsDir, 'atom.exe')
+    appPath = getAppPath()
     resourcePath = process.cwd()
     coreSpecsPath = path.resolve('spec')
 
-    if process.platform is 'darwin'
+    if process.platform in ['darwin', 'linux']
       options =
         cmd: appPath
         args: ['--test', "--resource-path=#{resourcePath}", "--spec-directory=#{coreSpecsPath}"]


    # TODO: This should really be parallel on both platforms, however our
    # fixtures step on each others toes currently.
    if process.platform is 'darwin'
      method = async.parallel
    else if process.platform is 'win32'
      method = async.series

path = require 'path'

_ = require 'underscore-plus'
async = require 'async'

module.exports = (grunt) ->
