Subversion Repositories DevTools

Rev

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

Rev 6619 Rev 6898
Line 65... Line 65...
65
#       TYPE            - Built type P or D
65
#       TYPE            - Built type P or D
66
#       UTFUID          - Unique Test Identifier
66
#       UTFUID          - Unique Test Identifier
67
#       UTFNAME         - Test Name
67
#       UTFNAME         - Test Name
68
#       UTFTEST         - Recommended file root for test results
68
#       UTFTEST         - Recommended file root for test results
69
#       UTFRC           - Result Code from Unit Test run
69
#       UTFRC           - Result Code from Unit Test run
-
 
70
#       RCFILE          - Path to the RC File (optional)
70
#
71
#
71
our %filterData;
72
our %filterData;
72
 
73
 
73
#-------------------------------------------------------------------------------
74
#-------------------------------------------------------------------------------
74
# Function        : help
75
# Function        : help
Line 122... Line 123...
122
                    "local=s"       => \$filterData{LOCAL},
123
                    "local=s"       => \$filterData{LOCAL},
123
                    "target=s"      => \$filterData{TARGET},
124
                    "target=s"      => \$filterData{TARGET},
124
                    "pkgdir=s"      => \$filterData{PKGDIR},
125
                    "pkgdir=s"      => \$filterData{PKGDIR},
125
                    "type=s"        => \$filterData{TYPE},
126
                    "type=s"        => \$filterData{TYPE},
126
                    "dir=s"         => \$filterData{DIR},
127
                    "dir=s"         => \$filterData{DIR},
-
 
128
                    "rcfile=s"      => \$filterData{RCFILE},
127
                    "arg=s"         => sub {my ( $key, $value) = split('=', $_[1], 2); $filterData{ARGS}{$key} = $value;},
129
                    "arg=s"         => sub {my ( $key, $value) = split('=', $_[1], 2); $filterData{ARGS}{uc $key} = $value;},
128
                    );
130
                    );
129
 
131
 
130
    pod2usage(-verbose => 0, -input =>  __FILE__) if ($opt_help == 1 || ! $result || $argCount < 1);
132
    pod2usage(-verbose => 0, -input =>  __FILE__) if ($opt_help == 1 || ! $result || $argCount < 1);
131
    pod2usage(-verbose => 1, -input =>  __FILE__) if ($opt_help == 2 );
133
    pod2usage(-verbose => 1, -input =>  __FILE__) if ($opt_help == 2 );
132
    pod2usage(-verbose => 2, -input =>  __FILE__) if ($opt_help  > 2);
134
    pod2usage(-verbose => 2, -input =>  __FILE__) if ($opt_help  > 2);
Line 260... Line 262...
260
    }
262
    }
261
 
263
 
262
    #
264
    #
263
    #   Recover the result code of the unit test run
265
    #   Recover the result code of the unit test run
264
    #
266
    #
-
 
267
    if (defined $filterData{RCFILE}) {
265
    my $rcFile = join ('.', 'utf', $filterData{UTFUID}, 'rc');
268
        my $rcFile = $filterData{RCFILE};
266
    Verbose("Result Code File:", $rcFile);
269
        Verbose("Result Code File:", $rcFile);
267
    if (-f $rcFile)
270
        if (-f $rcFile)
268
    {
271
        {
269
        open( my $rcFile, '<', $rcFile) || Error ("Cannot open file : $!");
272
            open( my $rcFile, '<', $rcFile) || Error ("Cannot open file : $!");
270
        $filterData{UTFRC} = <$rcFile>;
273
            $filterData{UTFRC} = <$rcFile>;
271
        $filterData{UTFRC} =~ s~\s+$~~;
274
            $filterData{UTFRC} =~ s~\s+$~~;
272
        $filterData{UTFRC} =~ s~^\s+~~;
275
            $filterData{UTFRC} =~ s~^\s+~~;
273
        Verbose("Recover Result Code: ", $filterData{UTFRC});
276
            Verbose("Recover Result Code: ", $filterData{UTFRC});
274
        close $rcFile;
277
            close $rcFile;
-
 
278
        } else {
-
 
279
            Error("ResultCode file specified, but not found: $rcFile");
-
 
280
        }
275
    }
281
    } 
