Mercurial > hg
diff tests/dumbhttp.py @ 34925:8b95e420e248 stable
test-static-http: show all files accessed over HTTP
This provides some confidence on files that should be loadable over HTTP.
Hopefully it will prevent future bugs.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 25 Oct 2017 21:21:42 +0900 |
parents | d05fefbb5ab3 |
children | bf2db35a6fe7 |
line wrap: on
line diff
--- a/tests/dumbhttp.py Wed Oct 25 21:20:01 2017 +0900 +++ b/tests/dumbhttp.py Wed Oct 25 21:21:42 2017 +0900 @@ -41,6 +41,7 @@ help='TCP port to listen on', metavar='PORT') parser.add_option('-H', '--host', dest='host', default='localhost', help='hostname or IP to listen on', metavar='HOST') + parser.add_option('--logfile', help='file name of access/error log') parser.add_option('--pid', dest='pid', help='file name where the PID of the server is stored') parser.add_option('-f', '--foreground', dest='foreground', @@ -52,6 +53,9 @@ signal.signal(signal.SIGTERM, lambda x, y: sys.exit(0)) + if options.foreground and options.logfile: + parser.error("options --logfile and --foreground are mutually " + "exclusive") if options.foreground and options.pid: parser.error("options --pid and --foreground are mutually exclusive") @@ -60,4 +64,5 @@ 'daemon_postexec': options.daemon_postexec} service = simplehttpservice(options.host, options.port) server.runservice(opts, initfn=service.init, runfn=service.run, + logfile=options.logfile, runargs=[sys.executable, __file__] + sys.argv[1:])