Subversion Repositories DevTools

Rev

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

Rev 4455 Rev 4501
Line 252... Line 252...
252
                                '%INSTALL_PROGS', '%INSTALL_SHLIBS');
252
                                '%INSTALL_PROGS', '%INSTALL_SHLIBS');
253
 
253
 
254
our @LINTLIBS               = ();
254
our @LINTLIBS               = ();
255
our @LINTSHLIBS             = ();
255
our @LINTSHLIBS             = ();
256
 
256
 
257
our @TESTS_TO_RUN           = ();
257
our @TESTS_TO_RUN           = ();                           # Info from 'RunTest' directives
-
 
258
 
258
our @TESTPROJECT_TO_URUN    = ();
259
our @TESTPROJECT_TO_URUN    = ();                           # List of Unit Tests and Projects names (Non Auto)
259
our @TESTPROJECT_TO_ARUN    = ();
260
our @TESTPROJECT_TO_ARUN    = ();                           # List of Auto Tests and Projects names
260
my  $TESTS_TO_AUTORUN       = undef;
261
my  $TESTS_TO_AUTORUN       = undef;                        # Flag - Auto Test found
261
my  $TESTS_TO_RUN           = undef;
262
my  $TESTS_TO_RUN           = undef;                        # Flag - Unit Test found
262
 
263
 
263
#our $CurrentTime           = "";
264
#our $CurrentTime           = "";
264
#our $CurrentDate           = "";
265
#our $CurrentDate           = "";
265
#our $Cwd                   = "";
266
#our $Cwd                   = "";
266
 
267
 
Line 4877... Line 4878...
4877
    push ( @TESTS_TO_RUN, \%test_entry );
4878
    push ( @TESTS_TO_RUN, \%test_entry );
4878
 
4879
 
4879
    #
4880
    #
4880
    #   Flag Auto Run processing required
4881
    #   Flag Auto Run processing required
4881
    #
4882
    #
-
 
4883
    $TESTS_TO_RUN = 1;
4882
    $TESTS_TO_AUTORUN = 1 if ( $auto );
4884
    $TESTS_TO_AUTORUN = 1 if ( $auto );
4883
}
4885
}
4884
 
4886
 
4885
 
4887
 
4886
sub TestProg
4888
sub TestProg
Line 5461... Line 5463...
5461
    $PROJECTS{$proj}{'unittest'} = $unit_tests if ( $unit_tests );
5463
    $PROJECTS{$proj}{'unittest'} = $unit_tests if ( $unit_tests );
5462
    $PROJECTS{$proj}{'autotest'} = $auto_tests if ( $auto_tests );
5464
    $PROJECTS{$proj}{'autotest'} = $auto_tests if ( $auto_tests );
5463
    UniquePush (\@PROJECTS_ORDER, $proj);
5465
    UniquePush (\@PROJECTS_ORDER, $proj);
5464
 
5466
 
5465
    $TESTS_TO_AUTORUN = 1 if ( $auto_tests );
5467
    $TESTS_TO_AUTORUN = 1 if ( $auto_tests );
5466
    $TESTS_TO_RUN = 1 if ( $unit_tests || $auto_tests );
5468
    $TESTS_TO_RUN     = 1 if ( $unit_tests || $auto_tests );
5467
 
5469
 
5468
    #
5470
    #
5469
    #   Validate some of the arguments
5471
    #   Validate some of the arguments
5470
    #
5472
    #
5471
    Error ("MakeAnt. Conflicting options --Debug and --Prod" )
5473
    Error ("MakeAnt. Conflicting options --Debug and --Prod" )
Line 9166... Line 9168...
9166
#   Automated tests
9168
#   Automated tests
9167
#
9169
#
9168
    MakeHeader ("Automated tests");
9170
    MakeHeader ("Automated tests");
9169
 
9171
 
9170
    my $idx = 0;
9172
    my $idx = 0;
9171
    my @test_set;
-
 
9172
    my @test_set_auto;
-
 
9173
    my @copy_set = ();
9173
    my @copy_set = ();
9174
 
9174
 
9175
    foreach my $pEntry ( @TESTS_TO_RUN )
9175
    foreach my $pEntry ( @TESTS_TO_RUN )
