Th dmp4.results and the dmp4.piped are identical.

When I then go and run:

C:/> perl unit2summary.pl < dmp4.piped

It works.

When however I run it with "perl units.pl COM1 | perl unit2summary.pl" it doesn't work.

The COM1 identifies the com port. It is part of a basic unit testing framework for a consumer electronics device.

The code for unit2summary.pl follows:

#!perl use strict; use warnings; my %results = (); my $total; my $command = ''; my $result = ''; while (<STDIN>) { chomp; next if /^\s*$/; if (/^COMMAND:\s+(.*)$/) { $command = $1; } if (/^RESULT:\s+(.*)$/) { $result = $1; print "$result: $command \n"; $results{$result}++; $total++; } } print "\n"; print "TESTS: $total "; foreach (keys %results) { print "$_: " . $results{$_} . " (" . abs($results{$_} * 100 / $tot +al) . "%) "; } print "\n";

A sample of the dmp4.piped follows:

COMMAND: mc creation TIMEOUT: 3 Creating various ContentData objects SUCCESS: Up-Casting HMediaAudioCD to HMediaCD SUCCESS: Up-Casting HMediaImageCD to HMediaCD SUCCESS: Up-Casting HMediaVideoCD to HMediaCD Working with const ContentData objects SUCCESS: Creation of new const-pointer HMediaAudioCD initialized w +ith non-const handle SUCCESS: Up-casting constHMediaAudioCD to constHMediaCD SUCCESS: Const-Casting from constHMediaAudioCD to HMediaAudioCD SUCCESS: Down-casting from constHMediaCD to constHMediaAudioCD SUCCESS: Making Const from cpHACDconst to ccpCD not successful RETURN: RESULT: PASSED COMMAND: mc attr TIMEOUT: 3 Creating HMediaAudioCD and add Title Attribute SUCCESS: HMediaAudioCD created SUCCESS: Checking for attribute "title" ERROR: Checking attribute value: This is my lif Changing value of Title attribute by re-adding with different valu +e SUCCESS: Checking for attribute "title" (2nd time) SUCCESS: Checking if attribute value was updated SUCCESS: Checking No. of attributes: 1 SUCCESS: Re-Checking No. of attributes: 1 SUCCESS: Removing attribute ERROR: Checking if attribute was really removed Adding more attributes SUCCESS: Attribute 0 has value A SUCCESS: Attribute 1 has value B SUCCESS: Attribute 2 has value C SUCCESS: Attribute 3 has value D SUCCESS: Attribute 4 has value E SUCCESS: Removing attribute at index 1 in list SUCCESS: Trying to remove non-existing attribute at index 5 ERROR: Removing all 4 Attributes: 4 elements left Checking setAttributeValue methods SUCCESS: Checking if setting value by name on non existing attribu +te prohibited SUCCESS: Checking if setting value by index on non existing attrib +ute prohibited SUCCESS: Setting value to new attribute SUCCESS: Re-setting value of existing attribute at index 0 Testing const char* - interface Adding attribute using const char* interface SUCCESS: Getting value of just added attribute SUCCESS: Checking if value of attribute is correct: somewhere over + the rainbow SUCCESS: Re-setting value of just added attribute using const char +* interface SUCCESS: Getting value of just changed attribute SUCCESS: Checking if value of attribute is correct: somewhere over + the rainbow RETURN: RESULT: FAILED

Any help appreciated.

-Andrew.


Andrew Tomazos  |  andrew@tomazos.com  |  www.tomazos.com

In reply to Re^2: cmd.exe piping stress by tomazos
in thread cmd.exe piping stress by tomazos

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.