Index: scripts/slave/runtest.py |
=================================================================== |
--- scripts/slave/runtest.py (revision 13921) |
+++ scripts/slave/runtest.py (working copy) |
@@ -44,10 +44,41 @@ |
msg = pre + 'Unable to find %s' % test_exe_path |
raise chromium_utils.PathNotFound(msg) |
+ http_server = None |
+ if options.document_root: |
+ platform_util = google.platform_utils.PlatformUtility(build_dir) |
+ |
+ # Name the output directory for the exe, without its path or suffix. |
+ # e.g., chrome-release/httpd_logs/unit_tests/ |
+ test_exe_name = os.path.splitext(os.path.basename(test_exe_path))[0] |
+ output_dir = os.path.join(slave_utils.SlaveBaseDir(build_dir), |
+ 'httpd_logs', |
+ test_exe_name) |
+ |
+ apache_config_dir = google.httpd_utils.ApacheConfigDir(build_dir) |
+ httpd_conf_path = os.path.join(apache_config_dir, 'httpd2_mac.conf') |
+ mime_types_path = os.path.join(apache_config_dir, 'mime.types') |
+ document_root = os.path.abspath(options.document_root) |
+ |
+ start_cmd = platform_util.GetStartHttpdCommand(output_dir, |
+ httpd_conf_path, |
+ mime_types_path, |
+ document_root) |
+ stop_cmd = platform_util.GetStopHttpdCommand() |
+ http_server = google.httpd_utils.ApacheHttpd(start_cmd, stop_cmd, [8000]) |
+ try: |
+ http_server.StartServer() |
+ except google.httpd_utils.HttpdNotStarted, e: |
+ raise google.httpd_utils.HttpdNotStarted('%s. See log file in %s' % |
+ (e, output_dir)) |
+ |
command = [test_exe_path] |
command.extend(args[1:]) |
result = chromium_utils.RunCommand(command) |
+ if options.document_root: |
+ http_server.StopServer() |
+ |
return result |
def main_linux(options, args): |
@@ -170,7 +201,7 @@ |
help='Shard to run. Must be between 1 and ' |
'total-shards.') |
options, args = option_parser.parse_args() |
- |
+ |
# Set the number of shards environement variables. |
if options.total_shards and options.shard_index: |
os.environ['GTEST_TOTAL_SHARDS'] = str(options.total_shards) |