[rtems-tools commit] coverage/reports: Share common JS and CSS in reports

Joel Sherrill joel at rtems.org
Tue Mar 30 18:20:47 UTC 2021


Module:    rtems-tools
Branch:    master
Commit:    4d21ff8d6081c571f275ace36b13bdedd8623e2a
Changeset: http://git.rtems.org/rtems-tools/commit/?id=4d21ff8d6081c571f275ace36b13bdedd8623e2a

Author:    Alex White <alex.white at oarcorp.com>
Date:      Thu Feb 25 10:52:41 2021 -0600

coverage/reports: Share common JS and CSS in reports

This moves all of the javascript and CSS files that are shared by the
symbol set HTML reports to the shared parent directory. It also includes
the javascript and CSS in the top-level index file.

---

 tester/covoar/ReportsHtml.cc |  4 ++--
 tester/rt/coverage.py        | 11 ++++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/tester/covoar/ReportsHtml.cc b/tester/covoar/ReportsHtml.cc
index cce0a4f..3d20aec 100644
--- a/tester/covoar/ReportsHtml.cc
+++ b/tester/covoar/ReportsHtml.cc
@@ -121,8 +121,8 @@ namespace Coverage {
       "<html>\n"
       "<meta http-equiv=\"Content-Language\" content=\"English\" >\n"
       "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\" >\n"
-      "<link rel=\"stylesheet\" type=\"text/css\" href=\"covoar.css\" media=\"screen\" >\n"
-      "<script type=\"text/javascript\" src=\"table.js\"></script>\n"
+      "<link rel=\"stylesheet\" type=\"text/css\" href=\"../covoar.css\" media=\"screen\" >\n"
+      "<script type=\"text/javascript\" src=\"../table.js\"></script>\n"
     );
 
     return aFile;
diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
index d62c853..ec3957c 100644
--- a/tester/rt/coverage.py
+++ b/tester/rt/coverage.py
@@ -137,6 +137,8 @@ class report_gen_html:
         head_section += '    text-align:center;' + os.linesep
         head_section += '  }' + os.linesep
         head_section += ' </style>' + os.linesep
+        head_section += ' <link rel="stylesheet" href="' + self.bsp + '-coverage/covoar.css">' + os.linesep
+        head_section += ' <script type="text/javascript" src="' + self.bsp + '-coverage/table.js"></script>' + os.linesep
         head_section += '</head>' + os.linesep
         return head_section
 
@@ -221,11 +223,10 @@ class report_gen_html:
     def add_covoar_css(self):
         table_js_path = path.join(self.covoar_src_path, 'table.js')
         covoar_css_path = path.join(self.covoar_src_path, 'covoar.css')
-        for symbol_set in self.symbol_sets:
-            symbol_set_dir = path.join(self.build_dir,
-                                       self.bsp + '-coverage', symbol_set)
-            path.copy_tree(covoar_css_path, symbol_set_dir)
-            path.copy_tree(table_js_path, symbol_set_dir)
+        coverage_directory = path.join(self.build_dir,
+                                    self.bsp + '-coverage')
+        path.copy_tree(covoar_css_path, coverage_directory)
+        path.copy_tree(table_js_path, coverage_directory)
 
     def add_dir_name(self):
         for symbol_set in self.symbol_sets:



More information about the vc mailing list