9176
    {                                           # Foreach test
9176
    {                                           # Foreach test
9177
        $idx++;
9177
        $idx++;
Line 9196... Line 9196...
9196
 
9196
 
9197
        my $tdir_alias = $pEntry->{'testdir'};
9197
        my $tdir_alias = $pEntry->{'testdir'};
9198
        my $tdir = '$(' . $tdir_alias . ')';
9198
        my $tdir = '$(' . $tdir_alias . ')';
9199
 
9199
 
9200
        my $test_name = $pEntry->{'test_name'};
9200
        my $test_name = $pEntry->{'test_name'};
9201
        push @test_set, $test_name;
9201
        push @TESTPROJECT_TO_URUN, $test_name unless ($pEntry->{'auto'} );
9202
        push @test_set_auto, $test_name if ($pEntry->{'auto'} );
9202
        push @TESTPROJECT_TO_ARUN, $test_name if     ($pEntry->{'auto'} );
9203
 
9203
 
9204
        my $tprog = $tdir . '/' . StripDir( $pEntry->{'prog'} );
9204
        my $tprog = $tdir . '/' . StripDir( $pEntry->{'prog'} );
9205
        
9205
        
9206
        my $me = MakeEntry::New( *MAKEFILE, $test_name, '--Phony' );
9206
        my $me = MakeEntry::New( *MAKEFILE, $test_name, '--Phony' );
9207
        $me->AddDependancy( "\$(GBE_$tdir_alias)" );
9207
        $me->AddDependancy( "\$(GBE_$tdir_alias)" );
Line 9264... Line 9264...
9264
            
9264
            
9265
        }
9265
        }
9266
    }
9266
    }
9267
 
9267
 
9268
    #
9268
    #
9269
    #   Generate a target that specifies the tests to be run
-
 
9270
    #   Each test is provided with a dummy name
-
 
9271
    #
-
 
9272
    push @test_set, @TESTPROJECT_TO_ARUN;
-
 
9273
    push @test_set, @TESTPROJECT_TO_URUN;
-
 
9274
    if (@test_set)
-
 
9275
    {
-
 
9276
        unshift @test_set, 'makefile.pl';
-
 
9277
        MakeEntry3("\nrun_tests", ":", \@test_set );
-
 
9278
    }
-
 
9279
 
-
 
9280
    push @test_set_auto, @TESTPROJECT_TO_ARUN;
-
 
9281
    if (@test_set_auto)
-
 
9282
    {
-
 
9283
        unshift @test_set_auto, 'makefile.pl';
-
 
9284
        MakeEntry3("\nrun_unit_tests", ":", \@test_set_auto );
-
 
9285
    }
-
 
9286
 
-
 
9287
    #
-
 
9288
    #   Generate sanity test for each copyin script
9269
    #   Generate sanity test for each copyin script
9289
    #   Simply to provide a nice error message for generated scripts
9270
    #   Simply to provide a nice error message for generated scripts
9290
    #   that do not exist at run-time
9271
    #   that do not exist at run-time
9291
    #
9272
    #
9292
    test_copy_in:
9273
    test_copy_in:
Line 9476... Line 9457...
9476
MakeDefEntry( "LINTPROGS",      "+=", CreateNameList( 'prog_', '_lint', \@TESTPROGS ));
9457
MakeDefEntry( "LINTPROGS",      "+=", CreateNameList( 'prog_', '_lint', \@TESTPROGS ));
9477
MakeDefEntry( "PROJECTS",        "=", CreateNameList( 'Project_', '', ListGeneratedProjects(1) ));
9458
MakeDefEntry( "PROJECTS",        "=", CreateNameList( 'Project_', '', ListGeneratedProjects(1) ));
9478
MakeDefEntry( "PROJECTSGEN",     "=", CreateNameList( 'Project_', '', ListGeneratedProjects(0) ));
9459
MakeDefEntry( "PROJECTSGEN",     "=", CreateNameList( 'Project_', '', ListGeneratedProjects(0) ));
9479
MakeDefEntry( "PROJECTSCLEAN",   "=", CreateNameList( 'ProjectClean_', '', \%PROJECTS ));
9460
MakeDefEntry( "PROJECTSCLEAN",   "=", CreateNameList( 'ProjectClean_', '', \%PROJECTS ));
9480
 
9461
 
-
 
9462
MakeDefEntry( "UNITTESTS",       "=", \@TESTPROJECT_TO_URUN );
-
 
9463
MakeDefEntry( "AUTOUNITTESTS",   "=", \@TESTPROJECT_TO_ARUN );
-
 
9464
 
