Add script to run test.
authorCheng Zhao <zcbenz@gmail.com>
Wed, 17 Jul 2013 08:42:06 +0000 (16:42 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 17 Jul 2013 08:42:06 +0000 (16:42 +0800)
script/test.py [new file with mode: 0755]

diff --git a/script/test.py b/script/test.py
new file mode 100755 (executable)
index 0000000..659c252
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+
+import os
+import subprocess
+import sys
+
+
+SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
+
+
+def main():
+  if sys.platform == 'darwin':
+    atom_shell = os.path.join(SOURCE_ROOT, 'out', 'Debug', 'Atom.app',
+                              'Contents', 'MacOS', 'Atom')
+  else:
+    atom_shell = os.path.join(SOURCE_ROOT, 'out', 'Debug', 'atom.exe')
+
+  subprocess.check_call([atom_shell, os.path.join(SOURCE_ROOT, 'spec')])
+
+
+if __name__ == '__main__':
+  sys.exit(main())