From 20ab54395604e6f1258a5feccc7040a4b26b9c22 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Thu, 16 Jun 2011 16:23:26 +0200 Subject: added styles for junit xml report --- ChangeLog | 14 +++ Makefile.am | 16 ++- tests/report-styles/index.js | 20 ++++ tests/report-styles/jreport.xsl | 229 ++++++++++++++++++++++++++++++++++++++++ tests/report-styles/report.css | 21 ++++ 5 files changed, 298 insertions(+), 2 deletions(-) create mode 100644 tests/report-styles/index.js create mode 100644 tests/report-styles/jreport.xsl create mode 100644 tests/report-styles/report.css diff --git a/ChangeLog b/ChangeLog index 5873b89..c1e744f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2011-06-16 Jiri Vanek + + * tests/report-styles/index.js: fast navigation functions + * tests/report-styles/report.css: styles for transformed result + * tests/report-styles/jreport.xsl: template for human-readable + xml->html transformation. + * Makefile.am: New variable for report-styles directory; + ($(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)): goal for copying styles and + javascripts; (run-netx-unit-tests): added nonfaling xsltproc + transformation of sheet and unit-tests' xml report to index_unit.html; + (clean-netx-unit-tests): now depends also on clean_tests_reports; + (clean_tests_reports): new goal to remove report styles directory and + indexs html files. + 2011-06-14 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: diff --git a/Makefile.am b/Makefile.am index a924e97..231e64f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,6 +6,8 @@ NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources NETX_EXTRA_DIR=$(abs_top_srcdir)/extra/net/sourceforge/javaws/about/resources NETX_EXTRA_DIST_DIR=$(abs_top_builddir)/extra-lib/net/sourceforge/javaws/about/resources +REPORT_STYLES_DIRNAME=report-styles + TESTS_SRCDIR=$(abs_top_srcdir)/tests TESTS_DIR=$(abs_top_builddir)/tests.build @@ -460,8 +462,13 @@ stamps/netx-unit-tests-compile.stamp: stamps/netx.stamp \ mkdir -p stamps && \ touch $@ +$(TESTS_DIR)/$(REPORT_STYLES_DIRNAME): + mkdir $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) + cp $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/*.css $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/ + cp $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/*.js $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/ + run-netx-unit-tests: stamps/netx-unit-tests-compile.stamp \ - $(JUNIT_RUNNER_JAR) + $(JUNIT_RUNNER_JAR) $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) cp {$(NETX_UNIT_TEST_SRCDIR),$(NETX_UNIT_TEST_DIR)}/net/sourceforge/jnlp/basic.jnlp cd $(NETX_UNIT_TEST_DIR) ; \ class_names= ; \ @@ -476,6 +483,7 @@ run-netx-unit-tests: stamps/netx-unit-tests-compile.stamp \ > stdout.log 2> stderr.log ; \ cat stdout.log ; \ cat stderr.log >&2 + -xsltproc $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(TESTS_DIR)/netx/unit/tests-output.xml > $(TESTS_DIR)/index_unit.html clean-netx-tests: clean-netx-unit-tests clean-junit-runner if [ -e $(TESTS_DIR)/netx ]; then \ @@ -487,11 +495,15 @@ clean-junit-runner: rm -rf $(JUNIT_RUNNER_DIR) rm -f $(JUNIT_RUNNER_JAR) -clean-netx-unit-tests: +clean-netx-unit-tests: clean_tests_reports rm -f netx-unit-tests-source-files.txt rm -rf $(NETX_UNIT_TEST_DIR) rm -f stamps/netx-unit-tests-compile.stamp +clean_tests_reports: + rm -rf $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/ + rm -f $(TESTS_DIR)/index*.html + # plugin tests if ENABLE_PLUGIN diff --git a/tests/report-styles/index.js b/tests/report-styles/index.js new file mode 100644 index 0000000..27b6ed5 --- /dev/null +++ b/tests/report-styles/index.js @@ -0,0 +1,20 @@ + +function negateIdDisplay(which) { + var e = document.getElementById(which); + if (e.style.display=="block") { + e.style.display="none" + } else { + e.style.display="block" + } +} + + +function setClassDisplay(which,what) { + var e = document.getElementsByClassName(which); + for ( var i = 0; i < e.length; i++ ) { + e[i].style.display=what + } +} + + + diff --git a/tests/report-styles/jreport.xsl b/tests/report-styles/jreport.xsl new file mode 100644 index 0000000..bafe2c8 --- /dev/null +++ b/tests/report-styles/jreport.xsl @@ -0,0 +1,229 @@ + + + + + + + + + + + + + +
+

Date:

+ +
+

Result: (s)

+
+
+
TOTAL:
+
+ +
+
+
+
+
passed:
+
+ +
+
+
+
+
failed:
+
+ +
+
+
+
+
ignored:
+
+ +
+
+
+
+

Classes:

+ +
+ + + + passed + + + failed + + + + + # + +(ms): + +
+
+
+
+
TOTAL:
+
+ +
+
+
+
+
passed:
+
+ +
+
+
+
+
failed:
+
+ +
+
+
+
+
ignored:
+
+ +
+
+
+
+
+
+
+ + +

Individual results:

+ + + +
+ + + + failed + + + passed + + + + + + + + +
+
+ +
+ - +
+ +
+
+
+ + +
+ PASSED (s) +
+
+ +
+ FAILED (s) +
+
+
+ - + + +
+
+
+                    
+                  
+
+
+
+
+
+
+
+
+
+
+ +
+
+ STD-OUT - +
+
+
+                
+              
+
+
+
+
+
+ STD-ERR - +
+
+
+                
+              
+
+
+
+ +
+ + +
+
diff --git a/tests/report-styles/report.css b/tests/report-styles/report.css new file mode 100644 index 0000000..e0a59c3 --- /dev/null +++ b/tests/report-styles/report.css @@ -0,0 +1,21 @@ +div.passed {background-color:green;height:auto } +div.failed {background-color:red ;height:auto} +div.ignored {background-color:yellow ;height:auto} + +div.clazz {display:inline } +div.method {display:inline } + +div.result {display:block; border: thin solid black ;height:auto} +div.status {display:inline; } +div.wtrace {display:inline; border: thin solid black; float: right;height:auto} +div.theader {display:block; border: thin solid black} +div.trace {display:block; border: thin solid black} + +div.space-line { clear: both; margin: 0; padding: 0; width: auto;} + +div.tablee {width:200px; border: thin solid black; } +div.row { border: thin solid black; } +div.cell1 {display:inline; float: left;height:auto} +div.cell2 {display:inline; float: right;height:auto} + +a.classSumaryName{font-weight:bold} -- cgit v1.2.3