9481
MakeHeader ("Toolset components");
9465
MakeHeader ("Toolset components");
9482
MakeDefEntry( "USERGENERATED",        "=", \@USERGENERATED )    if ( @USERGENERATED );
9466
MakeDefEntry( "USERGENERATED",        "=", \@USERGENERATED )    if ( @USERGENERATED );
9483
MakeDefEntry( "TOOLSETGENERATED",     "=", \@TOOLSETGENERATED ) if ( @TOOLSETGENERATED );
9467
MakeDefEntry( "TOOLSETGENERATED",     "=", \@TOOLSETGENERATED ) if ( @TOOLSETGENERATED );
9484
MakeDefEntry( "TOOLSETOBJS",          "=", \@TOOLSETOBJS )      if ( @TOOLSETOBJS );
9468
MakeDefEntry( "TOOLSETOBJS",          "=", \@TOOLSETOBJS )      if ( @TOOLSETOBJS );
9485
MakeDefEntry( "TOOLSETLIBS",          "=", \@TOOLSETLIBS )      if ( @TOOLSETLIBS );
9469
MakeDefEntry( "TOOLSETLIBS",          "=", \@TOOLSETLIBS )      if ( @TOOLSETLIBS );
Line 9737... Line 9721...
9737
my @unprogact;
9721
my @unprogact;
9738
push @unprogact, RmFilesCmd( 'PROGS' )        if ( @PROGS );
9722
push @unprogact, RmFilesCmd( 'PROGS' )        if ( @PROGS );
9739
push @unprogact, RmFilesCmd( 'TOOLSETPROGS' ) if ( @TOOLSETPROGS );
9723
push @unprogact, RmFilesCmd( 'TOOLSETPROGS' ) if ( @TOOLSETPROGS );
9740
 
9724
 
9741
#
9725
#
9742
#   Dependencies for 'lint_prog'
9726
#   Dependencies for 'run_tests'
9743
#
9727
#
9744
my @testprogdep;
9728
my @testprogdep;
9745
push @testprogdep, '$(GBE_OBJDIR)', '$(GBE_BINDIR)', '$(TESTPROGS)' if ( @TESTPROGS );
9729
push @testprogdep, '$(GBE_OBJDIR)', '$(GBE_BINDIR)', '$(TESTPROGS)' if ( @TESTPROGS );
9746
 
9730
 
-
 
9731
my @autoruntestdep;
-
 
9732
push @autoruntestdep, 'makefile.pl', '$(AUTOUNITTESTS)' if ( @TESTPROJECT_TO_ARUN );
-
 
9733
 
-
 
9734
my @runtestdep;
-
 
9735
push @runtestdep, 'makefile.pl'      if ( @TESTPROJECT_TO_URUN || @TESTPROJECT_TO_ARUN);
-
 
9736
push @runtestdep, '$(UNITTESTS)'     if ( @TESTPROJECT_TO_URUN);
-
 
9737
push @runtestdep, '$(AUTOUNITTESTS)' if ( @TESTPROJECT_TO_ARUN);
-
 
9738
 
9747
#
9739
#
9748
#   Dependencies for 'run_tests' and friends
9740
#   Dependencies for 'run_tests' and friends
9749
#
9741
#
9750
my @untestprogact;
9742
my @untestprogact;
9751
push @untestprogact ,RmFilesCmd( 'TESTPROGS' ) if ( @TESTPROGS );
9743
push @untestprogact ,RmFilesCmd( 'TESTPROGS' ) if ( @TESTPROGS );
Line 9806... Line 9798...
9806
#   Will be invoked by the calling wrappers
9798
#   Will be invoked by the calling wrappers
9807
#   Should not be invoked when cleaning
9799
#   Should not be invoked when cleaning
9808
#
9800
#
9809
PrintPhonyRule ('make_dir',       "@mkdirdep" );
9801
PrintPhonyRule ('make_dir',       "@mkdirdep" );
9810
 
9802
 
9811
 
-
 
