Merge pull request #917 from atom/apm-test

Add spec-directory command line option
This commit is contained in:
Matt Colyer
2013-10-02 13:25:01 -07:00
3 changed files with 8 additions and 6 deletions

View File

@@ -9,7 +9,7 @@ if [ ! -d $ATOM_PATH ]; then
exit 1
fi
while getopts ":whvft-:" opt; do
while getopts ":whvfts-:" opt; do
case "$opt" in
-)
case "${OPTARG}" in

View File

@@ -51,7 +51,7 @@ class AtomApplication
resourcePath: null
version: null
constructor: ({@resourcePath, pathsToOpen, urlsToOpen, @version, test, pidToKillWhenClosed, devMode, newWindow}) ->
constructor: ({@resourcePath, pathsToOpen, urlsToOpen, @version, test, pidToKillWhenClosed, devMode, newWindow, specDirectory}) ->
global.atomApplication = this
@pidsToOpenWindows = {}
@@ -67,7 +67,7 @@ class AtomApplication
@checkForUpdates()
if test
@runSpecs({exitWhenDone: true, @resourcePath})
@runSpecs({exitWhenDone: true, @resourcePath, specDirectory})
else if pathsToOpen.length > 0
@openPaths({pathsToOpen, pidToKillWhenClosed, newWindow, devMode})
else if urlsToOpen.length > 0

View File

@@ -76,11 +76,12 @@ parseCommandLine = ->
Usage: atom [options] [file ...]
"""
options.alias('d', 'dev').boolean('d').describe('d', 'Run in development mode.')
options.alias('f', 'foreground').boolean('f').describe('f', 'Keep the browser process in the foreground.')
options.alias('h', 'help').boolean('h').describe('h', 'Print this usage message.')
options.alias('n', 'new-window').boolean('n').describe('n', 'Open a new window.')
options.alias('t', 'test').boolean('t').describe('t', 'Run the Atom specs and exit with error code on failures.')
options.alias('s', 'spec-directory').string('s').describe('s', 'Set the directory from which specs are loaded (default: Atom\'s spec directory).')
options.alias('t', 'test').boolean('t').describe('t', 'Run the specified specs and exit with error code on failures.')
options.alias('v', 'version').boolean('v').describe('v', 'Print the version.')
options.alias('f', 'foreground').boolean('f').describe('f', 'Keep the browser process in the foreground.')
options.alias('w', 'wait').boolean('w').describe('w', 'Wait for window to be closed before returning.')
args = options.argv
@@ -97,6 +98,7 @@ parseCommandLine = ->
pathsToOpen = args._
pathsToOpen = [executedFrom] if executedFrom and pathsToOpen.length is 0
test = args['test']
specDirectory = args['spec-directory']
newWindow = args['new-window']
pidToKillWhenClosed = args['pid'] if args['wait']
@@ -112,4 +114,4 @@ parseCommandLine = ->
devMode = false
resourcePath = path.dirname(__dirname)
{resourcePath, pathsToOpen, executedFrom, test, version, pidToKillWhenClosed, devMode, newWindow}
{resourcePath, pathsToOpen, executedFrom, test, version, pidToKillWhenClosed, devMode, newWindow, specDirectory}