Subversion Repositories DevTools

Rev

Rev 4778 | Rev 4902 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4778 Rev 4781
Line 143... Line 143...
143
our %ScmSourceTypes         = ();
143
our %ScmSourceTypes         = ();
144
our $ScmDeploymentPatch     = "";
144
our $ScmDeploymentPatch     = "";
145
our $ProjectBase            = "";               # Base of the user's project
145
our $ProjectBase            = "";               # Base of the user's project
146
our $ScmNoToolsTest         = "";               # Supress compiler tests
146
our $ScmNoToolsTest         = "";               # Supress compiler tests
147
our $ScmDependTags          = 0;                # Create dependancy scanning tag
147
our $ScmDependTags          = 0;                # Create dependancy scanning tag
-
 
148
our $ScmMakeUid;                                # Unique makefile id (number 1 .. )
148
 
149
 
149
our @CFLAGS                 = ();
150
our @CFLAGS                 = ();
150
our @CFLAGS_DEBUG           = ();
151
our @CFLAGS_DEBUG           = ();
151
our @CFLAGS_PROD            = ();
152
our @CFLAGS_PROD            = ();
152
our @CLINTFLAGS             = ();
153
our @CLINTFLAGS             = ();
Line 355... Line 356...
355
    $ScmSourceTypes{ ".awk" }   = "--Ignore";
356
    $ScmSourceTypes{ ".awk" }   = "--Ignore";
356
 
357
 
357
#.. Get the stuff from the build configuration file
358
#.. Get the stuff from the build configuration file
358
#
359
#
359
    ConfigLoad();
360
    ConfigLoad();
-
 
361
    $ScmMakeUid = GetMakfilefileUid();
-
 
362
    Debug("ScmMakeUid: $ScmMakeUid");
360
 
363
 
361
    if ( (%::ScmBuildPlatforms) )        # Interface/build.cfg
364
    if ( (%::ScmBuildPlatforms) )        # Interface/build.cfg
362
    {
365
    {
363
        AddPlatformArg( split( /$;/, $::ScmBuildPlatforms{ $ScmPlatform } ));
366
        AddPlatformArg( split( /$;/, $::ScmBuildPlatforms{ $ScmPlatform } ));
364
    }
367
    }
Line 4701... Line 4704...
4701
#                                     Options are:
4704
#                                     Options are:
4702
#                                       --Auto              - Non interactive unit test
4705
#                                       --Auto              - Non interactive unit test
4703
#                                       --Unit              - Same and --Auto
4706
#                                       --Unit              - Same and --Auto
4704
#                                       --UtfFormat=nnn     - Specifies Automated Unit Test, 
4707
#                                       --UtfFormat=nnn     - Specifies Automated Unit Test, 
4705
#                                                             results post processed with formatter
4708
#                                                             results post processed with formatter
-
 
4709
#                                       --UtfArg=nnn        - Argument passed into the UTF formatter    
-
 
4710
#                                       --Name=nnn          - Test Name.
4706
#                                       --CopyIn=file       - A file to be copied into
4711
#                                       --CopyIn=file       - A file to be copied into
4707
#                                                             The test directory.
4712
#                                                             The test directory.
4708
#
4713
#
4709
#                                     Non Options are passed to the test program.
4714
#                                     Non Options are passed to the test program.
4710
#                                     --PackageBase(xxx)    - Base of package
4715
#                                     --PackageBase(xxx)    - Base of package
Line 4717... Line 4722...
4717
#                                       --FrameWork=name    - Name of framework
4722
#                                       --FrameWork=name    - Name of framework
4718
#                                       --xxxx              - Args passed to framework constructor
4723
#                                       --xxxx              - Args passed to framework constructor
4719
#
4724
#
4720
# Returns         : Nothing
4725
# Returns         : Nothing
4721
#
4726
#
4722
 
-
 
-
 
