Add test task

This commit is contained in:
Kevin Sawicki
2013-05-30 13:21:54 -07:00
parent da0af11bbb
commit 9e4ef708e4

View File

@@ -6,7 +6,8 @@ CSON = require 'season'
BUILD_DIR = '/tmp/atom-build/atom-shell'
APP_NAME = 'Atom.app'
APP_DIR = path.join(BUILD_DIR, APP_NAME, 'Contents', 'Resources', 'app')
CONTENTS_DIR = path.join(BUILD_DIR, APP_NAME, 'Contents')
APP_DIR = path.join(CONTENTS_DIR, 'Resources', 'app')
INSTALL_DIR = path.join('/Applications', APP_NAME)
module.exports = (grunt) ->
@@ -221,6 +222,15 @@ module.exports = (grunt) ->
exec('script/update-atom-shell', callback)
grunt.util.async.waterfall commands, (error) -> done(!error?)
grunt.registerTask 'test', 'Run the specs', ->
done = @async()
commands = []
commands.push (callback) ->
exec('pkill', ['Atom'], callback)
commands.push (result, callback) ->
exec(path.join(CONTENTS_DIR, 'MacOS', 'Atom'), ['--test', '--resource-path', __dirname], callback)
grunt.util.async.waterfall commands, (error) -> done(!error?)
grunt.registerTask('compile', ['coffee', 'less', 'cson'])
grunt.registerTask('lint', ['coffeelint', 'csslint'])
grunt.registerTask('default', ['lint', 'build'])