Fix coverage-report-server.py script to work with absolute srcpath master
authorMaria Guseva <m.guseva@samsung.com>
Thu, 6 Jul 2017 11:23:53 +0000 (14:23 +0300)
committerMaria Guseva <m.guseva@samsung.com>
Tue, 11 Jul 2017 02:46:03 +0000 (11:46 +0900)
The issue is due to os.path.join semantics:

If a component is an absolute path, all previous components are thrown away
and joining continues from the absolute path component.

scripts/coverage-report-server.py

index 428276f..32ae9c0 100755 (executable)
@@ -148,7 +148,7 @@ class ServerHandler(http.server.BaseHTTPRequestHandler):
             self.wfile.write(response.encode('UTF-8', 'replace'))
         elif self.symcov_data.has_file(self.path[1:]):
             filename = self.path[1:]
-            filepath = os.path.join(self.src_path, filename
+            filepath = os.path.join(self.src_path, filename.lstrip('/'))
             if not os.path.exists(filepath):
                 self.send_response(404)
                 self.end_headers()