From 9e4ef708e4024c2602f616798a2d05bfe532f2db Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 30 May 2013 13:21:54 -0700 Subject: [PATCH] Add test task --- Gruntfile.coffee | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 17dc805a2..c36428130 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -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'])