sbsv1/buildsystem/test/helloworld/test.pl
author wbernard
Wed, 18 Aug 2010 17:23:33 +0300
changeset 629 541af5ee3ed9
parent 599 fa7a3cc6effd
permissions -rw-r--r--
Merge with changes from SF.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     2
# All rights reserved.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     3
# This component and the accompanying materials are made available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     4
# under the terms of "Eclipse Public License v1.0"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     5
# which accompanies this distribution, and is available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     7
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     8
# Initial Contributors:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    10
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    11
# Contributors:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    12
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    13
# Description:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    14
# hello world build test
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    16
# If we cannot build this then we probably cannot build anything...
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    17
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
use strict;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
use Test;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
# how many tests do we plan to run?
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
BEGIN { plan tests => 4 }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
# remember where we started
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
use Cwd;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
my $cwd = getcwd();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
# change to the test data directory
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
use File::Basename;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
my $dir = dirname($0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
chdir($dir);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
print "# running in $dir\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
# remove the binaries if they already exist
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
my $release = $ENV{'EPOCROOT'} . "epoc32/release";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
my @binaries = ("$release/winscw/udeb/HelloWorld.exe",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
			    "$release/winscw/urel/HelloWorld.exe",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
				"$release/armv5/udeb/HelloWorld.exe",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
				"$release/armv5/urel/HelloWorld.exe"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
			   );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
foreach (@binaries)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
	unlink($_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
###############################################################################
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
# THE TESTS                                                                   #
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
###############################################################################
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
# we cannot test the command return values because they are always 0
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
system("bldmake bldfiles");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
system("abld build");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
# test for the existence of each binary file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
foreach (@binaries)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
	print "# checking $_\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
	ok(-f $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
###############################################################################
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
# END OF TESTS                                                                #
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
###############################################################################
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
# change back to the starting directory
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
chdir($cwd);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68