Bug 1390595 - Exit with jsdoc return code from "mach marionette doc". r?whimboo
The "mach marionette doc" command to generate Marionette server API
documentation should exit with jsdoc's return code so the caller can
determine whether the operation was successful.
MozReview-Commit-ID: BXqGQlN5WPN
--- a/testing/marionette/mach_commands.py
+++ b/testing/marionette/mach_commands.py
@@ -140,22 +140,24 @@ class Marionette(MachCommandBase):
srcs = [f for f in os.listdir(
self.srcdir) if is_marionette_source_file(f)]
proc = subprocess.Popen(
["jsdoc", "-c", ".jsdoc.js"] + srcs, cwd=self.srcdir)
proc.wait()
- if http:
+ if http and proc.returncode == 0:
import SimpleHTTPServer
import SocketServer
host, port = http.split(":")
host = host or "127.0.0.1"
port = int(port)
handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer((host, int(port)), handler)
print "serving at %s:%s" % (host, port)
os.chdir(os.path.join(self.srcdir, "doc"))
httpd.serve_forever()
+
+ return proc.returncode