276
    #
282
    #
277
    #   Diagnostics
283
    #   Diagnostics
278
    #
284
    #
279
    if (IsVerbose(1))
285
    if (IsVerbose(1))
280
    {
286
    {
Line 305... Line 311...
305
# Returns         : Nothing 
311
# Returns         : Nothing 
306
#
312
#
307
sub writeXmlResults
313
sub writeXmlResults
308
{
314
{
309
    my ($options, $results) = @_;
315
    my ($options, $results) = @_;
-
 
316
 
-
 
317
    # Create a summary report - more for the user
-
 
318
    my $summary;
-
 
319
    my $total = 0;
-
 
320
    foreach my $entry ( @$results) {
-
 
321
        if (exists $entry->{OUTCOME}) {
-
 
322
            $summary->{$entry->{OUTCOME}}++;
-
 
323
            $total++;
-
 
324
        }
-
 
325
    }
-
 
326
    my $summaryString = '';
-
 
327
    my $joiner = '';
-
 
328
    foreach my $entry ( sort keys %{$summary}) {
-
 
329
        $summaryString .= $joiner . $entry . ':' . $summary->{$entry};
-
 
330
        $joiner = ', ';
-
 
331
    }
-
 
332
    Message("Total: $total. $summaryString");
-
 
333
    
-
 
334
 
310
    #
335
    #
311
    #   Create a data structure to contain the dummy test result
336
    #   Create a data structure to contain the dummy test result
312
    #   Insert TARGET and TYPE attributes
337
    #   Insert TARGET and TYPE attributes
313
    #
338
    #
314
    my %xml;
339
    my %xml;
Line 342... Line 367...
342
=head1 SYNOPSIS
367
=head1 SYNOPSIS
343
 
368
 
344
  $(GBE_PERL) -Mjats_runutf -e processUtf -- <args>
369
  $(GBE_PERL) -Mjats_runutf -e processUtf -- <args>
345
 
370
 
346
 Options:
371
 Options:
347
    -help[=n]       - Brief help message
372
    -help[=n]           - Brief help message
348
    -help -help     - Detailed help message
373
    -help -help         - Detailed help message
349
    -man            - Full documentation
374
    -man                - Full documentation
350
    -verbose[=n]    - Verbose operation
375
    -verbose[=n]        - Verbose operation
351
    -filter=name    - Name of the required processing filter
376
    -filter=name        - Name of the required processing filter
352
    -target=name    - Current build target
377
    -target=name        - Current build target
353
    -root=path      - Path to the root of the build
378
    -root=path          - Path to the root of the build
354
    -pkgdir=path    - Path to the packaging directory
379
    -pkgdir=path        - Path to the packaging directory
355
    -interface=path - Path to the build interface directory
380
    -interface=path     - Path to the build interface directory
356
    -local=path     - Path to the local build directory
381
    -local=path         - Path to the local build directory
357
    -dir=path       - Path to test directory
382
    -dir=path           - Path to test directory
-
 
383
    -rcfile=path        - Path to a file that contains the test result code
358
 
384
 
359
=head1 OPTIONS
385
=head1 OPTIONS
360
 
386
 
361
=over 8
387
=over 8
362
 
388
 
Line 405... Line 431...
405
The path to the directory in which the test was run.
431
The path to the directory in which the test was run.
406
 
432
 
407
This is optional. If provided the filter will be invoked with the 
433
This is optional. If provided the filter will be invoked with the 
408
current working directory
434
current working directory
409
 
435
 
-
 
436
=item B<-rcfile=path>
-
 
437
 
-
 
438
The path to the file that will contain the rsult code of the test run.
-
 
439
This is optional, but if provided it should exist
-
 
440
 
410
=back
441
=back
411
 
442
 
412
=head1 DESCRIPTION
443
=head1 DESCRIPTION
413
 
444
 
414
This tool is not designed to be run directly by users. It is intended to be run by the 
445
This tool is not designed to be run directly by users. It is intended to be run by the