sbsv1/buildsystem/test/extensions/test.pl
author Bob Rosenberg <bob.rosenberg@nokia.com>
Wed, 28 Jul 2010 13:20:46 +0100
changeset 624 f70b728ea30c
parent 599 fa7a3cc6effd
permissions -rw-r--r--
Move sysdeftools from buildtools package into build package
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
# template extension makefile test
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    16
#
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 => 6 }
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
my $epocroot = $ENV{'EPOCROOT'};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
###############################################################################
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
# THE TESTS                                                                   #
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
###############################################################################
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
# check base/copy_default in a [non] feature variant world
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
my $mk = "../../extension/base/copy_default.mk";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
my $name = "my_testing";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
my $path = "${epocroot}epoc32/release/armv5/udeb/$name";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
my $vars = "SHELL=cmd PLATFORM_PATH=armv5 CFG_PATH=udeb SOURCES=$name.01 TARGET=$name.loc";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
use File::Copy;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
copy("$name.01", "$path.01");		# no variants
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
unlink("$path.loc");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
system("make -f $mk $vars BLD");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
system("make -f $mk $vars RELEASABLES");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
print "# checking $path.loc\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
ok(-f "$path.loc");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
unlink("$path.01");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
system("make -f $mk $vars CLEAN");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
ok(! -f "$path.loc");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
my $v1 = "11111111101111111110111111111011";	# variant
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
my $v2 = "22222222202222222220222222222022";	# variant
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
copy("$name.01", "$path.$v1.01");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
copy("$name.01", "$path.$v2.01");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
system("make -f $mk $vars BLD");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
system("make -f $mk $vars RELEASABLES");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
print "# checking $path.$v1.loc\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
ok(-f "$path.$v1.loc");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
print "# checking $path.$v2.loc\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
ok(-f "$path.$v2.loc");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
unlink("$path.$v1.01");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
unlink("$path.$v2.01");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
system("make -f $mk $vars CLEAN");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
ok(! -f "$path.$v1.loc");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    78
ok(! -f "$path.$v2.loc");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    79
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    80
###############################################################################
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
# END OF TESTS                                                                #
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
###############################################################################
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    84
# change back to the starting directory
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    85
chdir($cwd);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    86