Commit c81367f2 authored by anilsaharan's avatar anilsaharan

Added DTD and XSL for XML Files.


git-svn-id: http://svn.code.sf.net/p/cunit/code/trunk@33 f00e6729-6848-4c17-8bfb-678c97c00071
parent f13fede3
<!ELEMENT CUNIT_TEST_LIST_REPORT (CUNIT_HEADER,
CUNIT_LIST_TOTAL_SUMMARY,CUNIT_ALL_TEST_LISTING*,CUNIT_FOOTER)>
<!ELEMENT CUNIT_HEADER EMPTY>
<!ELEMENT CUNIT_LIST_TOTAL_SUMMARY (CUNIT_LIST_TOTAL_SUMMARY_RECORD*)>
<!ELEMENT CUNIT_LIST_TOTAL_SUMMARY_RECORD (CUNIT_LIST_TOTAL_SUMMARY_RECORD_TEXT, CUNIT_LIST_TOTAL_SUMMARY_RECORD_VALUE)>
<!ELEMENT CUNIT_LIST_TOTAL_SUMMARY_RECORD_TEXT (#PCDATA)>
<!ELEMENT CUNIT_LIST_TOTAL_SUMMARY_RECORD_VALUE (#PCDATA)>
<!ELEMENT CUNIT_ALL_TEST_LISTING (CUNIT_ALL_TEST_LISTING_GROUP*)>
<!ELEMENT CUNIT_ALL_TEST_LISTING_GROUP (CUNIT_ALL_TEST_LISTING_GROUP_DEFINITION, CUNIT_ALL_TEST_LISTING_GROUP_TESTS*)>
<!ELEMENT CUNIT_ALL_TEST_LISTING_GROUP_DEFINITION (GROUP_NAME, INITIALIZE_VALUE, CLEANUP_VALUE, TEST_COUNT_VALUE)>
<!ELEMENT GROUP_NAME (#PCDATA)>
<!ELEMENT INITIALIZE_VALUE (#PCDATA)>
<!ELEMENT CLEANUP_VALUE (#PCDATA)>
<!ELEMENT TEST_COUNT_VALUE (#PCDATA)>
<!ELEMENT CUNIT_ALL_TEST_LISTING_GROUP_TESTS (TEST_CASE_NAME*)>
<!ELEMENT TEST_CASE_NAME (#PCDATA)>
<!ELEMENT CUNIT_FOOTER (#PCDATA)>
\ No newline at end of file
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="CUNIT_TEST_LIST_REPORT">
<html>
<head>
<title> CUnit - Logical Test Case Organization in Test Registry. </title>
</head>
<body bgcolor="e0e0f0">
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="CUNIT_HEADER">
<div align="center">
<h3> <b> CUnit - A Unit testing framework for C. </b>
<br/> <a href="http://cunit.sourceforge.net/"> http://cunit.sourceforge.net/ </a> </h3>
</div>
</xsl:template>
<xsl:template match="CUNIT_LIST_TOTAL_SUMMARY">
<p/>
<table align="center" width="50%">
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="CUNIT_LIST_TOTAL_SUMMARY_RECORD">
<tr>
<td bgcolor="f0f0e0" width="70%">
<xsl:value-of select="CUNIT_LIST_TOTAL_SUMMARY_RECORD_TEXT" />
</td>
<td bgcolor="f0e0e0" align="center">
<xsl:value-of select="CUNIT_LIST_TOTAL_SUMMARY_RECORD_VALUE" />
</td>
</tr>
</xsl:template>
<xsl:template match="CUNIT_ALL_TEST_LISTING">
<p/>
<div align="center"> <h2> Listing of All Tests </h2> </div>
<table align="center" width="90%">
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="CUNIT_ALL_TEST_LISTING_GROUP">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="CUNIT_ALL_TEST_LISTING_GROUP_DEFINITION">
<tr>
<td width="20%" bgcolor="f0e0f0"> Group Name </td>
<td colspan="5" width="70%" bgcolor="e0f0f0" > <xsl:value-of select="GROUP_NAME" /> </td>
</tr>
<tr>
<td bgcolor="f0e0f0" width="20%"> Initialize Value </td>
<td bgcolor="e0f0f0" width="13%"> <xsl:value-of select="INITIALIZE_VALUE" /> </td>
<td bgcolor="f0e0f0" width="20%"> Cleanup Value </td>
<td bgcolor="e0f0f0" width="13%"> <xsl:value-of select="CLEANUP_VALUE" /> </td>
<td bgcolor="f0e0f0" width="20%"> Number of Tests </td>
<td bgcolor="e0f0f0" width="13%"> <xsl:value-of select="TEST_COUNT_VALUE" /> </td>
</tr>
</xsl:template>
<xsl:template match="CUNIT_ALL_TEST_LISTING_GROUP_TESTS">
<tr>
<td align="center" colspan="6" bgcolor="e0f0d0"> Test Cases </td>
</tr>
<xsl:for-each select="TEST_CASE_NAME">
<tr> <td align="left" colspan="6" bgcolor="e0e0d0"> <xsl:apply-templates/> </td> </tr>
</xsl:for-each>
<tr bgcolor="00ccff"> <td colspan="6"> </td> </tr>
</xsl:template>
<xsl:template match="CUNIT_FOOTER">
<p/>
<hr align="center" width="90%" color="red" />
<h5 align="center">
<xsl:apply-templates/>
</h5>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<!ELEMENT CUNIT_TEST_RUN_REPORT (CUNIT_HEADER,
CUNIT_RESULT_LISTING,CUNIT_RUN_SUMMARY,CUNIT_FOOTER)>
<!ELEMENT CUNIT_HEADER EMPTY>
<!ELEMENT CUNIT_RESULT_LISTING (CUNIT_RUN_GROUP*)>
<!ELEMENT CUNIT_RUN_GROUP (CUNIT_RUN_GROUP_SUCCESS|CUNIT_RUN_GROUP_FAILURE)>
<!ELEMENT CUNIT_RUN_GROUP_SUCCESS (GROUP_NAME,CUNIT_RUN_TEST_RECORD*)>
<!ELEMENT CUNIT_RUN_TEST_RECORD (CUNIT_RUN_TEST_SUCCESS|CUNIT_RUN_TEST_FAILURE)>
<!ELEMENT CUNIT_RUN_TEST_SUCCESS (TEST_NAME)>
<!ELEMENT CUNIT_RUN_TEST_FAILURE (TEST_NAME, FILE_NAME, LINE_NUMBER, CONDITION)>
<!ELEMENT TEST_NAME (#PCDATA)>
<!ELEMENT FILE_NAME (#PCDATA)>
<!ELEMENT LINE_NUMBER (#PCDATA)>
<!ELEMENT CONDITION (#PCDATA)>
<!ELEMENT CUNIT_RUN_GROUP_FAILURE (GROUP_NAME,FAILURE_REASON)>
<!ELEMENT GROUP_NAME (#PCDATA)>
<!ELEMENT FAILURE_REASON (#PCDATA)>
<!ELEMENT CUNIT_RUN_SUMMARY (CUNIT_RUN_SUMMARY_RECORD*)>
<!ELEMENT CUNIT_RUN_SUMMARY_RECORD (TYPE, TOTAL, RUN, SUCCEDDED, FAILED)>
<!ELEMENT TYPE (#PCDATA)>
<!ELEMENT TOTAL (#PCDATA)>
<!ELEMENT RUN (#PCDATA)>
<!ELEMENT SUCCEDDED (#PCDATA)>
<!ELEMENT FAILED (#PCDATA)>
<!ELEMENT CUNIT_FOOTER (#PCDATA)>
\ No newline at end of file
<?xml version='1.0'?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="CUNIT_TEST_RUN_REPORT">
<html>
<head>
<title> CUnit - All Test Run Summary Report. </title>
</head>
<body bgcolor="e0e0f0">
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="CUNIT_HEADER">
<div align="center">
<h3> <b> CUnit - A Unit testing framework for C. </b>
<br/> <a href="http://cunit.sourceforge.net/"> http://cunit.sourceforge.net/ </a> </h3>
</div>
</xsl:template>
<xsl:template match="CUNIT_RESULT_LISTING">
<table cols="4" width="90%" align="center">
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="CUNIT_RUN_GROUP">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="CUNIT_RUN_GROUP_SUCCESS">
<tr bgcolor="f0e0f0">
<td colspan="4"> Running Group <xsl:apply-templates/> </td>
</tr>
</xsl:template>
<xsl:template match="CUNIT_RUN_TEST_RECORD">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="CUNIT_RUN_TEST_SUCCESS">
<tr bgcolor="e0f0d0">
<td> </td> <td colspan="2"> Running test <xsl:apply-templates/>... </td> <td bgcolor="50ff50"> Passed </td>
</tr>
</xsl:template>
<xsl:template match="CUNIT_RUN_TEST_FAILURE">
<tr bgcolor="e0f0d0">
<td> </td> <td colspan="2"> Running test <xsl:value-of select="TEST_NAME"/>... </td> <td bgcolor="ff5050"> Failed </td>
</tr>
<tr>
<td colspan="4" bgcolor="ff9090">
<table width="100%">
<tr> <th width="15%"> File Name </th> <td width="50%" bgcolor="e0eee0"> <xsl:value-of select="FILE_NAME"/> </td> <th width="20%"> Line Number </th> <td width="10%" bgcolor="e0eee0"> <xsl:value-of select="LINE_NUMBER"/> </td> </tr>
<tr> <th width="15%"> Condition </th> <td colspan="3" width="85%" bgcolor="e0eee0"> <xsl:value-of select="CONDITION"/> </td> </tr>
</table>
</td>
</tr>
</xsl:template>
<xsl:template match="CUNIT_RUN_GROUP_FAILURE">
<tr>
<td colspan="3" bgcolor="f0b0f0">Running Group <xsl:value-of select="GROUP_NAME"/>... </td>
<td bgcolor="ff7070"> <xsl:value-of select="FAILURE_REASON"/> </td>
</tr>
</xsl:template>
<xsl:template match="CUNIT_RUN_SUMMARY">
<p/>
<table width="90%" rows="5" align="center">
<tr align="center" bgcolor="skyblue"> <th colspan="5"> Cumulative Summary for Run </th> </tr>
<tr>
<th width="20%" bgcolor="ffffc0" align="center"> Type </th>
<th width="20%" bgcolor="ffffc0" align="center"> Total </th>
<th width="20%" bgcolor="ffffc0" align="center"> Run </th>
<th width="20%" bgcolor="ffffc0" align="center"> Succedded </th>
<th width="20%" bgcolor="ffffc0" align="center"> Failed </th>
</tr>
<xsl:for-each select="CUNIT_RUN_SUMMARY_RECORD">
<tr align="center" bgcolor="lightgreen">
<td> <xsl:value-of select="TYPE" /> </td>
<td> <xsl:value-of select="TOTAL" /> </td>
<td> <xsl:value-of select="RUN" /> </td>
<td> <xsl:value-of select="SUCCEDDED" /> </td>
<td> <xsl:value-of select="FAILED" /> </td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
<xsl:template match="CUNIT_FOOTER">
<p/>
<hr align="center" width="90%" color="red" />
<h5 align="center">
<xsl:apply-templates/>
</h5>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
pkgdata_DATA = \
CUnit-List.dtd \
CUnit-List.xsl \
CUnit-Run.dtd \
CUnit-Run.xsl \
\
md2xml.pl
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
CC = @CC@
MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
RELEASE = @RELEASE@
VERSION = @VERSION@
pkgdata_DATA = CUnit-List.dtd CUnit-List.xsl CUnit-Run.dtd CUnit-Run.xsl md2xml.pl
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
DATA = $(pkgdata_DATA)
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Share/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
install-pkgdataDATA: $(pkgdata_DATA)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
@list='$(pkgdata_DATA)'; for p in $$list; do \
if test -f $(srcdir)/$$p; then \
echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p"; \
$(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p; \
else if test -f $$p; then \
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \
fi; fi; \
done
uninstall-pkgdataDATA:
@$(NORMAL_UNINSTALL)
list='$(pkgdata_DATA)'; for p in $$list; do \
rm -f $(DESTDIR)$(pkgdatadir)/$$p; \
done
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = Share
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
install-data-am: install-pkgdataDATA
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am: uninstall-pkgdataDATA
uninstall: uninstall-am
all-am: Makefile $(DATA)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-generic clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
.PHONY: uninstall-pkgdataDATA install-pkgdataDATA tags distdir info-am \
info dvi-am dvi check check-am installcheck-am installcheck \
install-exec-am install-exec install-data-am install-data install-am \
install uninstall-am uninstall all-redirect all-am all installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
#!/usr/bin/perl
# This is in perl script for Memeory Debugging Report Generator
use warnings;
use strict;
use locale;
# Constant Declarations
use constant SIZE_INDEX => 0;
use constant POINTER_INDEX => 1;
use constant ALLOC_FILENAME_INDEX => 2;
use constant ALLOC_LINE_INDEX => 3;
use constant DEALLOC_FILENAME_INDEX => 4;
use constant DEALLOC_LINE_INDEX => 5;
use constant STATUS_INDEX => 6;
# Global Definitions
my @mem_list;
sub BuildDataList {
open(LIST_FD, $ARGV[0]) or die "Failed to Open file $ARGV[0]";
while (!eof(LIST_FD)) {
my $line = <LIST_FD>;
$line =~s/^[ \t]*//g;
$line =~s/[ \t\n\r]*$//g;
if (length($line) == 0 || index($line, "--") == 0) {
next;
}
my @arr = split("\t", $line);
my @alloc_arr = split(":", $arr[2]);
my @dealloc_arr = split(":", $arr[3]);
my $count = $#mem_list + 1;
$mem_list[$count + 0] = $arr[0];
$mem_list[$count + 1] = hex($arr[1]);
$mem_list[$count + 2] = $alloc_arr[0];
$mem_list[$count + 3] = $alloc_arr[1];
$mem_list[$count + 4] = $dealloc_arr[0];
$mem_list[$count + 5] = $dealloc_arr[1];
$mem_list[$count + 6] = $arr[4];
printf("%d %d ", $mem_list[$count + SIZE_INDEX],
$mem_list[$count + POINTER_INDEX])
}
close(LIST_FD);
return 0;
}
sub PrintDataList {
my $count = 0;
while ($#mem_list > $count) {
# printf("%d ", $mem_list[$count + $SIZE_INDEX]);
$count += STATUS_INDEX;
}
}
BuildDataList();
PrintDataList();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment