Subversion Repositories DevTools

Rev

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

Rev 4805 Rev 4996
Line 44... Line 44...
44
 
44
 
45
#
45
#
46
#   Global Variables
46
#   Global Variables
47
#
47
#
48
my $opt_verbose = $ENV{'GBE_VERBOSE'};      # Allow global verbose
48
my $opt_verbose = $ENV{'GBE_VERBOSE'};      # Allow global verbose
49
my $opt_utfOuput;
-
 
50
my $opt_help = 0;
49
my $opt_help = 0;
51
 
50
 
52
#   Data to be passed into the filter function
51
#   Data to be passed into the filter function
53
#   Defined values are:
52
#   Defined values are:
54
#       ARGS            - An hash of user arguments
53
#       ARGS            - An hash of user arguments
Line 143... Line 142...
143
    #           in 'TOOLS/LIB'
142
    #           in 'TOOLS/LIB'
144
    #       within a Package declared
143
    #       within a Package declared
145
    #           with a BuildPkgArchive or a LinkPkgArchive
144
    #           with a BuildPkgArchive or a LinkPkgArchive
146
    #           within the packages 'tools/scripts' subdirectory
145
    #           within the packages 'tools/scripts' subdirectory
147
    #       within the current package
146
    #       within the current package
148
    #           Perl modules with ROOT/gbe/utfFilters_*.pm
147
    #           Perl modules with ROOT/gbe/utfFilters
149
    #                         or  ROOT/gbe/SomeDir/utfFilters_*.pm
-
 
150
    #                         or in the current directory
148
    #                         or in the current directory
151
 
149
 
152
    my $module_name = join('_','UtfFilter', lc $filterData{FILTER});
150
    my $module_name = join('_','UtfFilter', lc $filterData{FILTER});
153
    Verbose("Filter Module: $module_name");
151
    Verbose("Filter Module: $module_name");
154
 
152
 
Line 204... Line 202...
204
    {
202
    {
205
        $filterData{$entry}  = File::Spec->rel2abs($filterData{$entry} );
203
        $filterData{$entry}  = File::Spec->rel2abs($filterData{$entry} );
206
    }
204
    }
207
    
205
    
208
    #
206
    #
209
    #   Ensure that the output directory is present
-
 
210
    #       Store utf output directly into the packaging directory in a subdirectoy called 'utfResults'
-
 
211
    #           This location is known to the buildtool
-
 
212
    #       The output path is provided to the filter process
-
 
213
    #
-
 
214
    $opt_utfOuput = File::Spec->catfile($filterData{PKGDIR}, 'utfResults');
-
 
215
    $filterData{OUTDIR} = $opt_utfOuput;
-
 
216
    Error("Packaging directory does not exist") unless -d $filterData{PKGDIR};
-
 
217
    mkdir $opt_utfOuput;
-
 
218
    Error("Creating utfResults directory") unless -d $opt_utfOuput;
-
 
219
 
-
 
220
    #
-
 
221
    #   Add in known values from the environment
207
    #   Add in known values from the environment
222
    #
208
    #
223
    $filterData{TYPE} = $ENV{'GBE_MAKE_TYPE'};
209
    $filterData{TYPE} = $ENV{'GBE_MAKE_TYPE'};
224
    Error("Internal: EnvVar 'GBE_MAKE_TYPE' not specified") unless $filterData{TYPE};
210
    Error("Internal: EnvVar 'GBE_MAKE_TYPE' not specified") unless $filterData{TYPE};
225
 
211
 
Line 227... Line 213...
227
    Error("Internal: EnvVar 'GBE_UTFUID' not specified") unless $filterData{UFTUID};
213
    Error("Internal: EnvVar 'GBE_UTFUID' not specified") unless $filterData{UFTUID};
228
 
214
 
229
    $filterData{UTFNAME} = $ENV{'GBE_UTFNAME'};
215
    $filterData{UTFNAME} = $ENV{'GBE_UTFNAME'};
230
    Error("Internal: EnvVar 'GBE_UTFNAME' not specified") unless $filterData{UTFNAME};
216
    Error("Internal: EnvVar 'GBE_UTFNAME' not specified") unless $filterData{UTFNAME};
231
 
217
 
-
 
218
    $filterData{OUTFILE} = $ENV{'GBE_UTFFILE'};
-
 
219
    Error("Internal: EnvVar 'GBE_UTFFILE' not specified") unless $filterData{OUTFILE};
-
 
220
 
232
    $filterData{IDIR} = File::Spec->rel2abs('.');
221
    $filterData{IDIR} = File::Spec->rel2abs('.');
233
 
222
 
234
    #
223
    #
235
    #   Create a uniq filename as a suggestion to the filter tool
224
    # The environment provides a recommended (unqiue) output file
236
    #       The filter is not forced to use it, but it is a good idea
225
    #   Extact the directory part and ensure that it exists
-
 
226
    #   Brute file filename chop
237
    #
227
    #
-
 
228
    $filterData{OUTDIR} = $filterData{OUTFILE};
-
 
229
    $filterData{OUTDIR} =~ s~/[^/]*$~~;
-
 
230
    Error("Internal: OUTDIR is empty") unless (length($filterData{OUTDIR}) > 1);
-
 
231
 
-
 
232
    mkdir $filterData{OUTDIR};
238
    my $filename = File::Spec->catfile($opt_utfOuput, "$filterData{TARGET}-$filterData{TYPE}-$filterData{UFTUID}.xml");
233
    Error("Creating utfResults directory", "Path: $filterData{OUTDIR}") unless -d $filterData{OUTDIR};
239
 
234
 
240
    #   Allow the output file to be used
235
    #   Allow the output file to be used
241
    #       Not in the build system, but in a user development area
236
    #       Not in the build system, but in a user development area
-
 
237
    #
-
 
238
    my $filename = $filterData{OUTFILE};
242
    unlink $filename if -e $filename;
239
    unlink $filename if -e $filename;
243
    Error("Output file:Cannot delete $filename: $!") if -e $filename;
240
    Error("Output file: Cannot delete $filename: $!") if -e $filename;
244
    Verbose("Writing output to $filename");
241
    Verbose("Writing output to: $filename");
245
 
-
 
246
    $filterData{OUTFILE} = $filename;
-
 
247
 
242
 
248
    #
243
    #
249
    #   Change to the test directory
244
    #   Change to the test directory
250
    #       Only if required
245
    #       Only if required
251
    #       Ensure that the specified directory exists
246
    #       Ensure that the specified directory exists
Line 267... Line 262...
267
    }
262
    }
268
 
263
 
269
    #
264
    #
270
    #   Invoke the process method
265
    #   Invoke the process method
271
    #   If it has a problem it should use 'Error(...)' to report it
266
    #   If it has a problem it should use 'Error(...)' to report it
272
    #   There is no exit code processing
267
    #   There is no exit code processing, but if there is - needs to be false
273
    #
268
    #
274
    Message("Processing UTF test results using filter: $filterData{FILTER}");
269
    Message("Processing UTF test results using filter: $filterData{FILTER}");
275
    $module_name->processUtf(\%filterData);
270
    my $rv = $module_name->processUtf(\%filterData);
-
 
271
    Error ("Unit Test Failure: Errors detected in the result set")
-
 
272
        if ( defined($rv) && ! $rv );
276
}
273
}
277
 
274
 
278
=pod 1
275
=pod 1
279
 
276
 
280
=for htmltoc    SYSUTIL::
277
=for htmltoc    SYSUTIL::
Line 491... Line 488...
491
The Name of the filter 
488
The Name of the filter 
492
 
489
 
493
=item       IDIR
490
=item       IDIR
494
 
491
 
495
The absolute path to the working directory, when the module is invoked, before the working
492
The absolute path to the working directory, when the module is invoked, before the working
496
directory has been chnaged to 'DIR'.
493
directory has been changed to 'DIR'.
497
 
494
 
498
=item       INTERFACE       
495
=item       INTERFACE       
499
 
496
 
500
The absolute path to Interface directory
497
The absolute path to Interface directory
501
 
498