|
1 # Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 # All rights reserved. |
|
3 # This component and the accompanying materials are made available |
|
4 # under the terms of "Eclipse Public License v1.0" |
|
5 # which accompanies this distribution, and is available |
|
6 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 # |
|
8 # Initial Contributors: |
|
9 # Nokia Corporation - initial contribution. |
|
10 # |
|
11 # Contributors: |
|
12 # |
|
13 # Description: |
|
14 # |
|
15 |
|
16 """ |
|
17 Run tests for image comparison |
|
18 |
|
19 """ |
|
20 import sys |
|
21 import os |
|
22 from testcase import TestCase |
|
23 |
|
24 # default to winscw |
|
25 if len(sys.argv) < 2: |
|
26 rootDir = os.environ.get('EMULATOR_C_DIR',"\\epoc32\\winscw\\c")+"\\" |
|
27 elif sys.argv[1].lower() == 'armv5': |
|
28 rootDir = os.environ.get('EPOCROOT')+"epoc32\\data\\c\\" |
|
29 elif sys.argv[1].lower() == 'winscw': |
|
30 rootDir = os.environ.get('EMULATOR_C_DIR',"\\epoc32\\winscw\\c")+"\\" |
|
31 else: |
|
32 print 'Select winscw or armv5. (Defaults to winscw if no argument supplied).' |
|
33 sys.exit() |
|
34 |
|
35 # Root directory for test and reference images |
|
36 # Test images are at imgDir + "test\\" |
|
37 # Reference images are at imgDir + "ref\\" |
|
38 imgDir = rootDir+"img\\" |
|
39 |
|
40 # Directory for log result files |
|
41 logDir = rootDir+"logs\\" |
|
42 |
|
43 # Directory for ONB summary file |
|
44 onbDir = rootDir; |
|
45 |
|
46 # HTML file name for an error message page of the test results |
|
47 KErrorMessagePageName = "error.html" |
|
48 |
|
49 errorLog = file(logDir + KErrorMessagePageName, "wt") |
|
50 |
|
51 # Testing the images |
|
52 myTest = TestCase("myTest", imgDir, logDir, onbDir) |
|
53 myTest.readRefImage(errorLog) |
|
54 myTest.readTestImage(errorLog) |
|
55 myTest.computeDifferences(errorLog) |
|
56 |
|
57 errorLog.close() |
|
58 |
|
59 |