9812
PrintPhonyRule ('generate',       "@generatedep @projectgendep" );
9803
PrintPhonyRule ('generate',       "@generatedep @projectgendep" );
9813
PrintPhonyRule ('ungenerate',     "@ungeneratedep",  \@ungenact);
9804
PrintPhonyRule ('ungenerate',     "@ungeneratedep",  \@ungenact);
9814
PrintPhonyRule ('unobj',          "",  \@unobjact);
9805
PrintPhonyRule ('unobj',          "",  \@unobjact);
9815
PrintPhonyRule ('make_lib',       "@libdep" );
9806
PrintPhonyRule ('make_lib',       "@libdep" );
9816
PrintPhonyRule ('lint_lib',       "@liblintdep" );
9807
PrintPhonyRule ('lint_lib',       "@liblintdep" );
Line 9818... Line 9809...
9818
PrintPhonyRule ('lint_shlib',     "@shliblintdep" );
9809
PrintPhonyRule ('lint_shlib',     "@shliblintdep" );
9819
PrintPhonyRule ('unmake_lib',     "", \@unlibact );
9810
PrintPhonyRule ('unmake_lib',     "", \@unlibact );
9820
PrintPhonyRule ('unmake_mlib',    "", \@unmlibact );
9811
PrintPhonyRule ('unmake_mlib',    "", \@unmlibact );
9821
PrintPhonyRule ('make_script',    "@scriptdep" );
9812
PrintPhonyRule ('make_script',    "@scriptdep" );
9822
PrintPhonyRule ('unmake_script',  "", \@unscriptact );
9813
PrintPhonyRule ('unmake_script',  "", \@unscriptact );
9823
PrintPhonyRule ('make_prog',      "@scriptdep @progdep @projectdep" );
9814
PrintPhonyRule ('make_prog',      "make_script @progdep @projectdep" );
9824
PrintPhonyRule ('lint_prog',      "@proglintdep" );
-
 
9825
PrintPhonyRule ('run_tests',      "@scriptdep @testprogdep" );
-
 
9826
PrintPhonyRule ('run_unit_tests', "@scriptdep @testprogdep" );
-
 
9827
PrintPhonyRule ('unmake_prog',    "unmake_script @projectcleandep", \@unprogact );
9815
PrintPhonyRule ('unmake_prog',    "unmake_script @projectcleandep", \@unprogact );
-
 
9816
PrintPhonyRule ('lint_prog',      "@proglintdep" );
-
 
9817
PrintPhonyRule ('run_tests',      "make_script @testprogdep @runtestdep" );
-
 
9818
PrintPhonyRule ('run_unit_tests', "make_script @testprogdep @autoruntestdep" );
9828
PrintPhonyRule ('make_test',      "@scriptdep @testprogdep" );
9819
PrintPhonyRule ('make_test',      "make_script @testprogdep" );
9829
PrintPhonyRule ('unmake_test',    "unmake_script", \@untestprogact );
9820
PrintPhonyRule ('unmake_test',    "unmake_script", \@untestprogact );
9830
 
9821
 
9831
#-------------------------------------------------------------------------------
9822
#-------------------------------------------------------------------------------
9832
#   Package and Installation Summary
9823
#   Package and Installation Summary
9833
#
9824
#
Line 9960... Line 9951...
9960
    Maketag( "make_mlib",           @mlibdep );
9951
    Maketag( "make_mlib",           @mlibdep );
9961
    Maketag( "make_install_shlib",  %INSTALL_SHLIBS || @shlibdep);
9952
    Maketag( "make_install_shlib",  %INSTALL_SHLIBS || @shlibdep);
9962
    Maketag( "make_script",         @scriptdep );
9953
    Maketag( "make_script",         @scriptdep );
9963
    Maketag( "make_prog",           @progdep || @projectdep );
9954
    Maketag( "make_prog",           @progdep || @projectdep );
9964
    Maketag( "make_test",           @testprogdep );
9955
    Maketag( "make_test",           @testprogdep );
9965
    Maketag( "run_tests",           @TESTS_TO_RUN || @TESTPROJECT_TO_URUN || $TESTS_TO_RUN);
9956
    Maketag( "run_tests",           $TESTS_TO_RUN     || @TESTPROJECT_TO_URUN || $TESTS_TO_AUTORUN || @TESTPROJECT_TO_ARUN );
9966
    Maketag( "run_unit_tests",      $TESTS_TO_AUTORUN || @TESTPROJECT_TO_ARUN);
9957
    Maketag( "run_unit_tests",      $TESTS_TO_AUTORUN || @TESTPROJECT_TO_ARUN );
9967
    Maketag( "install_hdr",         %INSTALL_HDRS );
9958
    Maketag( "install_hdr",         %INSTALL_HDRS );
9968
    Maketag( "install_class",       %INSTALL_CLSS );
9959
    Maketag( "install_class",       %INSTALL_CLSS );
9969
    Maketag( "install_lib",         %INSTALL_LIBS );
9960
    Maketag( "install_lib",         %INSTALL_LIBS );
9970
    Maketag( "install_prog",        %INSTALL_PROGS );
9961
    Maketag( "install_prog",        %INSTALL_PROGS );
9971
    Maketag( "deploy",              %DEPLOYPACKAGE );
9962
    Maketag( "deploy",              %DEPLOYPACKAGE );