0
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "symbianunittestoutputformatter.h"
|
|
19 |
#include "symbianunittestfileoutputwriter.h"
|
|
20 |
#include "symbianunittestresult.h"
|
|
21 |
|
|
22 |
|
|
23 |
// -----------------------------------------------------------------------------
|
|
24 |
//
|
|
25 |
// -----------------------------------------------------------------------------
|
|
26 |
//
|
|
27 |
CSymbianUnitTestOutputFormatter::CSymbianUnitTestOutputFormatter()
|
|
28 |
{
|
|
29 |
}
|
|
30 |
|
|
31 |
// -----------------------------------------------------------------------------
|
|
32 |
//
|
|
33 |
// -----------------------------------------------------------------------------
|
|
34 |
//
|
|
35 |
void CSymbianUnitTestOutputFormatter::ConstructL( const TDesC& aFileName )
|
|
36 |
{
|
|
37 |
TInt fileNameLength = aFileName.Length();
|
|
38 |
fileNameLength += 1; // dot length
|
|
39 |
fileNameLength += FileExtension().Length();
|
|
40 |
HBufC* fileName = HBufC::NewLC( fileNameLength );
|
|
41 |
fileName->Des() = aFileName;
|
|
42 |
fileName->Des().Append('.');
|
|
43 |
fileName->Des().Append( FileExtension() );
|
|
44 |
iOutputWriter = CSymbianUnitTestFileOutputWriter::NewL( *fileName );
|
|
45 |
CleanupStack::PopAndDestroy( fileName );
|
|
46 |
}
|
|
47 |
|
|
48 |
// -----------------------------------------------------------------------------
|
|
49 |
//
|
|
50 |
// -----------------------------------------------------------------------------
|
|
51 |
//
|
|
52 |
CSymbianUnitTestOutputFormatter::~CSymbianUnitTestOutputFormatter()
|
|
53 |
{
|
|
54 |
delete iOutputWriter;
|
|
55 |
}
|
|
56 |
|
|
57 |
// -----------------------------------------------------------------------------
|
|
58 |
//
|
|
59 |
// -----------------------------------------------------------------------------
|
|
60 |
//
|
|
61 |
void CSymbianUnitTestOutputFormatter::PrintL( CSymbianUnitTestResult& aResult )
|
|
62 |
{
|
|
63 |
PrintHeaderL( aResult );
|
|
64 |
PrintPassedTestsL( aResult );
|
|
65 |
PrintFailedTestsL( aResult );
|
|
66 |
PrintFooterL();
|
|
67 |
}
|