From 6ba57dcfa3066ac5e4b2f5f133deccb82c675220 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 22:10:02 +0800 Subject: [PATCH] Use atom.gyp to generate paths in test.py --- script/test.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/script/test.py b/script/test.py index 712c94128b59..28aeac9dc1ff 100755 --- a/script/test.py +++ b/script/test.py @@ -4,9 +4,14 @@ import os import subprocess import sys +from lib.util import atom_gyp + SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) +PROJECT_NAME = atom_gyp()['project_name%'] +PRODUCT_NAME = atom_gyp()['product_name%'] + def main(): os.chdir(SOURCE_ROOT) @@ -16,12 +21,14 @@ def main(): config = 'R' if sys.platform == 'darwin': - atom_shell = os.path.join(SOURCE_ROOT, 'out', config, 'Atom.app', - 'Contents', 'MacOS', 'Atom') + atom_shell = os.path.join(SOURCE_ROOT, 'out', config, + '{0}.app'.format(PRODUCT_NAME), 'Contents', + 'MacOS', PRODUCT_NAME) elif sys.platform == 'win32': - atom_shell = os.path.join(SOURCE_ROOT, 'out', config, 'atom.exe') + atom_shell = os.path.join(SOURCE_ROOT, 'out', config, + '{0}.exe'.format(PROJECT_NAME)) else: - atom_shell = os.path.join(SOURCE_ROOT, 'out', config, 'atom') + atom_shell = os.path.join(SOURCE_ROOT, 'out', config, PROJECT_NAME) subprocess.check_call([atom_shell, 'spec'] + sys.argv[1:])