# -*- coding: utf-8 -*-
# $Id$
"""
Test Result Report Writer.
This takes a processed test result tree and creates a HTML, re-structured text,
or normal text report from it.
"""
__copyright__ = \
"""
Copyright (C) 2010-2014 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
General Public License (GPL) as published by the Free Software
Foundation, in version 2 as it comes in the "COPYING" file of the
VirtualBox OSE distribution. VirtualBox OSE is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
The contents of this file may alternatively be used under the terms
of the Common Development and Distribution License Version 1.0
(CDDL) only, as it comes in the "COPYING.CDDL" file of the
VirtualBox OSE distribution, in which case the provisions of the
CDDL are applicable instead of those of the GPL.
You may elect to license modified versions of this file under the
terms and conditions of either the GPL or the CDDL or both.
"""
""" Apparently, python 3.0(/3.1) has(/will have) support for this..."""
try:
except:
return sPotentialInterger;
# Convert it back to a string (paranoia) and build up the new string.
chSign = '';
chSign = '-';
chSign = '+';
iDigit = 0
sNewVal = '';
iDigit += 1;
"""
A table as a header as well as data rows, thus this class.
"""
"""Adds a row."""
if not fSplitDiff:
else:
# Split cells into multiple rows on '|'. Omit the first column.
iRow = 0;
while fMoreTodo:
# Done?
asThisRow = ['', ];
iRow += 1;
# Readability hack: Add an extra row if there are diffs.
if iRow > 1:
return True;
""" Checks if the test values has the same heading."""
i = 1;
return False;
return False;
i += 1;
return True;
""" Checks if the other table has the same heading."""
return False;
return False;
return False;
return True;
""" Append the rows in oTable. oTable has the same heading as us. """
return True;
# manipulation and stuff
""" Turns bytes into KB, MB or GB. """
## @todo
pass;
""" Adds thousand separators to make numbers more readable. """
return True;
"""Figure out the column withs."""
# Header is first.
acchColumns = [];
cch = 1;
for s in asWords:
# Check out all cells.
return acchColumns;
"""
Break the test results down into a list of tables containing the values.
TODO: Handle passed / failed stuff too. Not important for benchmarks.
"""
# Pass 1
aoTables = [];
aoStack = [];
# depth first
continue;
# values -> row
else:
# Pass 2 - Combine tables with the same heading.
aoTables2 = [];
oTable = None;
break;
if oTable is not None:
return aoTables2;
"""
Produce an HTML report on stdout (via print).
"""
print 'not implemented: %s' % (oTest);
return False;
"""
Produce a ReStructured text report on stdout (via print).
"""
print 'not implemented: %s' % (oTest);
return False;
"""
Produce a text report on stdout (via print).
"""
#
# Report header.
#
## @todo later
#
# Tabelize the the results and display the tables.
#
# The header.
# This is a bit tedious and the solution isn't entirely elegant due
# to the pick-it-up-as-you-go-along python skills.
aasHeader = [];
iLine = 0;
for s in asWords:
else:
iLine += 1;
sLine = '';
print sLine;
# Units.
sLine = '';
print sLine;
# Separator line.
sLine = '';
print sLine;
# The rows.
print sText;
return None;