sbsv1/buildsystem/test/helloworld/test.pl
changeset 607 378360dbbdba
parent 599 fa7a3cc6effd
equal deleted inserted replaced
591:22486c9c7b15 607:378360dbbdba
       
     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 # hello world build test
       
    15 #
       
    16 # If we cannot build this then we probably cannot build anything...
       
    17 
       
    18 use strict;
       
    19 use Test;
       
    20 
       
    21 # how many tests do we plan to run?
       
    22 BEGIN { plan tests => 4 }
       
    23 
       
    24 # remember where we started
       
    25 use Cwd;
       
    26 my $cwd = getcwd();
       
    27 
       
    28 # change to the test data directory
       
    29 use File::Basename;
       
    30 my $dir = dirname($0);
       
    31 chdir($dir);
       
    32 print "# running in $dir\n";
       
    33 
       
    34 # remove the binaries if they already exist
       
    35 my $release = $ENV{'EPOCROOT'} . "epoc32/release";
       
    36 my @binaries = ("$release/winscw/udeb/HelloWorld.exe",
       
    37 			    "$release/winscw/urel/HelloWorld.exe",
       
    38 				"$release/armv5/udeb/HelloWorld.exe",
       
    39 				"$release/armv5/urel/HelloWorld.exe"
       
    40 			   );
       
    41 
       
    42 foreach (@binaries)
       
    43 {
       
    44 	unlink($_);
       
    45 }
       
    46 
       
    47 ###############################################################################
       
    48 # THE TESTS                                                                   #
       
    49 ###############################################################################
       
    50 
       
    51 # we cannot test the command return values because they are always 0
       
    52 system("bldmake bldfiles");
       
    53 system("abld build");
       
    54 
       
    55 # test for the existence of each binary file
       
    56 foreach (@binaries)
       
    57 {
       
    58 	print "# checking $_\n";
       
    59 	ok(-f $_);
       
    60 }
       
    61 
       
    62 ###############################################################################
       
    63 # END OF TESTS                                                                #
       
    64 ###############################################################################
       
    65 
       
    66 # change back to the starting directory
       
    67 chdir($cwd);
       
    68