4727
my %RunTestNames;                       # Unique Name Tests
4723
sub RunTest
4728
sub RunTest
4724
{
4729
{
4725
    my( $platforms, $prog, @elements ) = @_;
4730
    my( $platforms, $prog, @elements ) = @_;
4726
    my $command = './';                 # program prefix / command
4731
    my $command = './';                 # program prefix / command
4727
    my $winprog = 1;                    # 1: Convert / -> \ (WIN32 only)
4732
    my $winprog = 1;                    # 1: Convert / -> \ (WIN32 only)
4728
    my $framework;
4733
    my $framework;
4729
    my @framework_opts;
4734
    my @framework_opts;
4730
    my @copy = ();
4735
    my @copy = ();
4731
    my $auto;
4736
    my $auto;
4732
    my $utfFormat;
4737
    my $utfFormat;
-
 
4738
    my @utfArgs;
-
 
4739
    my $utfName;
4733
 
4740
 
4734
    return if ( ! ActivePlatform($platforms) );
4741
    return if ( ! ActivePlatform($platforms) );
4735
 
4742
 
4736
    #
4743
    #
4737
    #   Scan @elements and extract useful information
4744
    #   Scan @elements and extract useful information
Line 4745... Line 4752...
4745
            $framework = $1;
4752
            $framework = $1;
4746
 
4753
 
4747
        } elsif ( m/^--Auto/ || m/^--Unit/) {
4754
        } elsif ( m/^--Auto/ || m/^--Unit/) {
4748
            $auto = 1;
4755
            $auto = 1;
4749
 
4756
 
-
 
4757
        } elsif ( m/^--Name=(.*)/) {
-
 
4758
            $utfName = $1;
-
 
4759
 
-
 
4760
            Error("Duplicate Test Name: $utfName")
-
 
4761
                if (exists $RunTestNames{$utfName} );
-
 
4762
            $RunTestNames{$utfName} = 1;
-
 
4763
 
4750
        } elsif ( m/^--UtfFormat=(.*)/) {
4764
        } elsif ( m/^--UtfFormat=(.*)/) {
4751
            $utfFormat = $1;
4765
            $utfFormat = $1;
4752
 
4766
 
-
 
4767
        } elsif ( m/^--UtfArg=(.*)/) {
-
 
4768
            push @utfArgs, $1;
-
 
4769
 
4753
        } elsif ( m/^--CopyIn=(.*)/ ) {
4770
        } elsif ( m/^--CopyIn=(.*)/ ) {
4754
            push @copy, MakeSrcResolve ( $1 );
4771
            push @copy, MakeSrcResolve ( $1 );
4755
 
4772
 
4756
 
4773
 
4757
        } elsif ( $framework && m/^--\w+=(.+)/ ) {
4774
        } elsif ( $framework && m/^--\w+=(.+)/ ) {
Line 4951... Line 4968...
4951
    $test_entry{'prog'}     = $prog;
4968
    $test_entry{'prog'}     = $prog;
4952
    $test_entry{'copyprog'} = 1;
4969
    $test_entry{'copyprog'} = 1;
4953
    $test_entry{'args'}     = \@uargs;
4970
    $test_entry{'args'}     = \@uargs;
4954
    $test_entry{'auto'}     = $auto if ( $auto );
4971
    $test_entry{'auto'}     = $auto if ( $auto );
4955
    $test_entry{'utfformat'}= $utfFormat if ( $utfFormat );
4972
    $test_entry{'utfformat'}= $utfFormat if ( $utfFormat );
-
 
4973
    $test_entry{'utfargs'}  = \@utfArgs;
-
 
4974
    $test_entry{'utfname'}  = $utfName;
4956
    $test_entry{'copyin'}   = \@copy;
4975
    $test_entry{'copyin'}   = \@copy;
4957
    $test_entry{'copyonce'} = ();
4976
    $test_entry{'copyonce'} = ();
4958
    $test_entry{'preq'}     = \@preq_files;
4977
    $test_entry{'preq'}     = \@preq_files;
4959
    $test_entry{'testdir'}  = 'BINDIR';
4978
    $test_entry{'testdir'}  = 'BINDIR';
4960
 
4979
 
Line 8509... Line 8528...
8509
    if ( $ScmProduct ne "" );
8528
    if ( $ScmProduct ne "" );
8510
 
8529
 
8511
MakePrint( "GBE_OS_COMMON := $::BUILDINFO{$ScmPlatform}{OS_COMMON}\n" )
8530
MakePrint( "GBE_OS_COMMON := $::BUILDINFO{$ScmPlatform}{OS_COMMON}\n" )
8512
    if ( exists($::BUILDINFO{$ScmPlatform}{OS_COMMON}) );
8531
    if ( exists($::BUILDINFO{$ScmPlatform}{OS_COMMON}) );
8513
 
8532
 
8514
 
-
 
8515
    print MAKEFILE <<EOF;
8533
    print MAKEFILE <<EOF;
8516
 
8534
 
8517
SHELL           := \$(GBE_BIN)/sh
8535
SHELL           := \$(GBE_BIN)/sh
8518
SHELLARGS       :=
8536
SHELLARGS       :=
8519
EXTENDED_LINE   := \$(GBE_BIN)/extend.lst
8537
EXTENDED_LINE   := \$(GBE_BIN)/extend.lst
Line 8524... Line 8542...
8524
BUILDVER         := $::ScmBuildVersionFull
8542
BUILDVER         := $::ScmBuildVersionFull
8525
BUILDVERNUM      := $::ScmBuildVersion
8543
BUILDVERNUM      := $::ScmBuildVersion
8526
BUILDPREVIOUSVER := $::ScmBuildPreviousVersion
8544
BUILDPREVIOUSVER := $::ScmBuildPreviousVersion
8527
DEPLOYPATCH      := $ScmDeploymentPatch
8545
DEPLOYPATCH      := $ScmDeploymentPatch
8528
GBE_NOTOOLSTEST  := $ScmNoToolsTest
8546
GBE_NOTOOLSTEST  := $ScmNoToolsTest
-
 
8547
MAKEFILEUID      := $ScmMakeUid
-
 
8548
export MAKEFILEUID
8529
 
8549
 
8530
#
8550
#
8531
#   Ensure PWD is correctly set
8551
#   Ensure PWD is correctly set
8532
#
8552
#
8533
PWD             := \$(CURDIR)
8553
PWD             := \$(CURDIR)
Line 9258... Line 9278...
9258
    foreach my $pEntry ( @TESTS_TO_RUN )
9278
    foreach my $pEntry ( @TESTS_TO_RUN )
9259
    {                                           # Foreach test
9279
    {                                           # Foreach test
9260
        $idx++;
9280
        $idx++;
9261
        $pEntry->{'index'} = $idx;
9281
        $pEntry->{'index'} = $idx;
9262
        $pEntry->{'test_name'} = "run_test_$idx";
9282
        $pEntry->{'test_name'} = "run_test_$idx";
-
 
9283
        $pEntry->{'utfname'} = $pEntry->{'test_name'} unless defined $pEntry->{'utfname'};  
9263
 
9284
 
9264
        #
9285
        #
9265
        #   If the test is being run within a 'FrameWork' then the underlying
9286
        #   If the test is being run within a 'FrameWork' then the underlying
9266
        #   toolset must instantiate the frame work.
9287
        #   toolset must instantiate the frame work.
9267
        #
9288
        #
Line 9285... Line 9306...
9285
        push @TESTPROJECT_TO_ARUN, $test_name if     ($pEntry->{'auto'} );
9306
        push @TESTPROJECT_TO_ARUN, $test_name if     ($pEntry->{'auto'} );
9286
 
9307
 
9287
        my $tprog = $tdir . '/' . StripDir( $pEntry->{'prog'} );
9308
        my $tprog = $tdir . '/' . StripDir( $pEntry->{'prog'} );
9288
        
9309
        
9289
        my $me = MakeEntry::New( *MAKEFILE, $test_name, '--Phony' );
9310
        my $me = MakeEntry::New( *MAKEFILE, $test_name, '--Phony' );
-
 
9311
 
-
 
9312
        #
-
 
9313
        #   Export GBE_UTFNAME for the duration of the test
-
 
9314
        #
-
 
9315
        $me->AddDefn('export GBE_UTFNAME', $pEntry->{'utfname'});
-
 
9316
        $me->AddDefn('export GBE_UTFUID', '$(MAKEFILEUID)' . '_' . $pEntry->{'index'});
-
 
9317
 
9290
        $me->AddDependancy( "\$(GBE_$tdir_alias)" );
9318
        $me->AddDependancy( "\$(GBE_$tdir_alias)" );
9291
        $me->AddDependancy( "\$(INTERFACEDIR)/set_$::ScmPlatform.sh" );
9319
        $me->AddDependancy( "\$(INTERFACEDIR)/set_$::ScmPlatform.sh" );
9292
        $me->AddDependancy( $tprog ) if $pEntry->{'copyprog'};
9320
        $me->AddDependancy( $tprog ) if $pEntry->{'copyprog'};
9293
        $me->AddDependancy( @{ $pEntry->{'copyin' } } );
9321
        $me->AddDependancy( @{ $pEntry->{'copyin' } } );
9294
        $me->AddDependancy( map { $tdir . '/' . StripDir($_) } @{ $pEntry->{'copyonce' } } );
9322
        $me->AddDependancy( map { $tdir . '/' . StripDir($_) } @{ $pEntry->{'copyonce' } } );
Line 9318... Line 9346...
9318
        #
9346
        #
9319
        #   Insert any FrameWork Recipe bits
9347
        #   Insert any FrameWork Recipe bits
9320
        #
9348
        #
9321
        $me->AddShellRecipe ( @{$pEntry->{'ShellRecipe'}} );
9349
        $me->AddShellRecipe ( @{$pEntry->{'ShellRecipe'}} );
9322
 
9350
 
-
 
9351
        #
-
 
9352
        #   Insert command
-
 
9353
        #       If we could run a UTF filter, then ignore the commands return code
-
 
9354
        #
9323
        $me->AddShellRecipe ( "cd $tdir" );
9355
        $me->AddShellRecipe ( "cd $tdir" );
9324
        $me->AddShellRecipe ( ["GBE_TYPE=\$(GBE_TYPE)",
9356
        $me->AddShellRecipe ( ["GBE_TYPE=\$(GBE_TYPE)",
9325
                               "GBE_HOST=\$(GBE_HOST)",
9357
                               "GBE_HOST=\$(GBE_HOST)",
9326
                               "GBE_ROOT=\$(GBE_ROOT_ABS)",
9358
                               "GBE_ROOT=\$(GBE_ROOT_ABS)",
9327
                               "PATH=.\\$::ScmPathSep\$(BINDIR_LOCAL_PATH)\\$::ScmPathSep\$\$PATH",
9359
                               "PATH=.\\$::ScmPathSep\$(BINDIR_LOCAL_PATH)\\$::ScmPathSep\$\$PATH",
9328
                               $pEntry->{'command'},
9360
                               $pEntry->{'command'},
9329
                               @{$pEntry->{'args'}},
9361
                               @{$pEntry->{'args'}},
-
 
9362
                               $pEntry->{'utfformat' } ? '|| true' : ''
9330
                               ] );
9363
                               ] );
9331
        if ($pEntry->{'utfformat' })
9364
        if ($pEntry->{'utfformat' })
9332
        {
9365
        {
9333
            #
9366
            #
-
 
9367
            #   Create the basic command line for 'jats_runutf'
-
 
9368
            #
-
 
9369
            my @cmdline;
-
 
9370
            push @cmdline, '--';
-
 
9371
            push @cmdline, '$(VERBOSE_OPT)';
-
 
9372
            push @cmdline, "-filter=$pEntry->{utfformat}";
-
 
9373
            push @cmdline, '-root=$(GBE_ROOT_ABS)' ;
-
 
9374
            push @cmdline, "-dir=$tdir";
-
 
9375
            push @cmdline, '-target=$(GBE_PLATFORM)';
-
 
9376
            push @cmdline, '-pkgdir=$(PKGDIR)';
-
 
9377
            push @cmdline, '-local=$(LOCALDIR)';
-
 
9378
            push @cmdline, '-interface=$(INTERFACEDIR)';
-
 
9379
            foreach my $entry (@{$pEntry->{'utfargs' }})
-
 
9380
            {
-
 
9381
                push @cmdline, '-arg=' . $entry;
-
 
9382
            }
-
 
9383
            
-
 
9384
            #
9334
            #   Insert commands to post process the test results according to the specified formatter
9385
            #   Insert commands to post process the test results according to the specified formatter
9335
            #
9386
            #
9336
            $me->NewSection     ();
9387
            $me->NewSection     ();
-
 
9388
            $me->SectionDef     ('UTF_POSTPROCESS');
9337
            $me->RecipePrefix   ('$(XX_PRE)');
9389
            $me->RecipePrefix   ('$(XX_PRE)');
9338
            $me->AddShellRecipe ( "if [ -n \"\${GBE_ABT}\" ] ; then :" );
-
 
9339
            $me->AddShellRecipe ( "echo --------------------------------------" );
-
 
9340
            $me->AddShellRecipe ( "echo UTF stuff goes here:" . $pEntry->{'utfformat' } );
9390
            $me->AddRecipe      ( "\$(GBE_PERL) -Mjats_runutf -e processUtf " . join(" \\\n\t\t\t", @cmdline)  );
9341
            $me->AddShellRecipe ( "echo --------------------------------------" );
-
 
9342
            $me->AddShellRecipe ( "fi" );
-
 
9343
        }
9391
        }
9344
 
9392
 
9345
        $me->Print();
9393
        $me->Print();
9346
 
9394
 
9347
 
9395