graphicsdeviceinterface/directgdi/test/scripts/runtest.pl
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     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 sub convertMbm
       
    18 {
       
    19 	my $dir = shift or die( "no argument given." );
       
    20 	# Directory of the reference images
       
    21 	$dir = ".\\$dir";
       
    22 	my @files = `dir $dir\\*.mbm /B`;
       
    23 	# Convert all the reference images under its directory from .mbm to .bmp files
       
    24 	foreach $file (@files)
       
    25 	{
       
    26 		chomp $file;
       
    27 		$file = "$dir\\$file";
       
    28 		my $bmpfile = $file;
       
    29 		$bmpfile =~ s/mbm$/bmp/;
       
    30 
       
    31 		# -M OPERAND Returns the age of OPERAND in days when the program started.
       
    32     # Dont output a message if skipping the file, to keep the output relevant.
       
    33     # The conversion utility outputs a message if conversion is performed.
       
    34 		if ( -e $bmpfile && ( -M $bmpfile < -M $file ) ) {
       
    35 			# print "skipping $file\n";
       
    36 			next;
       
    37 		}
       
    38 		
       
    39 		my $cmd = "bmconv /u $file $bmpfile";
       
    40 		print "$cmd\n";
       
    41 		print `$cmd`;
       
    42 	}
       
    43 }
       
    44 
       
    45 convertMbm( "ref" );
       
    46 convertMbm( "test" );
       
    47 
       
    48 # Call python scripts to compare the difference between reference images and test images
       
    49 my $cmd = "runtest.py $ARGV[0]";
       
    50 print "$cmd\n";
       
    51 print `$cmd`;
       
    52